diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/i2c/twl.h | 4 | ||||
| -rw-r--r-- | include/linux/usb/audio.h | 120 |
2 files changed, 118 insertions, 6 deletions
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index bf1c5be1f5b6..7897f3096560 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
| @@ -547,6 +547,10 @@ struct twl4030_codec_data { | |||
| 547 | unsigned int audio_mclk; | 547 | unsigned int audio_mclk; |
| 548 | struct twl4030_codec_audio_data *audio; | 548 | struct twl4030_codec_audio_data *audio; |
| 549 | struct twl4030_codec_vibra_data *vibra; | 549 | struct twl4030_codec_vibra_data *vibra; |
| 550 | |||
| 551 | /* twl6030 */ | ||
| 552 | int audpwron_gpio; /* audio power-on gpio */ | ||
| 553 | int naudint_irq; /* audio interrupt */ | ||
| 550 | }; | 554 | }; |
| 551 | 555 | ||
| 552 | struct twl4030_platform_data { | 556 | struct twl4030_platform_data { |
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h index eaf9dffe0a01..6bb293684eb8 100644 --- a/include/linux/usb/audio.h +++ b/include/linux/usb/audio.h | |||
| @@ -25,6 +25,9 @@ | |||
| 25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 | 25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 |
| 26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 | 26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 |
| 27 | 27 | ||
| 28 | #define UAC_VERSION_1 0x00 | ||
| 29 | #define UAC_VERSION_2 0x20 | ||
| 30 | |||
| 28 | /* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ | 31 | /* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ |
| 29 | #define UAC_HEADER 0x01 | 32 | #define UAC_HEADER 0x01 |
| 30 | #define UAC_INPUT_TERMINAL 0x02 | 33 | #define UAC_INPUT_TERMINAL 0x02 |
| @@ -32,8 +35,17 @@ | |||
| 32 | #define UAC_MIXER_UNIT 0x04 | 35 | #define UAC_MIXER_UNIT 0x04 |
| 33 | #define UAC_SELECTOR_UNIT 0x05 | 36 | #define UAC_SELECTOR_UNIT 0x05 |
| 34 | #define UAC_FEATURE_UNIT 0x06 | 37 | #define UAC_FEATURE_UNIT 0x06 |
| 35 | #define UAC_PROCESSING_UNIT 0x07 | 38 | #define UAC_PROCESSING_UNIT_V1 0x07 |
| 36 | #define UAC_EXTENSION_UNIT 0x08 | 39 | #define UAC_EXTENSION_UNIT_V1 0x08 |
| 40 | |||
| 41 | /* UAC v2.0 types */ | ||
| 42 | #define UAC_EFFECT_UNIT 0x07 | ||
| 43 | #define UAC_PROCESSING_UNIT_V2 0x08 | ||
| 44 | #define UAC_EXTENSION_UNIT_V2 0x09 | ||
| 45 | #define UAC_CLOCK_SOURCE 0x0a | ||
| 46 | #define UAC_CLOCK_SELECTOR 0x0b | ||
| 47 | #define UAC_CLOCK_MULTIPLIER 0x0c | ||
| 48 | #define UAC_SAMPLE_RATE_CONVERTER 0x0d | ||
| 37 | 49 | ||
| 38 | /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ | 50 | /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ |
| 39 | #define UAC_AS_GENERAL 0x01 | 51 | #define UAC_AS_GENERAL 0x01 |
| @@ -66,6 +78,10 @@ | |||
| 66 | 78 | ||
| 67 | #define UAC_GET_STAT 0xff | 79 | #define UAC_GET_STAT 0xff |
| 68 | 80 | ||
| 81 | /* Audio class v2.0 handles all the parameter calls differently */ | ||
| 82 | #define UAC2_CS_CUR 0x01 | ||
| 83 | #define UAC2_CS_RANGE 0x02 | ||
| 84 | |||
| 69 | /* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ | 85 | /* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ |
| 70 | #define UAC_MS_HEADER 0x01 | 86 | #define UAC_MS_HEADER 0x01 |
| 71 | #define UAC_MIDI_IN_JACK 0x02 | 87 | #define UAC_MIDI_IN_JACK 0x02 |
| @@ -81,7 +97,7 @@ | |||
| 81 | 97 | ||
| 82 | /* Terminal Control Selectors */ | 98 | /* Terminal Control Selectors */ |
| 83 | /* 4.3.2 Class-Specific AC Interface Descriptor */ | 99 | /* 4.3.2 Class-Specific AC Interface Descriptor */ |
| 84 | struct uac_ac_header_descriptor { | 100 | struct uac_ac_header_descriptor_v1 { |
| 85 | __u8 bLength; /* 8 + n */ | 101 | __u8 bLength; /* 8 + n */ |
| 86 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 102 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
| 87 | __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ | 103 | __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ |
| @@ -95,7 +111,7 @@ struct uac_ac_header_descriptor { | |||
| 95 | 111 | ||
| 96 | /* As above, but more useful for defining your own descriptors: */ | 112 | /* As above, but more useful for defining your own descriptors: */ |
| 97 | #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ | 113 | #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ |
| 98 | struct uac_ac_header_descriptor_##n { \ | 114 | struct uac_ac_header_descriptor_v1_##n { \ |
| 99 | __u8 bLength; \ | 115 | __u8 bLength; \ |
| 100 | __u8 bDescriptorType; \ | 116 | __u8 bDescriptorType; \ |
| 101 | __u8 bDescriptorSubtype; \ | 117 | __u8 bDescriptorSubtype; \ |
| @@ -130,8 +146,12 @@ struct uac_input_terminal_descriptor { | |||
| 130 | #define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 | 146 | #define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 |
| 131 | #define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 | 147 | #define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 |
| 132 | 148 | ||
| 149 | /* Terminals - control selectors */ | ||
| 150 | |||
| 151 | #define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01 | ||
| 152 | |||
| 133 | /* 4.3.2.2 Output Terminal Descriptor */ | 153 | /* 4.3.2.2 Output Terminal Descriptor */ |
| 134 | struct uac_output_terminal_descriptor { | 154 | struct uac_output_terminal_descriptor_v1 { |
| 135 | __u8 bLength; /* in bytes: 9 */ | 155 | __u8 bLength; /* in bytes: 9 */ |
| 136 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | 156 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ |
| 137 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ | 157 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ |
| @@ -171,7 +191,7 @@ struct uac_feature_unit_descriptor_##ch { \ | |||
| 171 | } __attribute__ ((packed)) | 191 | } __attribute__ ((packed)) |
| 172 | 192 | ||
| 173 | /* 4.5.2 Class-Specific AS Interface Descriptor */ | 193 | /* 4.5.2 Class-Specific AS Interface Descriptor */ |
| 174 | struct uac_as_header_descriptor { | 194 | struct uac_as_header_descriptor_v1 { |
| 175 | __u8 bLength; /* in bytes: 7 */ | 195 | __u8 bLength; /* in bytes: 7 */ |
| 176 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 196 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
| 177 | __u8 bDescriptorSubtype; /* AS_GENERAL */ | 197 | __u8 bDescriptorSubtype; /* AS_GENERAL */ |
| @@ -180,6 +200,19 @@ struct uac_as_header_descriptor { | |||
| 180 | __le16 wFormatTag; /* The Audio Data Format */ | 200 | __le16 wFormatTag; /* The Audio Data Format */ |
| 181 | } __attribute__ ((packed)); | 201 | } __attribute__ ((packed)); |
| 182 | 202 | ||
| 203 | struct uac_as_header_descriptor_v2 { | ||
| 204 | __u8 bLength; | ||
| 205 | __u8 bDescriptorType; | ||
| 206 | __u8 bDescriptorSubtype; | ||
| 207 | __u8 bTerminalLink; | ||
| 208 | __u8 bmControls; | ||
| 209 | __u8 bFormatType; | ||
| 210 | __u32 bmFormats; | ||
| 211 | __u8 bNrChannels; | ||
| 212 | __u32 bmChannelConfig; | ||
| 213 | __u8 iChannelNames; | ||
| 214 | } __attribute__((packed)); | ||
| 215 | |||
| 183 | #define UAC_DT_AS_HEADER_SIZE 7 | 216 | #define UAC_DT_AS_HEADER_SIZE 7 |
| 184 | 217 | ||
| 185 | /* Formats - A.1.1 Audio Data Format Type I Codes */ | 218 | /* Formats - A.1.1 Audio Data Format Type I Codes */ |
| @@ -232,11 +265,62 @@ struct uac_format_type_i_discrete_descriptor_##n { \ | |||
| 232 | 265 | ||
| 233 | #define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) | 266 | #define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) |
| 234 | 267 | ||
| 268 | struct uac_format_type_i_ext_descriptor { | ||
| 269 | __u8 bLength; | ||
| 270 | __u8 bDescriptorType; | ||
| 271 | __u8 bDescriptorSubtype; | ||
| 272 | __u8 bSubslotSize; | ||
| 273 | __u8 bFormatType; | ||
| 274 | __u8 bBitResolution; | ||
| 275 | __u8 bHeaderLength; | ||
| 276 | __u8 bControlSize; | ||
| 277 | __u8 bSideBandProtocol; | ||
| 278 | } __attribute__((packed)); | ||
| 279 | |||
| 280 | |||
| 281 | /* Formats - Audio Data Format Type I Codes */ | ||
| 282 | |||
| 283 | #define UAC_FORMAT_TYPE_II_MPEG 0x1001 | ||
| 284 | #define UAC_FORMAT_TYPE_II_AC3 0x1002 | ||
| 285 | |||
| 286 | struct uac_format_type_ii_discrete_descriptor { | ||
| 287 | __u8 bLength; | ||
| 288 | __u8 bDescriptorType; | ||
| 289 | __u8 bDescriptorSubtype; | ||
| 290 | __u8 bFormatType; | ||
| 291 | __le16 wMaxBitRate; | ||
| 292 | __le16 wSamplesPerFrame; | ||
| 293 | __u8 bSamFreqType; | ||
| 294 | __u8 tSamFreq[][3]; | ||
| 295 | } __attribute__((packed)); | ||
| 296 | |||
| 297 | struct uac_format_type_ii_ext_descriptor { | ||
| 298 | __u8 bLength; | ||
| 299 | __u8 bDescriptorType; | ||
| 300 | __u8 bDescriptorSubtype; | ||
| 301 | __u8 bFormatType; | ||
| 302 | __u16 wMaxBitRate; | ||
| 303 | __u16 wSamplesPerFrame; | ||
| 304 | __u8 bHeaderLength; | ||
| 305 | __u8 bSideBandProtocol; | ||
| 306 | } __attribute__((packed)); | ||
| 307 | |||
| 308 | /* type III */ | ||
| 309 | #define UAC_FORMAT_TYPE_III_IEC1937_AC3 0x2001 | ||
| 310 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG1_LAYER1 0x2002 | ||
| 311 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_NOEXT 0x2003 | ||
| 312 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_EXT 0x2004 | ||
| 313 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER1_LS 0x2005 | ||
| 314 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER23_LS 0x2006 | ||
| 315 | |||
| 235 | /* Formats - A.2 Format Type Codes */ | 316 | /* Formats - A.2 Format Type Codes */ |
| 236 | #define UAC_FORMAT_TYPE_UNDEFINED 0x0 | 317 | #define UAC_FORMAT_TYPE_UNDEFINED 0x0 |
| 237 | #define UAC_FORMAT_TYPE_I 0x1 | 318 | #define UAC_FORMAT_TYPE_I 0x1 |
| 238 | #define UAC_FORMAT_TYPE_II 0x2 | 319 | #define UAC_FORMAT_TYPE_II 0x2 |
| 239 | #define UAC_FORMAT_TYPE_III 0x3 | 320 | #define UAC_FORMAT_TYPE_III 0x3 |
| 321 | #define UAC_EXT_FORMAT_TYPE_I 0x81 | ||
| 322 | #define UAC_EXT_FORMAT_TYPE_II 0x82 | ||
| 323 | #define UAC_EXT_FORMAT_TYPE_III 0x83 | ||
| 240 | 324 | ||
| 241 | struct uac_iso_endpoint_descriptor { | 325 | struct uac_iso_endpoint_descriptor { |
| 242 | __u8 bLength; /* in bytes: 7 */ | 326 | __u8 bLength; /* in bytes: 7 */ |
| @@ -252,7 +336,31 @@ struct uac_iso_endpoint_descriptor { | |||
| 252 | #define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 | 336 | #define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 |
| 253 | #define UAC_EP_CS_ATTR_FILL_MAX 0x80 | 337 | #define UAC_EP_CS_ATTR_FILL_MAX 0x80 |
| 254 | 338 | ||
| 339 | /* Audio class v2.0: CLOCK_SOURCE descriptor */ | ||
| 340 | |||
| 341 | struct uac_clock_source_descriptor { | ||
| 342 | __u8 bLength; | ||
| 343 | __u8 bDescriptorType; | ||
| 344 | __u8 bDescriptorSubtype; | ||
| 345 | __u8 bClockID; | ||
| 346 | __u8 bmAttributes; | ||
| 347 | __u8 bmControls; | ||
| 348 | __u8 bAssocTerminal; | ||
| 349 | __u8 iClockSource; | ||
| 350 | } __attribute__((packed)); | ||
| 351 | |||
| 255 | /* A.10.2 Feature Unit Control Selectors */ | 352 | /* A.10.2 Feature Unit Control Selectors */ |
| 353 | |||
| 354 | struct uac_feature_unit_descriptor { | ||
| 355 | __u8 bLength; | ||
| 356 | __u8 bDescriptorType; | ||
| 357 | __u8 bDescriptorSubtype; | ||
| 358 | __u8 bUnitID; | ||
| 359 | __u8 bSourceID; | ||
| 360 | __u8 bControlSize; | ||
| 361 | __u8 controls[0]; /* variable length */ | ||
| 362 | } __attribute__((packed)); | ||
| 363 | |||
| 256 | #define UAC_FU_CONTROL_UNDEFINED 0x00 | 364 | #define UAC_FU_CONTROL_UNDEFINED 0x00 |
| 257 | #define UAC_MUTE_CONTROL 0x01 | 365 | #define UAC_MUTE_CONTROL 0x01 |
| 258 | #define UAC_VOLUME_CONTROL 0x02 | 366 | #define UAC_VOLUME_CONTROL 0x02 |
