diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2011-11-20 17:17:35 +0100 |
---|---|---|
committer | Zefan Li <lizefan@huawei.com> | 2016-03-21 09:17:58 +0800 |
commit | ba8a85ef4d9a31a069bf5a5264d02a0f30fdfe7c (patch) | |
tree | c79d211d8fb707ed0565ec3186fc616db749831c | |
parent | 320f8303347ff4d4c1de6b6d562d5030852d5507 (diff) |
ALSA: tlv: add DECLARE_TLV_DB_RANGE()
commit bf1d1c9b6179faa3bc32cee882462bc8eebde25d upstream.
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>
Signed-off-by: Zefan Li <lizefan@huawei.com>
-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 137d1654e8d6..49e7bd68c153 100644 --- a/include/sound/tlv.h +++ b/include/sound/tlv.h @@ -71,6 +71,10 @@ /* 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) |