audio.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. /*
  2. * <linux/usb/audio.h> -- USB Audio definitions.
  3. *
  4. * Copyright (C) 2006 Thumtronics Pty Ltd.
  5. * Developed for Thumtronics by Grey Innovation
  6. * Ben Williamson <ben.williamson@greyinnovation.com>
  7. *
  8. * This software is distributed under the terms of the GNU General Public
  9. * License ("GPL") version 2, as published by the Free Software Foundation.
  10. *
  11. * This file holds USB constants and structures defined
  12. * by the USB Device Class Definition for Audio Devices.
  13. * Comments below reference relevant sections of that document:
  14. *
  15. * http://www.usb.org/developers/devclass_docs/audio10.pdf
  16. *
  17. * Types and defines in this file are either specific to version 1.0 of
  18. * this standard or common for newer versions.
  19. */
  20. #ifndef __LINUX_USB_AUDIO_H
  21. #define __LINUX_USB_AUDIO_H
  22. #include <linux/types.h>
  23. /* bInterfaceProtocol values to denote the version of the standard used */
  24. #define UAC_VERSION_1 0x00
  25. #define UAC_VERSION_2 0x20
  26. /* A.2 Audio Interface Subclass Codes */
  27. #define USB_SUBCLASS_AUDIOCONTROL 0x01
  28. #define USB_SUBCLASS_AUDIOSTREAMING 0x02
  29. #define USB_SUBCLASS_MIDISTREAMING 0x03
  30. /* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */
  31. #define UAC_HEADER 0x01
  32. #define UAC_INPUT_TERMINAL 0x02
  33. #define UAC_OUTPUT_TERMINAL 0x03
  34. #define UAC_MIXER_UNIT 0x04
  35. #define UAC_SELECTOR_UNIT 0x05
  36. #define UAC_FEATURE_UNIT 0x06
  37. #define UAC_PROCESSING_UNIT_V1 0x07
  38. #define UAC_EXTENSION_UNIT_V1 0x08
  39. /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */
  40. #define UAC_AS_GENERAL 0x01
  41. #define UAC_FORMAT_TYPE 0x02
  42. #define UAC_FORMAT_SPECIFIC 0x03
  43. /* A.8 Audio Class-Specific Endpoint Descriptor Subtypes */
  44. #define UAC_EP_GENERAL 0x01
  45. /* A.9 Audio Class-Specific Request Codes */
  46. #define UAC_SET_ 0x00
  47. #define UAC_GET_ 0x80
  48. #define UAC__CUR 0x1
  49. #define UAC__MIN 0x2
  50. #define UAC__MAX 0x3
  51. #define UAC__RES 0x4
  52. #define UAC__MEM 0x5
  53. #define UAC_SET_CUR (UAC_SET_ | UAC__CUR)
  54. #define UAC_GET_CUR (UAC_GET_ | UAC__CUR)
  55. #define UAC_SET_MIN (UAC_SET_ | UAC__MIN)
  56. #define UAC_GET_MIN (UAC_GET_ | UAC__MIN)
  57. #define UAC_SET_MAX (UAC_SET_ | UAC__MAX)
  58. #define UAC_GET_MAX (UAC_GET_ | UAC__MAX)
  59. #define UAC_SET_RES (UAC_SET_ | UAC__RES)
  60. #define UAC_GET_RES (UAC_GET_ | UAC__RES)
  61. #define UAC_SET_MEM (UAC_SET_ | UAC__MEM)
  62. #define UAC_GET_MEM (UAC_GET_ | UAC__MEM)
  63. #define UAC_GET_STAT 0xff
  64. /* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */
  65. #define UAC_MS_HEADER 0x01
  66. #define UAC_MIDI_IN_JACK 0x02
  67. #define UAC_MIDI_OUT_JACK 0x03
  68. /* MIDI - A.1 MS Class-Specific Endpoint Descriptor Subtypes */
  69. #define UAC_MS_GENERAL 0x01
  70. /* Terminals - 2.1 USB Terminal Types */
  71. #define UAC_TERMINAL_UNDEFINED 0x100
  72. #define UAC_TERMINAL_STREAMING 0x101
  73. #define UAC_TERMINAL_VENDOR_SPEC 0x1FF
  74. /* Terminal Control Selectors */
  75. /* 4.3.2 Class-Specific AC Interface Descriptor */
  76. struct uac_ac_header_descriptor_v1 {
  77. __u8 bLength; /* 8 + n */
  78. __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
  79. __u8 bDescriptorSubtype; /* UAC_MS_HEADER */
  80. __le16 bcdADC; /* 0x0100 */
  81. __le16 wTotalLength; /* includes Unit and Terminal desc. */
  82. __u8 bInCollection; /* n */
  83. __u8 baInterfaceNr[]; /* [n] */
  84. } __attribute__ ((packed));
  85. #define UAC_DT_AC_HEADER_SIZE(n) (8 + (n))
  86. /* As above, but more useful for defining your own descriptors: */
  87. #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \
  88. struct uac_ac_header_descriptor_v1_##n { \
  89. __u8 bLength; \
  90. __u8 bDescriptorType; \
  91. __u8 bDescriptorSubtype; \
  92. __le16 bcdADC; \
  93. __le16 wTotalLength; \
  94. __u8 bInCollection; \
  95. __u8 baInterfaceNr[n]; \
  96. } __attribute__ ((packed))
  97. /* 4.3.2.1 Input Terminal Descriptor */
  98. struct uac_input_terminal_descriptor {
  99. __u8 bLength; /* in bytes: 12 */
  100. __u8 bDescriptorType; /* CS_INTERFACE descriptor type */
  101. __u8 bDescriptorSubtype; /* INPUT_TERMINAL descriptor subtype */
  102. __u8 bTerminalID; /* Constant uniquely terminal ID */
  103. __le16 wTerminalType; /* USB Audio Terminal Types */
  104. __u8 bAssocTerminal; /* ID of the Output Terminal associated */
  105. __u8 bNrChannels; /* Number of logical output channels */
  106. __le16 wChannelConfig;
  107. __u8 iChannelNames;
  108. __u8 iTerminal;
  109. } __attribute__ ((packed));
  110. #define UAC_DT_INPUT_TERMINAL_SIZE 12
  111. /* Terminals - 2.2 Input Terminal Types */
  112. #define UAC_INPUT_TERMINAL_UNDEFINED 0x200
  113. #define UAC_INPUT_TERMINAL_MICROPHONE 0x201
  114. #define UAC_INPUT_TERMINAL_DESKTOP_MICROPHONE 0x202
  115. #define UAC_INPUT_TERMINAL_PERSONAL_MICROPHONE 0x203
  116. #define UAC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE 0x204
  117. #define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205
  118. #define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206
  119. /* Terminals - control selectors */
  120. #define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01
  121. /* 4.3.2.2 Output Terminal Descriptor */
  122. struct uac_output_terminal_descriptor_v1 {
  123. __u8 bLength; /* in bytes: 9 */
  124. __u8 bDescriptorType; /* CS_INTERFACE descriptor type */
  125. __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */
  126. __u8 bTerminalID; /* Constant uniquely terminal ID */
  127. __le16 wTerminalType; /* USB Audio Terminal Types */
  128. __u8 bAssocTerminal; /* ID of the Input Terminal associated */
  129. __u8 bSourceID; /* ID of the connected Unit or Terminal*/
  130. __u8 iTerminal;
  131. } __attribute__ ((packed));
  132. #define UAC_DT_OUTPUT_TERMINAL_SIZE 9
  133. /* Terminals - 2.3 Output Terminal Types */
  134. #define UAC_OUTPUT_TERMINAL_UNDEFINED 0x300
  135. #define UAC_OUTPUT_TERMINAL_SPEAKER 0x301
  136. #define UAC_OUTPUT_TERMINAL_HEADPHONES 0x302
  137. #define UAC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303
  138. #define UAC_OUTPUT_TERMINAL_DESKTOP_SPEAKER 0x304
  139. #define UAC_OUTPUT_TERMINAL_ROOM_SPEAKER 0x305
  140. #define UAC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER 0x306
  141. #define UAC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER 0x307
  142. /* Set bControlSize = 2 as default setting */
  143. #define UAC_DT_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2)
  144. /* As above, but more useful for defining your own descriptors: */
  145. #define DECLARE_UAC_FEATURE_UNIT_DESCRIPTOR(ch) \
  146. struct uac_feature_unit_descriptor_##ch { \
  147. __u8 bLength; \
  148. __u8 bDescriptorType; \
  149. __u8 bDescriptorSubtype; \
  150. __u8 bUnitID; \
  151. __u8 bSourceID; \
  152. __u8 bControlSize; \
  153. __le16 bmaControls[ch + 1]; \
  154. __u8 iFeature; \
  155. } __attribute__ ((packed))
  156. /* 4.3.2.3 Mixer Unit Descriptor */
  157. struct uac_mixer_unit_descriptor {
  158. __u8 bLength;
  159. __u8 bDescriptorType;
  160. __u8 bDescriptorSubtype;
  161. __u8 bUnitID;
  162. __u8 bNrInPins;
  163. __u8 baSourceID[];
  164. } __attribute__ ((packed));
  165. static inline __u8 uac_mixer_unit_bNrChannels(struct uac_mixer_unit_descriptor *desc)
  166. {
  167. return desc->baSourceID[desc->bNrInPins];
  168. }
  169. static inline __u32 uac_mixer_unit_wChannelConfig(struct uac_mixer_unit_descriptor *desc,
  170. int protocol)
  171. {
  172. if (protocol == UAC_VERSION_1)
  173. return (desc->baSourceID[desc->bNrInPins + 2] << 8) |
  174. desc->baSourceID[desc->bNrInPins + 1];
  175. else
  176. return (desc->baSourceID[desc->bNrInPins + 4] << 24) |
  177. (desc->baSourceID[desc->bNrInPins + 3] << 16) |
  178. (desc->baSourceID[desc->bNrInPins + 2] << 8) |
  179. (desc->baSourceID[desc->bNrInPins + 1]);
  180. }
  181. static inline __u8 uac_mixer_unit_iChannelNames(struct uac_mixer_unit_descriptor *desc,
  182. int protocol)
  183. {
  184. return (protocol == UAC_VERSION_1) ?
  185. desc->baSourceID[desc->bNrInPins + 3] :
  186. desc->baSourceID[desc->bNrInPins + 5];
  187. }
  188. static inline __u8 *uac_mixer_unit_bmControls(struct uac_mixer_unit_descriptor *desc,
  189. int protocol)
  190. {
  191. return (protocol == UAC_VERSION_1) ?
  192. &desc->baSourceID[desc->bNrInPins + 4] :
  193. &desc->baSourceID[desc->bNrInPins + 6];
  194. }
  195. static inline __u8 uac_mixer_unit_iMixer(struct uac_mixer_unit_descriptor *desc)
  196. {
  197. __u8 *raw = (__u8 *) desc;
  198. return raw[desc->bLength - 1];
  199. }
  200. /* 4.3.2.4 Selector Unit Descriptor */
  201. struct uac_selector_unit_descriptor {
  202. __u8 bLength;
  203. __u8 bDescriptorType;
  204. __u8 bDescriptorSubtype;
  205. __u8 bUintID;
  206. __u8 bNrInPins;
  207. __u8 baSourceID[];
  208. } __attribute__ ((packed));
  209. static inline __u8 uac_selector_unit_iSelector(struct uac_selector_unit_descriptor *desc)
  210. {
  211. __u8 *raw = (__u8 *) desc;
  212. return raw[desc->bLength - 1];
  213. }
  214. /* 4.3.2.5 Feature Unit Descriptor */
  215. struct uac_feature_unit_descriptor {
  216. __u8 bLength;
  217. __u8 bDescriptorType;
  218. __u8 bDescriptorSubtype;
  219. __u8 bUnitID;
  220. __u8 bSourceID;
  221. __u8 bControlSize;
  222. __u8 bmaControls[0]; /* variable length */
  223. } __attribute__((packed));
  224. static inline __u8 uac_feature_unit_iFeature(struct uac_feature_unit_descriptor *desc)
  225. {
  226. __u8 *raw = (__u8 *) desc;
  227. return raw[desc->bLength - 1];
  228. }
  229. /* 4.3.2.6 Processing Unit Descriptors */
  230. struct uac_processing_unit_descriptor {
  231. __u8 bLength;
  232. __u8 bDescriptorType;
  233. __u8 bDescriptorSubtype;
  234. __u8 bUnitID;
  235. __u16 wProcessType;
  236. __u8 bNrInPins;
  237. __u8 baSourceID[];
  238. } __attribute__ ((packed));
  239. static inline __u8 uac_processing_unit_bNrChannels(struct uac_processing_unit_descriptor *desc)
  240. {
  241. return desc->baSourceID[desc->bNrInPins];
  242. }
  243. static inline __u32 uac_processing_unit_wChannelConfig(struct uac_processing_unit_descriptor *desc,
  244. int protocol)
  245. {
  246. if (protocol == UAC_VERSION_1)
  247. return (desc->baSourceID[desc->bNrInPins + 2] << 8) |
  248. desc->baSourceID[desc->bNrInPins + 1];
  249. else
  250. return (desc->baSourceID[desc->bNrInPins + 4] << 24) |
  251. (desc->baSourceID[desc->bNrInPins + 3] << 16) |
  252. (desc->baSourceID[desc->bNrInPins + 2] << 8) |
  253. (desc->baSourceID[desc->bNrInPins + 1]);
  254. }
  255. static inline __u8 uac_processing_unit_iChannelNames(struct uac_processing_unit_descriptor *desc,
  256. int protocol)
  257. {
  258. return (protocol == UAC_VERSION_1) ?
  259. desc->baSourceID[desc->bNrInPins + 3] :
  260. desc->baSourceID[desc->bNrInPins + 5];
  261. }
  262. static inline __u8 uac_processing_unit_bControlSize(struct uac_processing_unit_descriptor *desc,
  263. int protocol)
  264. {
  265. return (protocol == UAC_VERSION_1) ?
  266. desc->baSourceID[desc->bNrInPins + 4] :
  267. desc->baSourceID[desc->bNrInPins + 6];
  268. }
  269. static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_descriptor *desc,
  270. int protocol)
  271. {
  272. return (protocol == UAC_VERSION_1) ?
  273. &desc->baSourceID[desc->bNrInPins + 5] :
  274. &desc->baSourceID[desc->bNrInPins + 7];
  275. }
  276. static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_descriptor *desc,
  277. int protocol)
  278. {
  279. __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
  280. return desc->baSourceID[desc->bNrInPins + control_size];
  281. }
  282. static inline __u8 *uac_processing_unit_specific(struct uac_processing_unit_descriptor *desc,
  283. int protocol)
  284. {
  285. __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
  286. return &desc->baSourceID[desc->bNrInPins + control_size + 1];
  287. }
  288. /* 4.5.2 Class-Specific AS Interface Descriptor */
  289. struct uac_as_header_descriptor_v1 {
  290. __u8 bLength; /* in bytes: 7 */
  291. __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
  292. __u8 bDescriptorSubtype; /* AS_GENERAL */
  293. __u8 bTerminalLink; /* Terminal ID of connected Terminal */
  294. __u8 bDelay; /* Delay introduced by the data path */
  295. __le16 wFormatTag; /* The Audio Data Format */
  296. } __attribute__ ((packed));
  297. #define UAC_DT_AS_HEADER_SIZE 7
  298. /* Formats - A.1.1 Audio Data Format Type I Codes */
  299. #define UAC_FORMAT_TYPE_I_UNDEFINED 0x0
  300. #define UAC_FORMAT_TYPE_I_PCM 0x1
  301. #define UAC_FORMAT_TYPE_I_PCM8 0x2
  302. #define UAC_FORMAT_TYPE_I_IEEE_FLOAT 0x3
  303. #define UAC_FORMAT_TYPE_I_ALAW 0x4
  304. #define UAC_FORMAT_TYPE_I_MULAW 0x5
  305. struct uac_format_type_i_continuous_descriptor {
  306. __u8 bLength; /* in bytes: 8 + (ns * 3) */
  307. __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
  308. __u8 bDescriptorSubtype; /* FORMAT_TYPE */
  309. __u8 bFormatType; /* FORMAT_TYPE_1 */
  310. __u8 bNrChannels; /* physical channels in the stream */
  311. __u8 bSubframeSize; /* */
  312. __u8 bBitResolution;
  313. __u8 bSamFreqType;
  314. __u8 tLowerSamFreq[3];
  315. __u8 tUpperSamFreq[3];
  316. } __attribute__ ((packed));
  317. #define UAC_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14
  318. struct uac_format_type_i_discrete_descriptor {
  319. __u8 bLength; /* in bytes: 8 + (ns * 3) */
  320. __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */
  321. __u8 bDescriptorSubtype; /* FORMAT_TYPE */
  322. __u8 bFormatType; /* FORMAT_TYPE_1 */
  323. __u8 bNrChannels; /* physical channels in the stream */
  324. __u8 bSubframeSize; /* */
  325. __u8 bBitResolution;
  326. __u8 bSamFreqType;
  327. __u8 tSamFreq[][3];
  328. } __attribute__ ((packed));
  329. #define DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(n) \
  330. struct uac_format_type_i_discrete_descriptor_##n { \
  331. __u8 bLength; \
  332. __u8 bDescriptorType; \
  333. __u8 bDescriptorSubtype; \
  334. __u8 bFormatType; \
  335. __u8 bNrChannels; \
  336. __u8 bSubframeSize; \
  337. __u8 bBitResolution; \
  338. __u8 bSamFreqType; \
  339. __u8 tSamFreq[n][3]; \
  340. } __attribute__ ((packed))
  341. #define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3))
  342. struct uac_format_type_i_ext_descriptor {
  343. __u8 bLength;
  344. __u8 bDescriptorType;
  345. __u8 bDescriptorSubtype;
  346. __u8 bFormatType;
  347. __u8 bSubslotSize;
  348. __u8 bBitResolution;
  349. __u8 bHeaderLength;
  350. __u8 bControlSize;
  351. __u8 bSideBandProtocol;
  352. } __attribute__((packed));
  353. /* Formats - Audio Data Format Type I Codes */
  354. #define UAC_FORMAT_TYPE_II_MPEG 0x1001
  355. #define UAC_FORMAT_TYPE_II_AC3 0x1002
  356. struct uac_format_type_ii_discrete_descriptor {
  357. __u8 bLength;
  358. __u8 bDescriptorType;
  359. __u8 bDescriptorSubtype;
  360. __u8 bFormatType;
  361. __le16 wMaxBitRate;
  362. __le16 wSamplesPerFrame;
  363. __u8 bSamFreqType;
  364. __u8 tSamFreq[][3];
  365. } __attribute__((packed));
  366. struct uac_format_type_ii_ext_descriptor {
  367. __u8 bLength;
  368. __u8 bDescriptorType;
  369. __u8 bDescriptorSubtype;
  370. __u8 bFormatType;
  371. __u16 wMaxBitRate;
  372. __u16 wSamplesPerFrame;
  373. __u8 bHeaderLength;
  374. __u8 bSideBandProtocol;
  375. } __attribute__((packed));
  376. /* type III */
  377. #define UAC_FORMAT_TYPE_III_IEC1937_AC3 0x2001
  378. #define UAC_FORMAT_TYPE_III_IEC1937_MPEG1_LAYER1 0x2002
  379. #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_NOEXT 0x2003
  380. #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_EXT 0x2004
  381. #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER1_LS 0x2005
  382. #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER23_LS 0x2006
  383. /* Formats - A.2 Format Type Codes */
  384. #define UAC_FORMAT_TYPE_UNDEFINED 0x0
  385. #define UAC_FORMAT_TYPE_I 0x1
  386. #define UAC_FORMAT_TYPE_II 0x2
  387. #define UAC_FORMAT_TYPE_III 0x3
  388. #define UAC_EXT_FORMAT_TYPE_I 0x81
  389. #define UAC_EXT_FORMAT_TYPE_II 0x82
  390. #define UAC_EXT_FORMAT_TYPE_III 0x83
  391. struct uac_iso_endpoint_descriptor {
  392. __u8 bLength; /* in bytes: 7 */
  393. __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */
  394. __u8 bDescriptorSubtype; /* EP_GENERAL */
  395. __u8 bmAttributes;
  396. __u8 bLockDelayUnits;
  397. __le16 wLockDelay;
  398. };
  399. #define UAC_ISO_ENDPOINT_DESC_SIZE 7
  400. #define UAC_EP_CS_ATTR_SAMPLE_RATE 0x01
  401. #define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02
  402. #define UAC_EP_CS_ATTR_FILL_MAX 0x80
  403. /* A.10.2 Feature Unit Control Selectors */
  404. #define UAC_FU_CONTROL_UNDEFINED 0x00
  405. #define UAC_MUTE_CONTROL 0x01
  406. #define UAC_VOLUME_CONTROL 0x02
  407. #define UAC_BASS_CONTROL 0x03
  408. #define UAC_MID_CONTROL 0x04
  409. #define UAC_TREBLE_CONTROL 0x05
  410. #define UAC_GRAPHIC_EQUALIZER_CONTROL 0x06
  411. #define UAC_AUTOMATIC_GAIN_CONTROL 0x07
  412. #define UAC_DELAY_CONTROL 0x08
  413. #define UAC_BASS_BOOST_CONTROL 0x09
  414. #define UAC_LOUDNESS_CONTROL 0x0a
  415. #define UAC_FU_MUTE (1 << (UAC_MUTE_CONTROL - 1))
  416. #define UAC_FU_VOLUME (1 << (UAC_VOLUME_CONTROL - 1))
  417. #define UAC_FU_BASS (1 << (UAC_BASS_CONTROL - 1))
  418. #define UAC_FU_MID (1 << (UAC_MID_CONTROL - 1))
  419. #define UAC_FU_TREBLE (1 << (UAC_TREBLE_CONTROL - 1))
  420. #define UAC_FU_GRAPHIC_EQ (1 << (UAC_GRAPHIC_EQUALIZER_CONTROL - 1))
  421. #define UAC_FU_AUTO_GAIN (1 << (UAC_AUTOMATIC_GAIN_CONTROL - 1))
  422. #define UAC_FU_DELAY (1 << (UAC_DELAY_CONTROL - 1))
  423. #define UAC_FU_BASS_BOOST (1 << (UAC_BASS_BOOST_CONTROL - 1))
  424. #define UAC_FU_LOUDNESS (1 << (UAC_LOUDNESS_CONTROL - 1))
  425. #ifdef __KERNEL__
  426. struct usb_audio_control {
  427. struct list_head list;
  428. const char *name;
  429. u8 type;
  430. int data[5];
  431. int (*set)(struct usb_audio_control *con, u8 cmd, int value);
  432. int (*get)(struct usb_audio_control *con, u8 cmd);
  433. };
  434. struct usb_audio_control_selector {
  435. struct list_head list;
  436. struct list_head control;
  437. u8 id;
  438. const char *name;
  439. u8 type;
  440. struct usb_descriptor_header *desc;
  441. };
  442. #endif /* __KERNEL__ */
  443. #endif /* __LINUX_USB_AUDIO_H */