From: Clemens Ladisch Date: Sun, 20 Nov 2011 16:17:35 +0000 (+0100) Subject: ALSA: tlv: add DECLARE_TLV_DB_RANGE() X-Git-Tag: v3.12-rc1~2171^2~122^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf1d1c9b6179faa3bc32cee882462bc8eebde25d;p=kernel%2Fkernel-generic.git ALSA: tlv: add DECLARE_TLV_DB_RANGE() 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 Signed-off-by: Takashi Iwai --- diff --git a/include/sound/tlv.h b/include/sound/tlv.h index a9ff3db..a64d8fe 100644 --- a/include/sound/tlv.h +++ b/include/sound/tlv.h @@ -76,6 +76,10 @@ /* dB range container */ /* Each item is: */ +#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)