Skip to content

Commit

Permalink
ALSA: tlv: add DECLARE_TLV_DB_RANGE()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Clemens Ladisch authored and Takashi Iwai committed Jul 16, 2012
1 parent 570aef5 commit bf1d1c9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/sound/tlv.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,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)
Expand Down

0 comments on commit bf1d1c9

Please sign in to comment.