|
@@ -598,9 +598,9 @@ int snd_pcm_status(struct snd_pcm_substream *substream,
|
|
if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_MMAP)
|
|
if (runtime->tstamp_mode == SNDRV_PCM_TSTAMP_MMAP)
|
|
status->tstamp = runtime->status->tstamp;
|
|
status->tstamp = runtime->status->tstamp;
|
|
else
|
|
else
|
|
- getnstimeofday(&status->tstamp);
|
|
|
|
|
|
+ snd_pcm_gettime(runtime, &status->tstamp);
|
|
} else
|
|
} else
|
|
- getnstimeofday(&status->tstamp);
|
|
|
|
|
|
+ snd_pcm_gettime(runtime, &status->tstamp);
|
|
status->appl_ptr = runtime->control->appl_ptr;
|
|
status->appl_ptr = runtime->control->appl_ptr;
|
|
status->hw_ptr = runtime->status->hw_ptr;
|
|
status->hw_ptr = runtime->status->hw_ptr;
|
|
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
|
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
|
@@ -688,7 +688,7 @@ static void snd_pcm_trigger_tstamp(struct snd_pcm_substream *substream)
|
|
if (runtime->trigger_master == NULL)
|
|
if (runtime->trigger_master == NULL)
|
|
return;
|
|
return;
|
|
if (runtime->trigger_master == substream) {
|
|
if (runtime->trigger_master == substream) {
|
|
- getnstimeofday(&runtime->trigger_tstamp);
|
|
|
|
|
|
+ snd_pcm_gettime(runtime, &runtime->trigger_tstamp);
|
|
} else {
|
|
} else {
|
|
snd_pcm_trigger_tstamp(runtime->trigger_master);
|
|
snd_pcm_trigger_tstamp(runtime->trigger_master);
|
|
runtime->trigger_tstamp = runtime->trigger_master->runtime->trigger_tstamp;
|
|
runtime->trigger_tstamp = runtime->trigger_master->runtime->trigger_tstamp;
|
|
@@ -2519,6 +2519,21 @@ static int snd_pcm_sync_ptr(struct snd_pcm_substream *substream,
|
|
return -EFAULT;
|
|
return -EFAULT;
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+static int snd_pcm_tstamp(struct snd_pcm_substream *substream, int __user *_arg)
|
|
|
|
+{
|
|
|
|
+ struct snd_pcm_runtime *runtime = substream->runtime;
|
|
|
|
+ int arg;
|
|
|
|
+
|
|
|
|
+ if (get_user(arg, _arg))
|
|
|
|
+ return -EFAULT;
|
|
|
|
+ if (arg < 0 || arg > SNDRV_PCM_TSTAMP_TYPE_LAST)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+ runtime->tstamp_type = SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY;
|
|
|
|
+ if (arg == SNDRV_PCM_TSTAMP_TYPE_MONOTONIC)
|
|
|
|
+ runtime->tstamp_type = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC;
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
|
|
static int snd_pcm_common_ioctl1(struct file *file,
|
|
static int snd_pcm_common_ioctl1(struct file *file,
|
|
struct snd_pcm_substream *substream,
|
|
struct snd_pcm_substream *substream,
|
|
@@ -2531,8 +2546,8 @@ static int snd_pcm_common_ioctl1(struct file *file,
|
|
return put_user(SNDRV_PCM_VERSION, (int __user *)arg) ? -EFAULT : 0;
|
|
return put_user(SNDRV_PCM_VERSION, (int __user *)arg) ? -EFAULT : 0;
|
|
case SNDRV_PCM_IOCTL_INFO:
|
|
case SNDRV_PCM_IOCTL_INFO:
|
|
return snd_pcm_info_user(substream, arg);
|
|
return snd_pcm_info_user(substream, arg);
|
|
- case SNDRV_PCM_IOCTL_TSTAMP: /* just for compatibility */
|
|
|
|
- return 0;
|
|
|
|
|
|
+ case SNDRV_PCM_IOCTL_TTSTAMP:
|
|
|
|
+ return snd_pcm_tstamp(substream, arg);
|
|
case SNDRV_PCM_IOCTL_HW_REFINE:
|
|
case SNDRV_PCM_IOCTL_HW_REFINE:
|
|
return snd_pcm_hw_refine_user(substream, arg);
|
|
return snd_pcm_hw_refine_user(substream, arg);
|
|
case SNDRV_PCM_IOCTL_HW_PARAMS:
|
|
case SNDRV_PCM_IOCTL_HW_PARAMS:
|