]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/sound/tlv.h
softlockup: Documentation/sysctl/kernel.txt: fix softlockup_thresh description
[linux-2.6-omap-h63xx.git] / include / sound / tlv.h
index 7905841643df398f4c29519df9de0d7b4b345a7a..d136ea2181ed4f2fc0b92dd25b7cd0ac8e6c2860 100644 (file)
@@ -3,7 +3,7 @@
 
 /*
  *  Advanced Linux Sound Architecture - ALSA - Driver
- *  Copyright (c) 2006 by Jaroslav Kysela <perex@suse.cz>
+ *  Copyright (c) 2006 by Jaroslav Kysela <perex@perex.cz>
  *
  *
  *   This program is free software; you can redistribute it and/or modify
 #define SNDRV_CTL_TLVT_CONTAINER 0     /* one level down - group of TLVs */
 #define SNDRV_CTL_TLVT_DB_SCALE        1       /* dB scale */
 #define SNDRV_CTL_TLVT_DB_LINEAR 2     /* linear volume */
+#define SNDRV_CTL_TLVT_DB_RANGE 3      /* dB range container */
 
+#define TLV_DB_SCALE_ITEM(min, step, mute)                     \
+       SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int),      \
+       (min), ((step) & 0xffff) | ((mute) ? 0x10000 : 0)
 #define DECLARE_TLV_DB_SCALE(name, min, step, mute) \
-unsigned int name[] = { \
-        SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \
-        (min), ((step) & 0xffff) | ((mute) ? 0x10000 : 0) \
-}
+       unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) }
 
 /* linear volume between min_dB and max_dB (.01dB unit) */
+#define TLV_DB_LINEAR_ITEM(min_dB, max_dB)                 \
+       SNDRV_CTL_TLVT_DB_LINEAR, 2 * sizeof(unsigned int), \
+       (min_dB), (max_dB)
 #define DECLARE_TLV_DB_LINEAR(name, min_dB, max_dB)    \
-unsigned int name[] = { \
-        SNDRV_CTL_TLVT_DB_LINEAR, 2 * sizeof(unsigned int), \
-        (min_dB), (max_dB)                             \
-}
+       unsigned int name[] = { TLV_DB_LINEAR_ITEM(min_dB, max_dB) }
+
+/* dB range container */
+/* Each item is: <min> <max> <TLV> */
+/* The below assumes that each item TLV is 4 words like DB_SCALE or LINEAR */
+#define TLV_DB_RANGE_HEAD(num)                 \
+       SNDRV_CTL_TLVT_DB_RANGE, 6 * (num) * sizeof(unsigned int)
 
 #define TLV_DB_GAIN_MUTE       -9999999