diff options
author | Laurent Pinchart <laurent.pinchart@skynet.be> | 2009-06-21 17:23:05 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-23 09:46:20 -0400 |
commit | 512ad27d8667158747de2e8da8a23e8f50e91856 (patch) | |
tree | 3c56c7265a1e2d7530ddb9c31806d3c1086ac6f5 /drivers/usb/gadget | |
parent | 315ad3028c8aae14891797040f855fc3291a076b (diff) |
USB audio gadget: Prefix all macro definitions with UAC_ in linux/usb/audio.h
linux/usb/audio.h is a public header file that includes definitions
exported to userspace. To avoid namespace clashes, prefix all macro
definitions with UAC_. Existing macros and structures prefixed with
USB_AC_ and USB_AS_ are renamed for consistency.
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/audio.c | 24 | ||||
-rw-r--r-- | drivers/usb/gadget/f_audio.c | 80 | ||||
-rw-r--r-- | drivers/usb/gadget/gmidi.c | 8 |
3 files changed, 56 insertions, 56 deletions
diff --git a/drivers/usb/gadget/audio.c b/drivers/usb/gadget/audio.c index 9f80f4e970bd..a3a0f4a27ef0 100644 --- a/drivers/usb/gadget/audio.c +++ b/drivers/usb/gadget/audio.c | |||
@@ -106,20 +106,20 @@ static int audio_set_endpoint_req(struct usb_configuration *c, | |||
106 | ctrl->bRequest, w_value, len, ep); | 106 | ctrl->bRequest, w_value, len, ep); |
107 | 107 | ||
108 | switch (ctrl->bRequest) { | 108 | switch (ctrl->bRequest) { |
109 | case SET_CUR: | 109 | case UAC_SET_CUR: |
110 | value = 0; | 110 | value = 0; |
111 | break; | 111 | break; |
112 | 112 | ||
113 | case SET_MIN: | 113 | case UAC_SET_MIN: |
114 | break; | 114 | break; |
115 | 115 | ||
116 | case SET_MAX: | 116 | case UAC_SET_MAX: |
117 | break; | 117 | break; |
118 | 118 | ||
119 | case SET_RES: | 119 | case UAC_SET_RES: |
120 | break; | 120 | break; |
121 | 121 | ||
122 | case SET_MEM: | 122 | case UAC_SET_MEM: |
123 | break; | 123 | break; |
124 | 124 | ||
125 | default: | 125 | default: |
@@ -142,13 +142,13 @@ static int audio_get_endpoint_req(struct usb_configuration *c, | |||
142 | ctrl->bRequest, w_value, len, ep); | 142 | ctrl->bRequest, w_value, len, ep); |
143 | 143 | ||
144 | switch (ctrl->bRequest) { | 144 | switch (ctrl->bRequest) { |
145 | case GET_CUR: | 145 | case UAC_GET_CUR: |
146 | case GET_MIN: | 146 | case UAC_GET_MIN: |
147 | case GET_MAX: | 147 | case UAC_GET_MAX: |
148 | case GET_RES: | 148 | case UAC_GET_RES: |
149 | value = 3; | 149 | value = 3; |
150 | break; | 150 | break; |
151 | case GET_MEM: | 151 | case UAC_GET_MEM: |
152 | break; | 152 | break; |
153 | default: | 153 | default: |
154 | break; | 154 | break; |
@@ -171,11 +171,11 @@ audio_setup(struct usb_configuration *c, const struct usb_ctrlrequest *ctrl) | |||
171 | * Audio class messages; interface activation uses set_alt(). | 171 | * Audio class messages; interface activation uses set_alt(). |
172 | */ | 172 | */ |
173 | switch (ctrl->bRequestType) { | 173 | switch (ctrl->bRequestType) { |
174 | case USB_AUDIO_SET_ENDPOINT: | 174 | case USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_ENDPOINT: |
175 | value = audio_set_endpoint_req(c, ctrl); | 175 | value = audio_set_endpoint_req(c, ctrl); |
176 | break; | 176 | break; |
177 | 177 | ||
178 | case USB_AUDIO_GET_ENDPOINT: | 178 | case USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_ENDPOINT: |
179 | value = audio_get_endpoint_req(c, ctrl); | 179 | value = audio_get_endpoint_req(c, ctrl); |
180 | break; | 180 | break; |
181 | 181 | ||
diff --git a/drivers/usb/gadget/f_audio.c b/drivers/usb/gadget/f_audio.c index 76afbd1b515f..7b05b3c8c0b1 100644 --- a/drivers/usb/gadget/f_audio.c +++ b/drivers/usb/gadget/f_audio.c | |||
@@ -50,16 +50,16 @@ static struct usb_interface_descriptor ac_interface_desc __initdata = { | |||
50 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, | 50 | .bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL, |
51 | }; | 51 | }; |
52 | 52 | ||
53 | DECLARE_USB_AC_HEADER_DESCRIPTOR(2); | 53 | DECLARE_UAC_AC_HEADER_DESCRIPTOR(2); |
54 | 54 | ||
55 | #define USB_DT_AC_HEADER_LENGH USB_DT_AC_HEADER_SIZE(F_AUDIO_NUM_INTERFACES) | 55 | #define UAC_DT_AC_HEADER_LENGTH UAC_DT_AC_HEADER_SIZE(F_AUDIO_NUM_INTERFACES) |
56 | /* B.3.2 Class-Specific AC Interface Descriptor */ | 56 | /* B.3.2 Class-Specific AC Interface Descriptor */ |
57 | static struct usb_ac_header_descriptor_2 ac_header_desc = { | 57 | static struct uac_ac_header_descriptor_2 ac_header_desc = { |
58 | .bLength = USB_DT_AC_HEADER_LENGH, | 58 | .bLength = UAC_DT_AC_HEADER_LENGTH, |
59 | .bDescriptorType = USB_DT_CS_INTERFACE, | 59 | .bDescriptorType = USB_DT_CS_INTERFACE, |
60 | .bDescriptorSubtype = HEADER, | 60 | .bDescriptorSubtype = UAC_HEADER, |
61 | .bcdADC = __constant_cpu_to_le16(0x0100), | 61 | .bcdADC = __constant_cpu_to_le16(0x0100), |
62 | .wTotalLength = __constant_cpu_to_le16(USB_DT_AC_HEADER_LENGH), | 62 | .wTotalLength = __constant_cpu_to_le16(UAC_DT_AC_HEADER_LENGTH), |
63 | .bInCollection = F_AUDIO_NUM_INTERFACES, | 63 | .bInCollection = F_AUDIO_NUM_INTERFACES, |
64 | .baInterfaceNr = { | 64 | .baInterfaceNr = { |
65 | [0] = F_AUDIO_AC_INTERFACE, | 65 | [0] = F_AUDIO_AC_INTERFACE, |
@@ -68,33 +68,33 @@ static struct usb_ac_header_descriptor_2 ac_header_desc = { | |||
68 | }; | 68 | }; |
69 | 69 | ||
70 | #define INPUT_TERMINAL_ID 1 | 70 | #define INPUT_TERMINAL_ID 1 |
71 | static struct usb_input_terminal_descriptor input_terminal_desc = { | 71 | static struct uac_input_terminal_descriptor input_terminal_desc = { |
72 | .bLength = USB_DT_AC_INPUT_TERMINAL_SIZE, | 72 | .bLength = UAC_DT_INPUT_TERMINAL_SIZE, |
73 | .bDescriptorType = USB_DT_CS_INTERFACE, | 73 | .bDescriptorType = USB_DT_CS_INTERFACE, |
74 | .bDescriptorSubtype = INPUT_TERMINAL, | 74 | .bDescriptorSubtype = UAC_INPUT_TERMINAL, |
75 | .bTerminalID = INPUT_TERMINAL_ID, | 75 | .bTerminalID = INPUT_TERMINAL_ID, |
76 | .wTerminalType = USB_AC_TERMINAL_STREAMING, | 76 | .wTerminalType = UAC_TERMINAL_STREAMING, |
77 | .bAssocTerminal = 0, | 77 | .bAssocTerminal = 0, |
78 | .wChannelConfig = 0x3, | 78 | .wChannelConfig = 0x3, |
79 | }; | 79 | }; |
80 | 80 | ||
81 | DECLARE_USB_AC_FEATURE_UNIT_DESCRIPTOR(0); | 81 | DECLARE_UAC_FEATURE_UNIT_DESCRIPTOR(0); |
82 | 82 | ||
83 | #define FEATURE_UNIT_ID 2 | 83 | #define FEATURE_UNIT_ID 2 |
84 | static struct usb_ac_feature_unit_descriptor_0 feature_unit_desc = { | 84 | static struct uac_feature_unit_descriptor_0 feature_unit_desc = { |
85 | .bLength = USB_DT_AC_FEATURE_UNIT_SIZE(0), | 85 | .bLength = UAC_DT_FEATURE_UNIT_SIZE(0), |
86 | .bDescriptorType = USB_DT_CS_INTERFACE, | 86 | .bDescriptorType = USB_DT_CS_INTERFACE, |
87 | .bDescriptorSubtype = FEATURE_UNIT, | 87 | .bDescriptorSubtype = UAC_FEATURE_UNIT, |
88 | .bUnitID = FEATURE_UNIT_ID, | 88 | .bUnitID = FEATURE_UNIT_ID, |
89 | .bSourceID = INPUT_TERMINAL_ID, | 89 | .bSourceID = INPUT_TERMINAL_ID, |
90 | .bControlSize = 2, | 90 | .bControlSize = 2, |
91 | .bmaControls[0] = (FU_MUTE | FU_VOLUME), | 91 | .bmaControls[0] = (UAC_FU_MUTE | UAC_FU_VOLUME), |
92 | }; | 92 | }; |
93 | 93 | ||
94 | static struct usb_audio_control mute_control = { | 94 | static struct usb_audio_control mute_control = { |
95 | .list = LIST_HEAD_INIT(mute_control.list), | 95 | .list = LIST_HEAD_INIT(mute_control.list), |
96 | .name = "Mute Control", | 96 | .name = "Mute Control", |
97 | .type = MUTE_CONTROL, | 97 | .type = UAC_MUTE_CONTROL, |
98 | /* Todo: add real Mute control code */ | 98 | /* Todo: add real Mute control code */ |
99 | .set = generic_set_cmd, | 99 | .set = generic_set_cmd, |
100 | .get = generic_get_cmd, | 100 | .get = generic_get_cmd, |
@@ -103,7 +103,7 @@ static struct usb_audio_control mute_control = { | |||
103 | static struct usb_audio_control volume_control = { | 103 | static struct usb_audio_control volume_control = { |
104 | .list = LIST_HEAD_INIT(volume_control.list), | 104 | .list = LIST_HEAD_INIT(volume_control.list), |
105 | .name = "Volume Control", | 105 | .name = "Volume Control", |
106 | .type = VOLUME_CONTROL, | 106 | .type = UAC_VOLUME_CONTROL, |
107 | /* Todo: add real Volume control code */ | 107 | /* Todo: add real Volume control code */ |
108 | .set = generic_set_cmd, | 108 | .set = generic_set_cmd, |
109 | .get = generic_get_cmd, | 109 | .get = generic_get_cmd, |
@@ -113,17 +113,17 @@ static struct usb_audio_control_selector feature_unit = { | |||
113 | .list = LIST_HEAD_INIT(feature_unit.list), | 113 | .list = LIST_HEAD_INIT(feature_unit.list), |
114 | .id = FEATURE_UNIT_ID, | 114 | .id = FEATURE_UNIT_ID, |
115 | .name = "Mute & Volume Control", | 115 | .name = "Mute & Volume Control", |
116 | .type = FEATURE_UNIT, | 116 | .type = UAC_FEATURE_UNIT, |
117 | .desc = (struct usb_descriptor_header *)&feature_unit_desc, | 117 | .desc = (struct usb_descriptor_header *)&feature_unit_desc, |
118 | }; | 118 | }; |
119 | 119 | ||
120 | #define OUTPUT_TERMINAL_ID 3 | 120 | #define OUTPUT_TERMINAL_ID 3 |
121 | static struct usb_output_terminal_descriptor output_terminal_desc = { | 121 | static struct uac_output_terminal_descriptor output_terminal_desc = { |
122 | .bLength = USB_DT_AC_OUTPUT_TERMINAL_SIZE, | 122 | .bLength = UAC_DT_OUTPUT_TERMINAL_SIZE, |
123 | .bDescriptorType = USB_DT_CS_INTERFACE, | 123 | .bDescriptorType = USB_DT_CS_INTERFACE, |
124 | .bDescriptorSubtype = OUTPUT_TERMINAL, | 124 | .bDescriptorSubtype = UAC_OUTPUT_TERMINAL, |
125 | .bTerminalID = OUTPUT_TERMINAL_ID, | 125 | .bTerminalID = OUTPUT_TERMINAL_ID, |
126 | .wTerminalType = USB_AC_OUTPUT_TERMINAL_SPEAKER, | 126 | .wTerminalType = UAC_OUTPUT_TERMINAL_SPEAKER, |
127 | .bAssocTerminal = FEATURE_UNIT_ID, | 127 | .bAssocTerminal = FEATURE_UNIT_ID, |
128 | .bSourceID = FEATURE_UNIT_ID, | 128 | .bSourceID = FEATURE_UNIT_ID, |
129 | }; | 129 | }; |
@@ -148,22 +148,22 @@ static struct usb_interface_descriptor as_interface_alt_1_desc = { | |||
148 | }; | 148 | }; |
149 | 149 | ||
150 | /* B.4.2 Class-Specific AS Interface Descriptor */ | 150 | /* B.4.2 Class-Specific AS Interface Descriptor */ |
151 | static struct usb_as_header_descriptor as_header_desc = { | 151 | static struct uac_as_header_descriptor as_header_desc = { |
152 | .bLength = USB_DT_AS_HEADER_SIZE, | 152 | .bLength = UAC_DT_AS_HEADER_SIZE, |
153 | .bDescriptorType = USB_DT_CS_INTERFACE, | 153 | .bDescriptorType = USB_DT_CS_INTERFACE, |
154 | .bDescriptorSubtype = AS_GENERAL, | 154 | .bDescriptorSubtype = UAC_AS_GENERAL, |
155 | .bTerminalLink = INPUT_TERMINAL_ID, | 155 | .bTerminalLink = INPUT_TERMINAL_ID, |
156 | .bDelay = 1, | 156 | .bDelay = 1, |
157 | .wFormatTag = USB_AS_AUDIO_FORMAT_TYPE_I_PCM, | 157 | .wFormatTag = UAC_FORMAT_TYPE_I_PCM, |
158 | }; | 158 | }; |
159 | 159 | ||
160 | DECLARE_USB_AS_FORMAT_TYPE_I_DISCRETE_DESC(1); | 160 | DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(1); |
161 | 161 | ||
162 | static struct usb_as_formate_type_i_discrete_descriptor_1 as_type_i_desc = { | 162 | static struct uac_format_type_i_discrete_descriptor_1 as_type_i_desc = { |
163 | .bLength = USB_AS_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(1), | 163 | .bLength = UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(1), |
164 | .bDescriptorType = USB_DT_CS_INTERFACE, | 164 | .bDescriptorType = USB_DT_CS_INTERFACE, |
165 | .bDescriptorSubtype = FORMAT_TYPE, | 165 | .bDescriptorSubtype = UAC_FORMAT_TYPE, |
166 | .bFormatType = USB_AS_FORMAT_TYPE_I, | 166 | .bFormatType = UAC_FORMAT_TYPE_I, |
167 | .bSubframeSize = 2, | 167 | .bSubframeSize = 2, |
168 | .bBitResolution = 16, | 168 | .bBitResolution = 16, |
169 | .bSamFreqType = 1, | 169 | .bSamFreqType = 1, |
@@ -181,10 +181,10 @@ static struct usb_endpoint_descriptor as_out_ep_desc __initdata = { | |||
181 | }; | 181 | }; |
182 | 182 | ||
183 | /* Class-specific AS ISO OUT Endpoint Descriptor */ | 183 | /* Class-specific AS ISO OUT Endpoint Descriptor */ |
184 | static struct usb_as_iso_endpoint_descriptor as_iso_out_desc __initdata = { | 184 | static struct uac_iso_endpoint_descriptor as_iso_out_desc __initdata = { |
185 | .bLength = USB_AS_ISO_ENDPOINT_DESC_SIZE, | 185 | .bLength = UAC_ISO_ENDPOINT_DESC_SIZE, |
186 | .bDescriptorType = USB_DT_CS_ENDPOINT, | 186 | .bDescriptorType = USB_DT_CS_ENDPOINT, |
187 | .bDescriptorSubtype = EP_GENERAL, | 187 | .bDescriptorSubtype = UAC_EP_GENERAL, |
188 | .bmAttributes = 1, | 188 | .bmAttributes = 1, |
189 | .bLockDelayUnits = 1, | 189 | .bLockDelayUnits = 1, |
190 | .wLockDelay = __constant_cpu_to_le16(1), | 190 | .wLockDelay = __constant_cpu_to_le16(1), |
@@ -456,11 +456,11 @@ f_audio_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl) | |||
456 | * Audio class messages; interface activation uses set_alt(). | 456 | * Audio class messages; interface activation uses set_alt(). |
457 | */ | 457 | */ |
458 | switch (ctrl->bRequestType) { | 458 | switch (ctrl->bRequestType) { |
459 | case USB_AUDIO_SET_INTF: | 459 | case USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE: |
460 | value = audio_set_intf_req(f, ctrl); | 460 | value = audio_set_intf_req(f, ctrl); |
461 | break; | 461 | break; |
462 | 462 | ||
463 | case USB_AUDIO_GET_INTF: | 463 | case USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE: |
464 | value = audio_get_intf_req(f, ctrl); | 464 | value = audio_get_intf_req(f, ctrl); |
465 | break; | 465 | break; |
466 | 466 | ||
@@ -642,10 +642,10 @@ int __init control_selector_init(struct f_audio *audio) | |||
642 | list_add(&mute_control.list, &feature_unit.control); | 642 | list_add(&mute_control.list, &feature_unit.control); |
643 | list_add(&volume_control.list, &feature_unit.control); | 643 | list_add(&volume_control.list, &feature_unit.control); |
644 | 644 | ||
645 | volume_control.data[_CUR] = 0xffc0; | 645 | volume_control.data[UAC__CUR] = 0xffc0; |
646 | volume_control.data[_MIN] = 0xe3a0; | 646 | volume_control.data[UAC__MIN] = 0xe3a0; |
647 | volume_control.data[_MAX] = 0xfff0; | 647 | volume_control.data[UAC__MAX] = 0xfff0; |
648 | volume_control.data[_RES] = 0x0030; | 648 | volume_control.data[UAC__RES] = 0x0030; |
649 | 649 | ||
650 | return 0; | 650 | return 0; |
651 | } | 651 | } |
diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c index b9312dc6e041..d0b1e836f0e0 100644 --- a/drivers/usb/gadget/gmidi.c +++ b/drivers/usb/gadget/gmidi.c | |||
@@ -191,7 +191,7 @@ module_param(qlen, uint, S_IRUGO); | |||
191 | #define GMIDI_MS_INTERFACE 1 | 191 | #define GMIDI_MS_INTERFACE 1 |
192 | #define GMIDI_NUM_INTERFACES 2 | 192 | #define GMIDI_NUM_INTERFACES 2 |
193 | 193 | ||
194 | DECLARE_USB_AC_HEADER_DESCRIPTOR(1); | 194 | DECLARE_UAC_AC_HEADER_DESCRIPTOR(1); |
195 | DECLARE_USB_MIDI_OUT_JACK_DESCRIPTOR(1); | 195 | DECLARE_USB_MIDI_OUT_JACK_DESCRIPTOR(1); |
196 | DECLARE_USB_MS_ENDPOINT_DESCRIPTOR(1); | 196 | DECLARE_USB_MS_ENDPOINT_DESCRIPTOR(1); |
197 | 197 | ||
@@ -237,12 +237,12 @@ static const struct usb_interface_descriptor ac_interface_desc = { | |||
237 | }; | 237 | }; |
238 | 238 | ||
239 | /* B.3.2 Class-Specific AC Interface Descriptor */ | 239 | /* B.3.2 Class-Specific AC Interface Descriptor */ |
240 | static const struct usb_ac_header_descriptor_1 ac_header_desc = { | 240 | static const struct uac_ac_header_descriptor_1 ac_header_desc = { |
241 | .bLength = USB_DT_AC_HEADER_SIZE(1), | 241 | .bLength = UAC_DT_AC_HEADER_SIZE(1), |
242 | .bDescriptorType = USB_DT_CS_INTERFACE, | 242 | .bDescriptorType = USB_DT_CS_INTERFACE, |
243 | .bDescriptorSubtype = USB_MS_HEADER, | 243 | .bDescriptorSubtype = USB_MS_HEADER, |
244 | .bcdADC = cpu_to_le16(0x0100), | 244 | .bcdADC = cpu_to_le16(0x0100), |
245 | .wTotalLength = cpu_to_le16(USB_DT_AC_HEADER_SIZE(1)), | 245 | .wTotalLength = cpu_to_le16(UAC_DT_AC_HEADER_SIZE(1)), |
246 | .bInCollection = 1, | 246 | .bInCollection = 1, |
247 | .baInterfaceNr = { | 247 | .baInterfaceNr = { |
248 | [0] = GMIDI_MS_INTERFACE, | 248 | [0] = GMIDI_MS_INTERFACE, |