X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=include%2Fsound%2Fpcm.h;h=65f636223d392890283e16df109aea34ade635ce;hb=b751eef1fdffca5532344285f2fad0c60d2f0158;hp=76b34b5841ebc5e03301e1a034b212508aed19ab;hpb=b9f09a485937d9c3fb524b2fa140fee1d94856d0;p=linux-2.6 diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 76b34b5841..65f636223d 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -3,7 +3,7 @@ /* * Digital Audio (PCM) abstract layer - * Copyright (c) by Jaroslav Kysela + * Copyright (c) by Jaroslav Kysela * Abramo Bagnara * * @@ -301,8 +301,8 @@ struct snd_pcm_runtime { union snd_pcm_sync_id sync; /* hardware synchronization ID */ /* -- mmap -- */ - volatile struct snd_pcm_mmap_status *status; - volatile struct snd_pcm_mmap_control *control; + struct snd_pcm_mmap_status *status; + struct snd_pcm_mmap_control *control; /* -- locking / scheduling -- */ wait_queue_head_t sleep; @@ -323,6 +323,7 @@ struct snd_pcm_runtime { /* -- timer -- */ unsigned int timer_resolution; /* timer resolution */ + int tstamp_type; /* timestamp type */ /* -- DMA -- */ unsigned char *dma_area; /* DMA area */ @@ -952,6 +953,15 @@ void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream); void snd_pcm_timer_init(struct snd_pcm_substream *substream); 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) + do_posix_clock_monotonic_gettime(tv); + else + getnstimeofday(tv); +} + /* * Memory */