Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: usb-audio: unify UAC macros and struct names

Get rid of the last occurances of _v1 suffixes, and move the version
number right after the "uac" string. Now things are consitent again.

Sorry for the forth and back, but it just looks much nicer this way.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Daniel Mack and committed by
Takashi Iwai
69da9bcb f22aa949

+21 -21
+3 -3
drivers/usb/gadget/f_audio.c
··· 61 61 #define UAC_DT_TOTAL_LENGTH (UAC_DT_AC_HEADER_LENGTH + UAC_DT_INPUT_TERMINAL_SIZE \ 62 62 + UAC_DT_OUTPUT_TERMINAL_SIZE + UAC_DT_FEATURE_UNIT_SIZE(0)) 63 63 /* B.3.2 Class-Specific AC Interface Descriptor */ 64 - static struct uac_ac_header_descriptor_v1_2 ac_header_desc = { 64 + static struct uac1_ac_header_descriptor_2 ac_header_desc = { 65 65 .bLength = UAC_DT_AC_HEADER_LENGTH, 66 66 .bDescriptorType = USB_DT_CS_INTERFACE, 67 67 .bDescriptorSubtype = UAC_HEADER, ··· 125 125 }; 126 126 127 127 #define OUTPUT_TERMINAL_ID 3 128 - static struct uac_output_terminal_descriptor_v1 output_terminal_desc = { 128 + static struct uac1_output_terminal_descriptor output_terminal_desc = { 129 129 .bLength = UAC_DT_OUTPUT_TERMINAL_SIZE, 130 130 .bDescriptorType = USB_DT_CS_INTERFACE, 131 131 .bDescriptorSubtype = UAC_OUTPUT_TERMINAL, ··· 155 155 }; 156 156 157 157 /* B.4.2 Class-Specific AS Interface Descriptor */ 158 - static struct uac_as_header_descriptor_v1 as_header_desc = { 158 + static struct uac1_as_header_descriptor as_header_desc = { 159 159 .bLength = UAC_DT_AS_HEADER_SIZE, 160 160 .bDescriptorType = USB_DT_CS_INTERFACE, 161 161 .bDescriptorSubtype = UAC_AS_GENERAL,
+1 -1
drivers/usb/gadget/gmidi.c
··· 238 238 }; 239 239 240 240 /* B.3.2 Class-Specific AC Interface Descriptor */ 241 - static const struct uac_ac_header_descriptor_v1_1 ac_header_desc = { 241 + static const struct uac1_ac_header_descriptor_1 ac_header_desc = { 242 242 .bLength = UAC_DT_AC_HEADER_SIZE(1), 243 243 .bDescriptorType = USB_DT_CS_INTERFACE, 244 244 .bDescriptorSubtype = USB_MS_HEADER,
+1 -1
include/linux/usb/audio-v2.h
··· 121 121 122 122 /* 4.9.2 Class-Specific AS Interface Descriptor */ 123 123 124 - struct uac_as_header_descriptor_v2 { 124 + struct uac2_as_header_descriptor { 125 125 __u8 bLength; 126 126 __u8 bDescriptorType; 127 127 __u8 bDescriptorSubtype;
+6 -6
include/linux/usb/audio.h
··· 39 39 #define UAC_MIXER_UNIT 0x04 40 40 #define UAC_SELECTOR_UNIT 0x05 41 41 #define UAC_FEATURE_UNIT 0x06 42 - #define UAC_PROCESSING_UNIT_V1 0x07 43 - #define UAC_EXTENSION_UNIT_V1 0x08 42 + #define UAC1_PROCESSING_UNIT 0x07 43 + #define UAC1_EXTENSION_UNIT 0x08 44 44 45 45 /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ 46 46 #define UAC_AS_GENERAL 0x01 ··· 151 151 152 152 /* Terminal Control Selectors */ 153 153 /* 4.3.2 Class-Specific AC Interface Descriptor */ 154 - struct uac_ac_header_descriptor_v1 { 154 + struct uac1_ac_header_descriptor { 155 155 __u8 bLength; /* 8 + n */ 156 156 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ 157 157 __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ ··· 165 165 166 166 /* As above, but more useful for defining your own descriptors: */ 167 167 #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ 168 - struct uac_ac_header_descriptor_v1_##n { \ 168 + struct uac1_ac_header_descriptor_##n { \ 169 169 __u8 bLength; \ 170 170 __u8 bDescriptorType; \ 171 171 __u8 bDescriptorSubtype; \ ··· 205 205 #define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01 206 206 207 207 /* 4.3.2.2 Output Terminal Descriptor */ 208 - struct uac_output_terminal_descriptor_v1 { 208 + struct uac1_output_terminal_descriptor { 209 209 __u8 bLength; /* in bytes: 9 */ 210 210 __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ 211 211 __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ ··· 395 395 } 396 396 397 397 /* 4.5.2 Class-Specific AS Interface Descriptor */ 398 - struct uac_as_header_descriptor_v1 { 398 + struct uac1_as_header_descriptor { 399 399 __u8 bLength; /* in bytes: 7 */ 400 400 __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ 401 401 __u8 bDescriptorSubtype; /* AS_GENERAL */
+1 -1
sound/usb/card.c
··· 217 217 218 218 switch (protocol) { 219 219 case UAC_VERSION_1: { 220 - struct uac_ac_header_descriptor_v1 *h1 = control_header; 220 + struct uac1_ac_header_descriptor *h1 = control_header; 221 221 222 222 if (!h1->bInCollection) { 223 223 snd_printk(KERN_INFO "skipping empty audio interface (v1)\n");
+2 -2
sound/usb/endpoint.c
··· 275 275 /* get audio formats */ 276 276 switch (protocol) { 277 277 case UAC_VERSION_1: { 278 - struct uac_as_header_descriptor_v1 *as = 278 + struct uac1_as_header_descriptor *as = 279 279 snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL); 280 280 281 281 if (!as) { ··· 297 297 case UAC_VERSION_2: { 298 298 struct uac2_input_terminal_descriptor *input_term; 299 299 struct uac2_output_terminal_descriptor *output_term; 300 - struct uac_as_header_descriptor_v2 *as = 300 + struct uac2_as_header_descriptor *as = 301 301 snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL); 302 302 303 303 if (!as) {
+7 -7
sound/usb/mixer.c
··· 582 582 switch (iterm->type >> 16) { 583 583 case UAC_SELECTOR_UNIT: 584 584 strcpy(name, "Selector"); return 8; 585 - case UAC_PROCESSING_UNIT_V1: 585 + case UAC1_PROCESSING_UNIT: 586 586 strcpy(name, "Process Unit"); return 12; 587 - case UAC_EXTENSION_UNIT_V1: 587 + case UAC1_EXTENSION_UNIT: 588 588 strcpy(name, "Ext Unit"); return 8; 589 589 case UAC_MIXER_UNIT: 590 590 strcpy(name, "Mixer"); return 5; ··· 672 672 term->name = uac_selector_unit_iSelector(d); 673 673 return 0; 674 674 } 675 - case UAC_PROCESSING_UNIT_V1: 676 - case UAC_EXTENSION_UNIT_V1: { 675 + case UAC1_PROCESSING_UNIT: 676 + case UAC1_EXTENSION_UNIT: { 677 677 struct uac_processing_unit_descriptor *d = p1; 678 678 if (d->bNrInPins) { 679 679 id = d->baSourceID[0]; ··· 1855 1855 return parse_audio_selector_unit(state, unitid, p1); 1856 1856 case UAC_FEATURE_UNIT: 1857 1857 return parse_audio_feature_unit(state, unitid, p1); 1858 - case UAC_PROCESSING_UNIT_V1: 1858 + case UAC1_PROCESSING_UNIT: 1859 1859 /* UAC2_EFFECT_UNIT has the same value */ 1860 1860 if (state->mixer->protocol == UAC_VERSION_1) 1861 1861 return parse_audio_processing_unit(state, unitid, p1); 1862 1862 else 1863 1863 return 0; /* FIXME - effect units not implemented yet */ 1864 - case UAC_EXTENSION_UNIT_V1: 1864 + case UAC1_EXTENSION_UNIT: 1865 1865 /* UAC2_PROCESSING_UNIT_V2 has the same value */ 1866 1866 if (state->mixer->protocol == UAC_VERSION_1) 1867 1867 return parse_audio_extension_unit(state, unitid, p1); ··· 1925 1925 p = NULL; 1926 1926 while ((p = snd_usb_find_csint_desc(hostif->extra, hostif->extralen, p, UAC_OUTPUT_TERMINAL)) != NULL) { 1927 1927 if (mixer->protocol == UAC_VERSION_1) { 1928 - struct uac_output_terminal_descriptor_v1 *desc = p; 1928 + struct uac1_output_terminal_descriptor *desc = p; 1929 1929 1930 1930 if (desc->bLength < sizeof(*desc)) 1931 1931 continue; /* invalid descriptor? */