diff options
author | Daniel Mack <daniel@caiaq.de> | 2010-06-16 11:57:28 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-06-23 10:09:26 -0400 |
commit | 69da9bcb98ccbfb5d5f751bc13418f1307332925 (patch) | |
tree | 4ba6ac91c576c0dcfabd31e78e8538e21c471cfe | |
parent | f22aa94908352f40fce65b9a9180370fb09ecbe9 (diff) |
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>
-rw-r--r-- | drivers/usb/gadget/f_audio.c | 6 | ||||
-rw-r--r-- | drivers/usb/gadget/gmidi.c | 2 | ||||
-rw-r--r-- | include/linux/usb/audio-v2.h | 2 | ||||
-rw-r--r-- | include/linux/usb/audio.h | 12 | ||||
-rw-r--r-- | sound/usb/card.c | 2 | ||||
-rw-r--r-- | sound/usb/endpoint.c | 4 | ||||
-rw-r--r-- | sound/usb/mixer.c | 14 |
7 files changed, 21 insertions, 21 deletions
diff --git a/drivers/usb/gadget/f_audio.c b/drivers/usb/gadget/f_audio.c index b91115f84b13..1f48ceb55a77 100644 --- a/drivers/usb/gadget/f_audio.c +++ b/drivers/usb/gadget/f_audio.c | |||
@@ -61,7 +61,7 @@ DECLARE_UAC_AC_HEADER_DESCRIPTOR(2); | |||
61 | #define UAC_DT_TOTAL_LENGTH (UAC_DT_AC_HEADER_LENGTH + UAC_DT_INPUT_TERMINAL_SIZE \ | 61 | #define UAC_DT_TOTAL_LENGTH (UAC_DT_AC_HEADER_LENGTH + UAC_DT_INPUT_TERMINAL_SIZE \ |
62 | + UAC_DT_OUTPUT_TERMINAL_SIZE + UAC_DT_FEATURE_UNIT_SIZE(0)) | 62 | + UAC_DT_OUTPUT_TERMINAL_SIZE + UAC_DT_FEATURE_UNIT_SIZE(0)) |
63 | /* B.3.2 Class-Specific AC Interface Descriptor */ | 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 | .bLength = UAC_DT_AC_HEADER_LENGTH, | 65 | .bLength = UAC_DT_AC_HEADER_LENGTH, |
66 | .bDescriptorType = USB_DT_CS_INTERFACE, | 66 | .bDescriptorType = USB_DT_CS_INTERFACE, |
67 | .bDescriptorSubtype = UAC_HEADER, | 67 | .bDescriptorSubtype = UAC_HEADER, |
@@ -125,7 +125,7 @@ static struct usb_audio_control_selector feature_unit = { | |||
125 | }; | 125 | }; |
126 | 126 | ||
127 | #define OUTPUT_TERMINAL_ID 3 | 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 | .bLength = UAC_DT_OUTPUT_TERMINAL_SIZE, | 129 | .bLength = UAC_DT_OUTPUT_TERMINAL_SIZE, |
130 | .bDescriptorType = USB_DT_CS_INTERFACE, | 130 | .bDescriptorType = USB_DT_CS_INTERFACE, |
131 | .bDescriptorSubtype = UAC_OUTPUT_TERMINAL, | 131 | .bDescriptorSubtype = UAC_OUTPUT_TERMINAL, |
@@ -155,7 +155,7 @@ static struct usb_interface_descriptor as_interface_alt_1_desc = { | |||
155 | }; | 155 | }; |
156 | 156 | ||
157 | /* B.4.2 Class-Specific AS Interface Descriptor */ | 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 | .bLength = UAC_DT_AS_HEADER_SIZE, | 159 | .bLength = UAC_DT_AS_HEADER_SIZE, |
160 | .bDescriptorType = USB_DT_CS_INTERFACE, | 160 | .bDescriptorType = USB_DT_CS_INTERFACE, |
161 | .bDescriptorSubtype = UAC_AS_GENERAL, | 161 | .bDescriptorSubtype = UAC_AS_GENERAL, |
diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c index 2b56ce621852..b7bf88019b06 100644 --- a/drivers/usb/gadget/gmidi.c +++ b/drivers/usb/gadget/gmidi.c | |||
@@ -238,7 +238,7 @@ static const struct usb_interface_descriptor ac_interface_desc = { | |||
238 | }; | 238 | }; |
239 | 239 | ||
240 | /* B.3.2 Class-Specific AC Interface Descriptor */ | 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 | .bLength = UAC_DT_AC_HEADER_SIZE(1), | 242 | .bLength = UAC_DT_AC_HEADER_SIZE(1), |
243 | .bDescriptorType = USB_DT_CS_INTERFACE, | 243 | .bDescriptorType = USB_DT_CS_INTERFACE, |
244 | .bDescriptorSubtype = USB_MS_HEADER, | 244 | .bDescriptorSubtype = USB_MS_HEADER, |
diff --git a/include/linux/usb/audio-v2.h b/include/linux/usb/audio-v2.h index 383b94ba8c20..716aebe339e8 100644 --- a/include/linux/usb/audio-v2.h +++ b/include/linux/usb/audio-v2.h | |||
@@ -121,7 +121,7 @@ struct uac2_feature_unit_descriptor { | |||
121 | 121 | ||
122 | /* 4.9.2 Class-Specific AS Interface Descriptor */ | 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 | __u8 bLength; | 125 | __u8 bLength; |
126 | __u8 bDescriptorType; | 126 | __u8 bDescriptorType; |
127 | __u8 bDescriptorSubtype; | 127 | __u8 bDescriptorSubtype; |
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h index c51200c715e5..a54b8255d75f 100644 --- a/include/linux/usb/audio.h +++ b/include/linux/usb/audio.h | |||
@@ -39,8 +39,8 @@ | |||
39 | #define UAC_MIXER_UNIT 0x04 | 39 | #define UAC_MIXER_UNIT 0x04 |
40 | #define UAC_SELECTOR_UNIT 0x05 | 40 | #define UAC_SELECTOR_UNIT 0x05 |
41 | #define UAC_FEATURE_UNIT 0x06 | 41 | #define UAC_FEATURE_UNIT 0x06 |
42 | #define UAC_PROCESSING_UNIT_V1 0x07 | 42 | #define UAC1_PROCESSING_UNIT 0x07 |
43 | #define UAC_EXTENSION_UNIT_V1 0x08 | 43 | #define UAC1_EXTENSION_UNIT 0x08 |
44 | 44 | ||
45 | /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ | 45 | /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ |
46 | #define UAC_AS_GENERAL 0x01 | 46 | #define UAC_AS_GENERAL 0x01 |
@@ -151,7 +151,7 @@ | |||
151 | 151 | ||
152 | /* Terminal Control Selectors */ | 152 | /* Terminal Control Selectors */ |
153 | /* 4.3.2 Class-Specific AC Interface Descriptor */ | 153 | /* 4.3.2 Class-Specific AC Interface Descriptor */ |
154 | struct uac_ac_header_descriptor_v1 { | 154 | struct uac1_ac_header_descriptor { |
155 | __u8 bLength; /* 8 + n */ | 155 | __u8 bLength; /* 8 + n */ |
156 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 156 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
157 | __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ | 157 | __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ |
@@ -165,7 +165,7 @@ struct uac_ac_header_descriptor_v1 { | |||
165 | 165 | ||
166 | /* As above, but more useful for defining your own descriptors: */ | 166 | /* As above, but more useful for defining your own descriptors: */ |
167 | #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ | 167 | #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ |
168 | struct uac_ac_header_descriptor_v1_##n { \ | 168 | struct uac1_ac_header_descriptor_##n { \ |
169 | __u8 bLength; \ | 169 | __u8 bLength; \ |
170 | __u8 bDescriptorType; \ | 170 | __u8 bDescriptorType; \ |
171 | __u8 bDescriptorSubtype; \ | 171 | __u8 bDescriptorSubtype; \ |
@@ -205,7 +205,7 @@ struct uac_input_terminal_descriptor { | |||
205 | #define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01 | 205 | #define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01 |
206 | 206 | ||
207 | /* 4.3.2.2 Output Terminal Descriptor */ | 207 | /* 4.3.2.2 Output Terminal Descriptor */ |
208 | struct uac_output_terminal_descriptor_v1 { | 208 | struct uac1_output_terminal_descriptor { |
209 | __u8 bLength; /* in bytes: 9 */ | 209 | __u8 bLength; /* in bytes: 9 */ |
210 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | 210 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ |
211 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ | 211 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ |
@@ -395,7 +395,7 @@ static inline __u8 *uac_processing_unit_specific(struct uac_processing_unit_desc | |||
395 | } | 395 | } |
396 | 396 | ||
397 | /* 4.5.2 Class-Specific AS Interface Descriptor */ | 397 | /* 4.5.2 Class-Specific AS Interface Descriptor */ |
398 | struct uac_as_header_descriptor_v1 { | 398 | struct uac1_as_header_descriptor { |
399 | __u8 bLength; /* in bytes: 7 */ | 399 | __u8 bLength; /* in bytes: 7 */ |
400 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 400 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
401 | __u8 bDescriptorSubtype; /* AS_GENERAL */ | 401 | __u8 bDescriptorSubtype; /* AS_GENERAL */ |
diff --git a/sound/usb/card.c b/sound/usb/card.c index 7a8ac1d81be7..9feb00c831a0 100644 --- a/sound/usb/card.c +++ b/sound/usb/card.c | |||
@@ -217,7 +217,7 @@ static int snd_usb_create_streams(struct snd_usb_audio *chip, int ctrlif) | |||
217 | 217 | ||
218 | switch (protocol) { | 218 | switch (protocol) { |
219 | case UAC_VERSION_1: { | 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 | if (!h1->bInCollection) { | 222 | if (!h1->bInCollection) { |
223 | snd_printk(KERN_INFO "skipping empty audio interface (v1)\n"); | 223 | snd_printk(KERN_INFO "skipping empty audio interface (v1)\n"); |
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 6f6596cf2b19..2af0f9e3dcdf 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c | |||
@@ -275,7 +275,7 @@ int snd_usb_parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no) | |||
275 | /* get audio formats */ | 275 | /* get audio formats */ |
276 | switch (protocol) { | 276 | switch (protocol) { |
277 | case UAC_VERSION_1: { | 277 | case UAC_VERSION_1: { |
278 | struct uac_as_header_descriptor_v1 *as = | 278 | struct uac1_as_header_descriptor *as = |
279 | snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL); | 279 | snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL); |
280 | 280 | ||
281 | if (!as) { | 281 | if (!as) { |
@@ -297,7 +297,7 @@ int snd_usb_parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no) | |||
297 | case UAC_VERSION_2: { | 297 | case UAC_VERSION_2: { |
298 | struct uac2_input_terminal_descriptor *input_term; | 298 | struct uac2_input_terminal_descriptor *input_term; |
299 | struct uac2_output_terminal_descriptor *output_term; | 299 | struct uac2_output_terminal_descriptor *output_term; |
300 | struct uac_as_header_descriptor_v2 *as = | 300 | struct uac2_as_header_descriptor *as = |
301 | snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL); | 301 | snd_usb_find_csint_desc(alts->extra, alts->extralen, NULL, UAC_AS_GENERAL); |
302 | 302 | ||
303 | if (!as) { | 303 | if (!as) { |
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 736d134cc03c..ba54eb6bb0c9 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c | |||
@@ -582,9 +582,9 @@ static int get_term_name(struct mixer_build *state, struct usb_audio_term *iterm | |||
582 | switch (iterm->type >> 16) { | 582 | switch (iterm->type >> 16) { |
583 | case UAC_SELECTOR_UNIT: | 583 | case UAC_SELECTOR_UNIT: |
584 | strcpy(name, "Selector"); return 8; | 584 | strcpy(name, "Selector"); return 8; |
585 | case UAC_PROCESSING_UNIT_V1: | 585 | case UAC1_PROCESSING_UNIT: |
586 | strcpy(name, "Process Unit"); return 12; | 586 | strcpy(name, "Process Unit"); return 12; |
587 | case UAC_EXTENSION_UNIT_V1: | 587 | case UAC1_EXTENSION_UNIT: |
588 | strcpy(name, "Ext Unit"); return 8; | 588 | strcpy(name, "Ext Unit"); return 8; |
589 | case UAC_MIXER_UNIT: | 589 | case UAC_MIXER_UNIT: |
590 | strcpy(name, "Mixer"); return 5; | 590 | strcpy(name, "Mixer"); return 5; |
@@ -672,8 +672,8 @@ static int check_input_term(struct mixer_build *state, int id, struct usb_audio_ | |||
672 | term->name = uac_selector_unit_iSelector(d); | 672 | term->name = uac_selector_unit_iSelector(d); |
673 | return 0; | 673 | return 0; |
674 | } | 674 | } |
675 | case UAC_PROCESSING_UNIT_V1: | 675 | case UAC1_PROCESSING_UNIT: |
676 | case UAC_EXTENSION_UNIT_V1: { | 676 | case UAC1_EXTENSION_UNIT: { |
677 | struct uac_processing_unit_descriptor *d = p1; | 677 | struct uac_processing_unit_descriptor *d = p1; |
678 | if (d->bNrInPins) { | 678 | if (d->bNrInPins) { |
679 | id = d->baSourceID[0]; | 679 | id = d->baSourceID[0]; |
@@ -1855,13 +1855,13 @@ static int parse_audio_unit(struct mixer_build *state, int unitid) | |||
1855 | return parse_audio_selector_unit(state, unitid, p1); | 1855 | return parse_audio_selector_unit(state, unitid, p1); |
1856 | case UAC_FEATURE_UNIT: | 1856 | case UAC_FEATURE_UNIT: |
1857 | return parse_audio_feature_unit(state, unitid, p1); | 1857 | return parse_audio_feature_unit(state, unitid, p1); |
1858 | case UAC_PROCESSING_UNIT_V1: | 1858 | case UAC1_PROCESSING_UNIT: |
1859 | /* UAC2_EFFECT_UNIT has the same value */ | 1859 | /* UAC2_EFFECT_UNIT has the same value */ |
1860 | if (state->mixer->protocol == UAC_VERSION_1) | 1860 | if (state->mixer->protocol == UAC_VERSION_1) |
1861 | return parse_audio_processing_unit(state, unitid, p1); | 1861 | return parse_audio_processing_unit(state, unitid, p1); |
1862 | else | 1862 | else |
1863 | return 0; /* FIXME - effect units not implemented yet */ | 1863 | return 0; /* FIXME - effect units not implemented yet */ |
1864 | case UAC_EXTENSION_UNIT_V1: | 1864 | case UAC1_EXTENSION_UNIT: |
1865 | /* UAC2_PROCESSING_UNIT_V2 has the same value */ | 1865 | /* UAC2_PROCESSING_UNIT_V2 has the same value */ |
1866 | if (state->mixer->protocol == UAC_VERSION_1) | 1866 | if (state->mixer->protocol == UAC_VERSION_1) |
1867 | return parse_audio_extension_unit(state, unitid, p1); | 1867 | return parse_audio_extension_unit(state, unitid, p1); |
@@ -1925,7 +1925,7 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer) | |||
1925 | p = NULL; | 1925 | p = NULL; |
1926 | while ((p = snd_usb_find_csint_desc(hostif->extra, hostif->extralen, p, UAC_OUTPUT_TERMINAL)) != NULL) { | 1926 | while ((p = snd_usb_find_csint_desc(hostif->extra, hostif->extralen, p, UAC_OUTPUT_TERMINAL)) != NULL) { |
1927 | if (mixer->protocol == UAC_VERSION_1) { | 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 | if (desc->bLength < sizeof(*desc)) | 1930 | if (desc->bLength < sizeof(*desc)) |
1931 | continue; /* invalid descriptor? */ | 1931 | continue; /* invalid descriptor? */ |