summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorJohn Keeping2018-01-12 19:43:32 +0100
committerFelipe Balbi2018-02-12 09:48:59 +0100
commit8813a59ed892305b5ac1b5b901740b1ad4b5fefa (patch)
treea2ba668808f1c496c282be1734d6158a4554604e /drivers/usb/gadget
parentusb: dwc3: ep0: Reset TRB counter for ep0 IN (diff)
downloadkernel-qcow2-linux-8813a59ed892305b5ac1b5b901740b1ad4b5fefa.tar.gz
kernel-qcow2-linux-8813a59ed892305b5ac1b5b901740b1ad4b5fefa.tar.xz
kernel-qcow2-linux-8813a59ed892305b5ac1b5b901740b1ad4b5fefa.zip
usb: gadget: f_uac2: fix bFirstInterface in composite gadget
If there are multiple functions associated with a configuration, then the UAC2 interfaces may not start at zero. Set the correct first interface number in the association descriptor so that the audio interfaces are enumerated correctly in this case. Reviewed-by: Krzysztof Opasiak <k.opasiak@samsung.com> Signed-off-by: John Keeping <john@metanate.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/function/f_uac2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c
index 11fe788b4308..d2dc1f00180b 100644
--- a/drivers/usb/gadget/function/f_uac2.c
+++ b/drivers/usb/gadget/function/f_uac2.c
@@ -524,6 +524,8 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
return ret;
}
+ iad_desc.bFirstInterface = ret;
+
std_ac_if_desc.bInterfaceNumber = ret;
uac2->ac_intf = ret;
uac2->ac_alt = 0;