rockbox/firmware/drivers
Aidan MacDonald b616047311 usb-designware: fix ISO frame scheduling
The frame-scheduling logic cherry picked from the 'rockpod'
fork [1] was not correct for high-speed hosts and broke USB
Audio output.

The DWC seems to schedule based on the DWC_DSTS.SOFFN field,
which is a 14-bit microframe number for high-speed hosts. For
full speed hosts SOFFN is the LSB-aligned 11-bit frame number.

For high-speed hosts, USB Audio and iAP use a bInterval of 4
for the ISO endpoint which means the host sends a packet every
8 microframes. Thus, we only receive data on even microframes,
which is why adding frame scheduling broke things (and why we
got away with not doing it before).

For full speed the bInterval is 1, we get a packet each frame
and we do need to tell the core to receive on odd frames.

This code is still not completely correct for arbitrary ISO
endpoints -- for that we would need the function drivers to
provide the (micro)frame number on which they want to send or
receive.

Tested by forcing full speed at the device side by setting
USB_DW_DCFG_SPEED=3. USB Audio works fine in both high and
full speed modes now.

[1] c390dfdbdf

Change-Id: I17d283821cd0861e414c48208ca67f6e98464d7c
2026-08-15 20:41:56 +01:00
..
audio audiohw: remove unused BALANCE_CAP and CLIPPING_CAP 2026-07-20 12:47:12 -04:00
libertas chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
rtc chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
tuner chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
adc-as3514.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
ata-common.c storage: report physical sector multiplier via storage_get_info() 2025-11-17 08:57:43 -05:00
ata.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
axp-2101.c axp2101: fix the enable test in axp2101_supply_get_voltage() 2026-08-10 14:32:54 -04:00
axp-pmu.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
button.c Sansa Clip Zip: Implement LCD flip (180 degree rotation) 2026-06-14 23:16:17 -04:00
button_queue.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
cw2015.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
eeprom_24cxx.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
ft6x06.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
generic_i2c.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
i2c-async.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
isp1362.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
isp1583.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lcd-1bit-vert.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lcd-2bit-horz.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lcd-2bit-vert.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lcd-2bit-vi.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lcd-16bit-common.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lcd-16bit-vert.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lcd-16bit.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lcd-24bit.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lcd-bitmap-common.c FS#13970 - lcd_drawline() different depending on drawing direction try#2 2026-08-05 11:43:10 -04:00
lcd-color-common.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lcd-memframe.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lcd-remote-1bit-v.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lcd-remote-2bit-vi.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lcd-scroll.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
led.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
m5636.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
m66591.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
nand_id.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
pca9555.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
pcf50605.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
pcf50606.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
pcf50635.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
qt1106.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
ramdisk.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
rds.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
sd.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
sdmmc_host.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
serial.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
sw_i2c.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
synaptics-mep.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
touchpad.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
touchscreen.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
tsc200x.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
tsc2100.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
usb-designware.c usb-designware: fix ISO frame scheduling 2026-08-15 20:41:56 +01:00