diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2011-11-20 11:17:35 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-07-16 04:02:18 -0400 |
commit | bf1d1c9b6179faa3bc32cee882462bc8eebde25d (patch) | |
tree | aa3cc05edf9606d2bad631b2661bfd67ddfe8942 | |
parent | 570aef5de13df21e42eeb90db67e2436bee91bd4 (diff) |
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 <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | include/sound/tlv.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/sound/tlv.h b/include/sound/tlv.h index a9ff3db38296..a64d8fe3f855 100644 --- a/include/sound/tlv.h +++ b/include/sound/tlv.h | |||
@@ -76,6 +76,10 @@ | |||
76 | 76 | ||
77 | /* dB range container */ | 77 | /* dB range container */ |
78 | /* Each item is: <min> <max> <TLV> */ | 78 | /* Each item is: <min> <max> <TLV> */ |
79 | #define TLV_DB_RANGE_ITEM(...) \ | ||
80 | TLV_ITEM(SNDRV_CTL_TLVT_DB_RANGE, __VA_ARGS__) | ||
81 | #define DECLARE_TLV_DB_RANGE(name, ...) \ | ||
82 | unsigned int name[] = { TLV_DB_RANGE_ITEM(__VA_ARGS__) } | ||
79 | /* The below assumes that each item TLV is 4 words like DB_SCALE or LINEAR */ | 83 | /* The below assumes that each item TLV is 4 words like DB_SCALE or LINEAR */ |
80 | #define TLV_DB_RANGE_HEAD(num) \ | 84 | #define TLV_DB_RANGE_HEAD(num) \ |
81 | SNDRV_CTL_TLVT_DB_RANGE, 6 * (num) * sizeof(unsigned int) | 85 | SNDRV_CTL_TLVT_DB_RANGE, 6 * (num) * sizeof(unsigned int) |