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 <frank.wang@rock-chips.com>
This commit is contained in:
Frank Wang
2021-07-01 14:38:04 +08:00
committed by Tao Huang
parent c3fa37174e
commit e360c65d23

View File

@@ -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) {