aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2014-07-22 13:58:36 -0400
committerFelipe Balbi <balbi@ti.com>2014-08-20 15:04:46 -0400
commitf73db69f95921512b7cba586066723b500770d1a (patch)
tree2f505339d0466912d19d024bcc99e922aa5e78ac
parent3aeea3c53e73b972ff07a1d03d6cc07f97de4f2f (diff)
usb: gadget: f_uac1: add function strings
uac1 function is missing strings. Add them. Tested-by: Sebastian Reimers <sebastian.reimers@googlemail.com> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/gadget/function/f_uac1.c51
1 files changed, 50 insertions, 1 deletions
diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c
index 2b4c82d84bfc..1c0c4b83cb8f 100644
--- a/drivers/usb/gadget/function/f_uac1.c
+++ b/drivers/usb/gadget/function/f_uac1.c
@@ -216,6 +216,37 @@ static struct usb_descriptor_header *f_audio_desc[] __initdata = {
216 NULL, 216 NULL,
217}; 217};
218 218
219enum {
220 STR_AC_IF,
221 STR_INPUT_TERMINAL,
222 STR_INPUT_TERMINAL_CH_NAMES,
223 STR_FEAT_DESC_0,
224 STR_OUTPUT_TERMINAL,
225 STR_AS_IF_ALT0,
226 STR_AS_IF_ALT1,
227};
228
229static struct usb_string strings_uac1[] = {
230 [STR_AC_IF].s = "AC Interface",
231 [STR_INPUT_TERMINAL].s = "Input terminal",
232 [STR_INPUT_TERMINAL_CH_NAMES].s = "Channels",
233 [STR_FEAT_DESC_0].s = "Volume control & mute",
234 [STR_OUTPUT_TERMINAL].s = "Output terminal",
235 [STR_AS_IF_ALT0].s = "AS Interface",
236 [STR_AS_IF_ALT1].s = "AS Interface",
237 { },
238};
239
240static struct usb_gadget_strings str_uac1 = {
241 .language = 0x0409, /* en-us */
242 .strings = strings_uac1,
243};
244
245static struct usb_gadget_strings *uac1_strings[] = {
246 &str_uac1,
247 NULL,
248};
249
219/* 250/*
220 * This function is an ALSA sound card following USB Audio Class Spec 1.0. 251 * This function is an ALSA sound card following USB Audio Class Spec 1.0.
221 */ 252 */
@@ -724,6 +755,24 @@ static int __init audio_bind_config(struct usb_configuration *c)
724 struct f_audio *audio; 755 struct f_audio *audio;
725 int status; 756 int status;
726 757
758 if (strings_uac1[0].id == 0) {
759 status = usb_string_ids_tab(c->cdev, strings_uac1);
760 if (status < 0)
761 return status;
762 ac_interface_desc.iInterface = strings_uac1[STR_AC_IF].id;
763 input_terminal_desc.iTerminal =
764 strings_uac1[STR_INPUT_TERMINAL].id;
765 input_terminal_desc.iChannelNames =
766 strings_uac1[STR_INPUT_TERMINAL_CH_NAMES].id;
767 feature_unit_desc.iFeature = strings_uac1[STR_FEAT_DESC_0].id;
768 output_terminal_desc.iTerminal =
769 strings_uac1[STR_OUTPUT_TERMINAL].id;
770 as_interface_alt_0_desc.iInterface =
771 strings_uac1[STR_AS_IF_ALT0].id;
772 as_interface_alt_1_desc.iInterface =
773 strings_uac1[STR_AS_IF_ALT1].id;
774 }
775
727 /* allocate and initialize one new instance */ 776 /* allocate and initialize one new instance */
728 audio = kzalloc(sizeof *audio, GFP_KERNEL); 777 audio = kzalloc(sizeof *audio, GFP_KERNEL);
729 if (!audio) 778 if (!audio)
@@ -740,7 +789,7 @@ static int __init audio_bind_config(struct usb_configuration *c)
740 if (status < 0) 789 if (status < 0)
741 goto setup_fail; 790 goto setup_fail;
742 791
743 audio->card.func.strings = audio_strings; 792 audio->card.func.strings = uac1_strings;
744 audio->card.func.bind = f_audio_bind; 793 audio->card.func.bind = f_audio_bind;
745 audio->card.func.unbind = f_audio_unbind; 794 audio->card.func.unbind = f_audio_unbind;
746 audio->card.func.set_alt = f_audio_set_alt; 795 audio->card.func.set_alt = f_audio_set_alt;