]> err.no Git - linux-2.6/blobdiff - include/sound/asound.h
alsa: add annotations to bitwise type snd_pcm_hw_param_t
[linux-2.6] / include / sound / asound.h
index ee753d782e2d3a659a8da4b1515e276d094d74a2..0309da2f11d382d439ca2ade1cbda117cc4f72b2 100644 (file)
@@ -302,6 +302,8 @@ typedef int __bitwise snd_pcm_hw_param_t;
 #define        SNDRV_PCM_HW_PARAM_SUBFORMAT    ((__force snd_pcm_hw_param_t) 2) /* Subformat */
 #define        SNDRV_PCM_HW_PARAM_FIRST_MASK   SNDRV_PCM_HW_PARAM_ACCESS
 #define        SNDRV_PCM_HW_PARAM_LAST_MASK    SNDRV_PCM_HW_PARAM_SUBFORMAT
+#define SNDRV_PCM_HW_PARAM_MASK_INDEX(var)     \
+       ((__force int)(var) - (__force int)SNDRV_PCM_HW_PARAM_FIRST_MASK)
 
 #define        SNDRV_PCM_HW_PARAM_SAMPLE_BITS  ((__force snd_pcm_hw_param_t) 8) /* Bits per sample */
 #define        SNDRV_PCM_HW_PARAM_FRAME_BITS   ((__force snd_pcm_hw_param_t) 9) /* Bits per frame */
@@ -317,6 +319,8 @@ typedef int __bitwise snd_pcm_hw_param_t;
 #define        SNDRV_PCM_HW_PARAM_TICK_TIME    ((__force snd_pcm_hw_param_t) 19) /* Approx tick duration in us */
 #define        SNDRV_PCM_HW_PARAM_FIRST_INTERVAL       SNDRV_PCM_HW_PARAM_SAMPLE_BITS
 #define        SNDRV_PCM_HW_PARAM_LAST_INTERVAL        SNDRV_PCM_HW_PARAM_TICK_TIME
+#define SNDRV_PCM_HW_PARAM_INTERVAL_INDEX(var) \
+       ((__force int)(var) - (__force int)SNDRV_PCM_HW_PARAM_FIRST_INTERVAL)
 
 #define SNDRV_PCM_HW_PARAMS_NORESAMPLE         (1<<0)  /* avoid rate resampling */
 
@@ -336,11 +340,11 @@ struct snd_mask {
 
 struct snd_pcm_hw_params {
        unsigned int flags;
-       struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - 
-                              SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
+       struct snd_mask masks[
+               SNDRV_PCM_HW_PARAM_MASK_INDEX(SNDRV_PCM_HW_PARAM_LAST_MASK) + 1];
        struct snd_mask mres[5];        /* reserved masks */
-       struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
-                                       SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
+       struct snd_interval intervals[
+               SNDRV_PCM_HW_PARAM_INTERVAL_INDEX(SNDRV_PCM_HW_PARAM_LAST_INTERVAL) + 1];
        struct snd_interval ires[9];    /* reserved intervals */
        unsigned int rmask;             /* W: requested masks */
        unsigned int cmask;             /* R: changed masks */
@@ -354,8 +358,8 @@ struct snd_pcm_hw_params {
 
 enum {
        SNDRV_PCM_TSTAMP_NONE = 0,
-       SNDRV_PCM_TSTAMP_MMAP,
-       SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_MMAP,
+       SNDRV_PCM_TSTAMP_ENABLE,
+       SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
 };
 
 struct snd_pcm_sw_params {
@@ -363,7 +367,7 @@ struct snd_pcm_sw_params {
        unsigned int period_step;
        unsigned int sleep_min;                 /* min ticks to sleep */
        snd_pcm_uframes_t avail_min;            /* min avail frames for wakeup */
-       snd_pcm_uframes_t xfer_align;           /* xfer size need to be a multiple */
+       snd_pcm_uframes_t xfer_align;           /* obsolete: xfer size need to be a multiple */
        snd_pcm_uframes_t start_threshold;      /* min hw_avail frames for automatic start */
        snd_pcm_uframes_t stop_threshold;       /* min avail frames for automatic stop */
        snd_pcm_uframes_t silence_threshold;    /* min distance from noise for silence filling */