aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/sound/asound.h10
-rw-r--r--include/sound/pcm.h10
2 files changed, 18 insertions, 2 deletions
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 3ad534149c06..475eb71d65ba 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -138,7 +138,7 @@ enum {
138 * * 138 * *
139 *****************************************************************************/ 139 *****************************************************************************/
140 140
141#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 8) 141#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 9)
142 142
143typedef unsigned long snd_pcm_uframes_t; 143typedef unsigned long snd_pcm_uframes_t;
144typedef signed long snd_pcm_sframes_t; 144typedef signed long snd_pcm_sframes_t;
@@ -435,9 +435,15 @@ struct snd_xfern {
435}; 435};
436 436
437enum { 437enum {
438 SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */
439 SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */
440 SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
441};
442
443enum {
438 SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int), 444 SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int),
439 SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct snd_pcm_info), 445 SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct snd_pcm_info),
440 SNDRV_PCM_IOCTL_TSTAMP = _IOW('A', 0x02, int), 446 SNDRV_PCM_IOCTL_TTSTAMP = _IOW('A', 0x03, int),
441 SNDRV_PCM_IOCTL_HW_REFINE = _IOWR('A', 0x10, struct snd_pcm_hw_params), 447 SNDRV_PCM_IOCTL_HW_REFINE = _IOWR('A', 0x10, struct snd_pcm_hw_params),
442 SNDRV_PCM_IOCTL_HW_PARAMS = _IOWR('A', 0x11, struct snd_pcm_hw_params), 448 SNDRV_PCM_IOCTL_HW_PARAMS = _IOWR('A', 0x11, struct snd_pcm_hw_params),
443 SNDRV_PCM_IOCTL_HW_FREE = _IO('A', 0x12), 449 SNDRV_PCM_IOCTL_HW_FREE = _IO('A', 0x12),
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 5e9cc460075e..65f636223d39 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -323,6 +323,7 @@ struct snd_pcm_runtime {
323 323
324 /* -- timer -- */ 324 /* -- timer -- */
325 unsigned int timer_resolution; /* timer resolution */ 325 unsigned int timer_resolution; /* timer resolution */
326 int tstamp_type; /* timestamp type */
326 327
327 /* -- DMA -- */ 328 /* -- DMA -- */
328 unsigned char *dma_area; /* DMA area */ 329 unsigned char *dma_area; /* DMA area */
@@ -952,6 +953,15 @@ void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream);
952void snd_pcm_timer_init(struct snd_pcm_substream *substream); 953void snd_pcm_timer_init(struct snd_pcm_substream *substream);
953void snd_pcm_timer_done(struct snd_pcm_substream *substream); 954void snd_pcm_timer_done(struct snd_pcm_substream *substream);
954 955
956static inline void snd_pcm_gettime(struct snd_pcm_runtime *runtime,
957 struct timespec *tv)
958{
959 if (runtime->tstamp_type == SNDRV_PCM_TSTAMP_TYPE_MONOTONIC)
960 do_posix_clock_monotonic_gettime(tv);
961 else
962 getnstimeofday(tv);
963}
964
955/* 965/*
956 * Memory 966 * Memory
957 */ 967 */