usb: gadget: f_uac: update maxpacket in function bind

This patch fixes the bug of RV1126 USB crash when configed as
UVC + UAC + RNDIS + ADB. If we resize txfifo before opening
UAC stream, the maxpacket of epin will be the default value
1024 and txfifo will exceed the maximum limit.

Fixes: e658b2131e ("usb: dwc3: gadget: fix tx fifos resize for disabled eps")
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Change-Id: I1e892b11a0bdda2877d3e17148867d21cb68238c
This commit is contained in:
Ren Jianing
2020-12-04 17:54:11 +08:00
committed by Tao Huang
parent 278370effb
commit e29b8140d4
2 changed files with 2 additions and 0 deletions

View File

@@ -926,6 +926,7 @@ static int f_audio_bind(struct usb_configuration *c, struct usb_function *f)
ep = usb_ep_autoconfig(cdev->gadget, &as_in_ep_desc);
if (!ep)
goto fail;
ep->maxpacket = usb_endpoint_maxp(&as_in_ep_desc);
audio->in_ep = ep;
audio->in_ep->desc = &as_in_ep_desc;
}

View File

@@ -809,6 +809,7 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
dev_err(dev, "%s:%d Error!\n", __func__, __LINE__);
return -ENODEV;
}
agdev->in_ep->maxpacket = usb_endpoint_maxp(&fs_epin_desc);
}
agdev->in_ep_maxpsize = max_t(u16,