Go to the documentation of this file.
34 #define SNDRV_CTL_TLVT_CONTAINER 0
35 #define SNDRV_CTL_TLVT_DB_SCALE 1
36 #define SNDRV_CTL_TLVT_DB_LINEAR 2
37 #define SNDRV_CTL_TLVT_DB_RANGE 3
38 #define SNDRV_CTL_TLVT_DB_MINMAX 4
39 #define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5
41 #define TLV_ITEM(type, ...) \
42 (type), TLV_LENGTH(__VA_ARGS__), __VA_ARGS__
43 #define TLV_LENGTH(...) \
44 ((unsigned int)sizeof((const unsigned int[]) { __VA_ARGS__ }))
46 #define TLV_CONTAINER_ITEM(...) \
47 TLV_ITEM(SNDRV_CTL_TLVT_CONTAINER, __VA_ARGS__)
48 #define DECLARE_TLV_CONTAINER(name, ...) \
49 unsigned int name[] = { TLV_CONTAINER_ITEM(__VA_ARGS__) }
51 #define TLV_DB_SCALE_MASK 0xffff
52 #define TLV_DB_SCALE_MUTE 0x10000
53 #define TLV_DB_SCALE_ITEM(min, step, mute) \
54 TLV_ITEM(SNDRV_CTL_TLVT_DB_SCALE, \
56 ((step) & TLV_DB_SCALE_MASK) | \
57 ((mute) ? TLV_DB_SCALE_MUTE : 0))
58 #define DECLARE_TLV_DB_SCALE(name, min, step, mute) \
59 unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) }
62 #define TLV_DB_MINMAX_ITEM(min_dB, max_dB) \
63 TLV_ITEM(SNDRV_CTL_TLVT_DB_MINMAX, (min_dB), (max_dB))
64 #define TLV_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \
65 TLV_ITEM(SNDRV_CTL_TLVT_DB_MINMAX_MUTE, (min_dB), (max_dB))
66 #define DECLARE_TLV_DB_MINMAX(name, min_dB, max_dB) \
67 unsigned int name[] = { TLV_DB_MINMAX_ITEM(min_dB, max_dB) }
68 #define DECLARE_TLV_DB_MINMAX_MUTE(name, min_dB, max_dB) \
69 unsigned int name[] = { TLV_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) }
72 #define TLV_DB_LINEAR_ITEM(min_dB, max_dB) \
73 TLV_ITEM(SNDRV_CTL_TLVT_DB_LINEAR, (min_dB), (max_dB))
74 #define DECLARE_TLV_DB_LINEAR(name, min_dB, max_dB) \
75 unsigned int name[] = { TLV_DB_LINEAR_ITEM(min_dB, max_dB) }
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__) }
84 #define TLV_DB_RANGE_HEAD(num) \
85 SNDRV_CTL_TLVT_DB_RANGE, 6 * (num) * sizeof(unsigned int)
87 #define TLV_DB_GAIN_MUTE -9999999
93 #define SNDRV_CTL_TLVT_CHMAP_FIXED 0x101
94 #define SNDRV_CTL_TLVT_CHMAP_VAR 0x102
95 #define SNDRV_CTL_TLVT_CHMAP_PAIRED 0x103