diff options
-rw-r--r-- | include/sound/pcm.h | 11 | ||||
-rw-r--r-- | include/uapi/sound/asound.h | 3 |
2 files changed, 11 insertions, 3 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index d854fb31c000..6f3e10ca0e32 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); | |||
931 | static inline void snd_pcm_gettime(struct snd_pcm_runtime *runtime, | 931 | static inline void snd_pcm_gettime(struct snd_pcm_runtime *runtime, |
932 | struct timespec *tv) | 932 | struct timespec *tv) |
933 | { | 933 | { |
934 | if (runtime->tstamp_type == SNDRV_PCM_TSTAMP_TYPE_MONOTONIC) | 934 | switch (runtime->tstamp_type) { |
935 | case SNDRV_PCM_TSTAMP_TYPE_MONOTONIC: | ||
935 | ktime_get_ts(tv); | 936 | ktime_get_ts(tv); |
936 | else | 937 | break; |
938 | case SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW: | ||
939 | getrawmonotonic(tv); | ||
940 | break; | ||
941 | default: | ||
937 | getnstimeofday(tv); | 942 | getnstimeofday(tv); |
943 | break; | ||
944 | } | ||
938 | } | 945 | } |
939 | 946 | ||
940 | /* | 947 | /* |
diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h index 224948342f14..cbf7dc850a46 100644 --- a/include/uapi/sound/asound.h +++ b/include/uapi/sound/asound.h | |||
@@ -462,7 +462,8 @@ struct snd_xfern { | |||
462 | enum { | 462 | enum { |
463 | SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */ | 463 | SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */ |
464 | SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */ | 464 | SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */ |
465 | SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, | 465 | SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW, /* monotonic_raw (no NTP) */ |
466 | SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW, | ||
466 | }; | 467 | }; |
467 | 468 | ||
468 | /* channel positions */ | 469 | /* channel positions */ |