Skip to content

Commit d747a91

Browse files
JassiBrarFelipe Balbi
authored and
Felipe Balbi
committed
usb: gadget: audio: Move string IDs to audio.c
Move manufacturer and product string ids into audio.c so as to be reusable by the new uac2 version of gadget driver. Signed-off-by: Yadi Brar <[email protected]> Signed-off-by: Jassi Brar <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent 0d4e1b2 commit d747a91

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

drivers/usb/gadget/audio.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,29 @@
3333
#include "config.c"
3434
#include "epautoconf.c"
3535

36+
/* string IDs are assigned dynamically */
37+
38+
#define STRING_MANUFACTURER_IDX 0
39+
#define STRING_PRODUCT_IDX 1
40+
41+
static char manufacturer[50];
42+
43+
static struct usb_string strings_dev[] = {
44+
[STRING_MANUFACTURER_IDX].s = manufacturer,
45+
[STRING_PRODUCT_IDX].s = DRIVER_DESC,
46+
{ } /* end of list */
47+
};
48+
49+
static struct usb_gadget_strings stringtab_dev = {
50+
.language = 0x0409, /* en-us */
51+
.strings = strings_dev,
52+
};
53+
54+
static struct usb_gadget_strings *audio_strings[] = {
55+
&stringtab_dev,
56+
NULL,
57+
};
58+
3659
#include "u_uac1.c"
3760
#include "f_uac1.c"
3861

drivers/usb/gadget/f_uac1.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -216,29 +216,6 @@ static struct usb_descriptor_header *f_audio_desc[] __initdata = {
216216
NULL,
217217
};
218218

219-
/* string IDs are assigned dynamically */
220-
221-
#define STRING_MANUFACTURER_IDX 0
222-
#define STRING_PRODUCT_IDX 1
223-
224-
static char manufacturer[50];
225-
226-
static struct usb_string strings_dev[] = {
227-
[STRING_MANUFACTURER_IDX].s = manufacturer,
228-
[STRING_PRODUCT_IDX].s = DRIVER_DESC,
229-
{ } /* end of list */
230-
};
231-
232-
static struct usb_gadget_strings stringtab_dev = {
233-
.language = 0x0409, /* en-us */
234-
.strings = strings_dev,
235-
};
236-
237-
static struct usb_gadget_strings *audio_strings[] = {
238-
&stringtab_dev,
239-
NULL,
240-
};
241-
242219
/*
243220
* This function is an ALSA sound card following USB Audio Class Spec 1.0.
244221
*/

0 commit comments

Comments
 (0)