From e360c65d23df42b577b859acf3bb3a887034d435 Mon Sep 17 00:00:00 2001 From: Frank Wang Date: Thu, 1 Jul 2021 14:38:04 +0800 Subject: [PATCH] usb: gadget: f_uac2: make compatible for windows os Amend to fix the UAC2 gadget could not be identified on Windows 10 OS. Change-Id: I992af23ab4ac2740a33621d9c3c47368f5135710 Fixes: 486bd80e78f4 ("UPSTREAM: usb: f_uac2: adds support for SS and SSP") Signed-off-by: Frank Wang --- drivers/usb/gadget/function/f_uac2.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c index 51726100b720..e4429c8462c7 100644 --- a/drivers/usb/gadget/function/f_uac2.c +++ b/drivers/usb/gadget/function/f_uac2.c @@ -350,7 +350,7 @@ static struct usb_endpoint_descriptor ss_epout_desc = { .bDescriptorType = USB_DT_ENDPOINT, .bEndpointAddress = USB_DIR_OUT, - .bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ASYNC, + .bmAttributes = USB_ENDPOINT_XFER_ISOC | USB_ENDPOINT_SYNC_ADAPTIVE, /* .wMaxPacketSize = DYNAMIC */ .bInterval = 4, }; @@ -543,6 +543,8 @@ static struct usb_descriptor_header *ss_audio_desc[] = { (struct usb_descriptor_header *)&out_clk_src_desc, (struct usb_descriptor_header *)&usb_out_it_desc, (struct usb_descriptor_header *)&io_in_it_desc, + (struct usb_descriptor_header *)&usb_in_ot_fu_desc, + (struct usb_descriptor_header *)&io_out_ot_fu_desc, (struct usb_descriptor_header *)&usb_in_ot_desc, (struct usb_descriptor_header *)&io_out_ot_desc, @@ -912,6 +914,8 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn) return ret; } + ss_epin_desc_comp.wBytesPerInterval = ss_epin_desc.wMaxPacketSize; + ret = set_ep_max_packet_size(uac2_opts, &ss_epout_desc, USB_SPEED_SUPER, false); if (ret < 0) { @@ -919,6 +923,8 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn) return ret; } + ss_epout_desc_comp.wBytesPerInterval = ss_epout_desc.wMaxPacketSize; + if (EPOUT_EN(uac2_opts)) { agdev->out_ep = usb_ep_autoconfig(gadget, &fs_epout_desc); if (!agdev->out_ep) {