• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This header was generated from the Linux kernel headers by update_headers.py,
3  * to provide necessary information from kernel to userspace, such as constants,
4  * structures, and macros, and thus, contains no copyrightable information.
5  */
6 #ifndef __UAPI_SOUND_TLV_H
7 #define __UAPI_SOUND_TLV_H
8 #define SNDRV_CTL_TLVT_CONTAINER 0
9 #define SNDRV_CTL_TLVT_DB_SCALE	1
10 #define SNDRV_CTL_TLVT_DB_LINEAR 2
11 #define SNDRV_CTL_TLVT_DB_RANGE 3
12 #define SNDRV_CTL_TLVT_DB_MINMAX 4
13 #define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5
14 #define SNDRV_CTL_TLVT_CHMAP_FIXED	0x101
15 #define SNDRV_CTL_TLVT_CHMAP_VAR	0x102
16 #define SNDRV_CTL_TLVT_CHMAP_PAIRED	0x103
17 #define SNDRV_CTL_TLVD_ITEM(type, ...) \
18 	(type), SNDRV_CTL_TLVD_LENGTH(__VA_ARGS__), __VA_ARGS__
19 #define SNDRV_CTL_TLVD_LENGTH(...) \
20 	((unsigned int)sizeof((const unsigned int[]) { __VA_ARGS__ }))
21 #define SNDRV_CTL_TLVO_TYPE		0
22 #define SNDRV_CTL_TLVO_LEN		1
23 #define SNDRV_CTL_TLVD_CONTAINER_ITEM(...) \
24 	SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_CONTAINER, __VA_ARGS__)
25 #define SNDRV_CTL_TLVD_DECLARE_CONTAINER(name, ...) \
26 	unsigned int name[] = { \
27 		SNDRV_CTL_TLVD_CONTAINER_ITEM(__VA_ARGS__) \
28 	}
29 #define SNDRV_CTL_TLVD_DB_SCALE_MASK	0xffff
30 #define SNDRV_CTL_TLVD_DB_SCALE_MUTE	0x10000
31 #define SNDRV_CTL_TLVD_DB_SCALE_ITEM(min, step, mute) \
32 	SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_SCALE, \
33 			    (min), \
34 			    ((step) & SNDRV_CTL_TLVD_DB_SCALE_MASK) | \
35 			     ((mute) ? SNDRV_CTL_TLVD_DB_SCALE_MUTE : 0))
36 #define SNDRV_CTL_TLVD_DECLARE_DB_SCALE(name, min, step, mute) \
37 	unsigned int name[] = { \
38 		SNDRV_CTL_TLVD_DB_SCALE_ITEM(min, step, mute) \
39 	}
40 #define SNDRV_CTL_TLVO_DB_SCALE_MIN		2
41 #define SNDRV_CTL_TLVO_DB_SCALE_MUTE_AND_STEP	3
42 #define SNDRV_CTL_TLVD_DB_MINMAX_ITEM(min_dB, max_dB) \
43 	SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_MINMAX, (min_dB), (max_dB))
44 #define SNDRV_CTL_TLVD_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \
45 	SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_MINMAX_MUTE, (min_dB), (max_dB))
46 #define SNDRV_CTL_TLVD_DECLARE_DB_MINMAX(name, min_dB, max_dB) \
47 	unsigned int name[] = { \
48 		SNDRV_CTL_TLVD_DB_MINMAX_ITEM(min_dB, max_dB) \
49 	}
50 #define SNDRV_CTL_TLVD_DECLARE_DB_MINMAX_MUTE(name, min_dB, max_dB) \
51 	unsigned int name[] = { \
52 		SNDRV_CTL_TLVD_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \
53 	}
54 #define SNDRV_CTL_TLVO_DB_MINMAX_MIN	2
55 #define SNDRV_CTL_TLVO_DB_MINMAX_MAX	3
56 #define SNDRV_CTL_TLVD_DB_LINEAR_ITEM(min_dB, max_dB) \
57 	SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_LINEAR, (min_dB), (max_dB))
58 #define SNDRV_CTL_TLVD_DECLARE_DB_LINEAR(name, min_dB, max_dB) \
59 	unsigned int name[] = { \
60 		SNDRV_CTL_TLVD_DB_LINEAR_ITEM(min_dB, max_dB) \
61 	}
62 #define SNDRV_CTL_TLVO_DB_LINEAR_MIN	2
63 #define SNDRV_CTL_TLVO_DB_LINEAR_MAX	3
64 #define SNDRV_CTL_TLVD_DB_RANGE_ITEM(...) \
65 	SNDRV_CTL_TLVD_ITEM(SNDRV_CTL_TLVT_DB_RANGE, __VA_ARGS__)
66 #define SNDRV_CTL_TLVD_DECLARE_DB_RANGE(name, ...) \
67 	unsigned int name[] = { \
68 		SNDRV_CTL_TLVD_DB_RANGE_ITEM(__VA_ARGS__) \
69 	}
70 #define SNDRV_CTL_TLVD_DB_GAIN_MUTE	-9999999
71 #endif
72