mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
usb: dwc3: gadget: fix tx fifos resize for disabled eps
If we put other gadget function before UVC, for example UAC and UVC, the
ep1in will be assigned to UAC and ep2in/ep3in will be assigned to UVC.
Under these circumstances, if we open UVC before UAC, ep1in tx fifo will
not be resized and get wrong base address which leading to UVC and UAC
can not be opened at the same time.
This patch make all epin tx fifos resized whether it is enabled or not.
For RV1126/RV1109, total size of tx fifos is 0x51e(1310) and number of
epin is 7 (Include ep0in). We can configured as UAC + RNDIS + UVC + ADB,
followed by details of functions.
| function | epin | xfer | mult |maxpacket(B)| fifo(* 8B)|
--------------------------------------------------------
| CTRL | 0 | ctl | 1 | 64 | 10 |
| UAC | 1 | isoc | 2 | 200 | 53 |
| RNDIS | 2 | int | 1 | 8 | 3 |
| RNDIS | 3 | bulk | 3 | 512 | 196 |
| UVC | 4 | int | 1 | 16 | 4 |
| UVC | 5 | isoc | 6 | 1024 | 775 |
| ADB | 6 | bulk | 3 | 512 | 196 |
| total | - | - | - | - | 1237 |
Attention, the max_packetsize of UAC can be increased to 1024 to support
multi-channel or high sampling depth. If we need all these four
functions, we can set max_packetsize of UAC to (((1310 - 1237 + 53 ) * 8
- 8) / 2 - 8 = 492 Bytes at most, which can support 48K 16bits 5-channel
audio source.
Fixes: d4037f52e2 ("usb: dwc3: gadget: fix fifo number for txfifo resize")
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Change-Id: Ib2d3854bd305289c30ea85c447eca49af28b62fd
This commit is contained in:
@@ -184,11 +184,8 @@ static int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!(dep->flags & DWC3_EP_ENABLED)) {
|
if (!(dep->flags & DWC3_EP_ENABLED)) {
|
||||||
fifo_number++;
|
mult = 2;
|
||||||
continue;
|
} else if (usb_endpoint_xfer_bulk(dep->endpoint.desc)) {
|
||||||
}
|
|
||||||
|
|
||||||
if (usb_endpoint_xfer_bulk(dep->endpoint.desc)) {
|
|
||||||
mult = 3;
|
mult = 3;
|
||||||
} else if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) {
|
} else if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) {
|
||||||
if (dep->endpoint.mult > 0)
|
if (dep->endpoint.mult > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user