]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
ALSA: tlv: add DECLARE_TLV_DB_RANGE()
authorClemens Ladisch <clemens@ladisch.de>
Sun, 20 Nov 2011 16:17:35 +0000 (17:17 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 16 Jul 2012 08:02:18 +0000 (10:02 +0200)
Add a DECLARE_TLV_DB_RANGE() macro so that dB range information
can be specified without having to count the items manually for
TLV_DB_RANGE_HEAD().

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/tlv.h

index a9ff3db38296b95c9c7dc0366c31e187655762d2..a64d8fe3f855b408e5c45ffae359d23ebb6db7eb 100644 (file)
 
 /* dB range container */
 /* Each item is: <min> <max> <TLV> */
+#define TLV_DB_RANGE_ITEM(...) \
+       TLV_ITEM(SNDRV_CTL_TLVT_DB_RANGE, __VA_ARGS__)
+#define DECLARE_TLV_DB_RANGE(name, ...) \
+       unsigned int name[] = { TLV_DB_RANGE_ITEM(__VA_ARGS__) }
 /* 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)