Commit 8d1ab20
committed
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, totol 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 | tx fifo |
| - | 0 | ctl | - | - | 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 |
| totol | - | - | - | - | 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: 256fb76 ("usb: dwc3: gadget: support to resize TxFIFOs dynamically")
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Change-Id: Ib2d3854bd305289c30ea85c447eca49af28b62fd1 parent d5e8273 commit 8d1ab20
1 file changed
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
196 | | - | |
197 | | - | |
| 195 | + | |
| 196 | + | |
198 | 197 | | |
199 | 198 | | |
200 | 199 | | |
| |||
0 commit comments