summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sound/pcm.h11
-rw-r--r--include/uapi/sound/asound.h3
2 files changed, 11 insertions, 3 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index d854fb3..6f3e10c 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -931,10 +931,17 @@ void snd_pcm_timer_done(struct snd_pcm_substream *substream);
static inline void snd_pcm_gettime(struct snd_pcm_runtime *runtime,
struct timespec *tv)
{
- if (runtime->tstamp_type == SNDRV_PCM_TSTAMP_TYPE_MONOTONIC)
+ switch (runtime->tstamp_type) {
+ case SNDRV_PCM_TSTAMP_TYPE_MONOTONIC:
ktime_get_ts(tv);
- else
+ break;
+ case SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW:
+ getrawmonotonic(tv);
+ break;
+ default:
getnstimeofday(tv);
+ break;
+ }
}
/*
diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h
index 2249483..cbf7dc85 100644
--- a/include/uapi/sound/asound.h
+++ b/include/uapi/sound/asound.h
@@ -462,7 +462,8 @@ struct snd_xfern {
enum {
SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */
SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */
- SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
+ SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW, /* monotonic_raw (no NTP) */
+ SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
};
/* channel positions */