diff options
| author | HiFiPhile <[email protected]> | 2025-10-31 17:22:24 +0100 |
|---|---|---|
| committer | HiFiPhile <[email protected]> | 2025-10-31 17:22:24 +0100 |
| commit | a1b0aa4e3ac738e6232c776c6eaddaef2fc7066a (patch) | |
| tree | 85b214dd01a63181e02675c28902ce67ea526621 /src/device/usbd.c | |
| parent | 30132e8e6d39447c0633f96594ff4bdac06d6bc8 (diff) | |
| parent | dfcab8747d48b18290a5f93ce893541644a9bac6 (diff) | |
Merge remote-tracking branch 'tinyusb/master' into copilot/fix-dcd-edpt-xfer-issue
Signed-off-by: HiFiPhile <[email protected]>
Diffstat (limited to 'src/device/usbd.c')
| -rw-r--r-- | src/device/usbd.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c index a664c2186..765bce572 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -1101,6 +1101,28 @@ static bool process_set_config(uint8_t rhport, uint8_t cfg_num) #if CFG_TUD_BTH && CFG_TUD_BTH_ISO_ALT_COUNT if ( driver->open == btd_open ) assoc_itf_count = 2; #endif + + #if CFG_TUD_AUDIO + if (driver->open == audiod_open) { + // UAC1 device doesn't have IAD, needs to read AS interface count from CS AC descriptor + if (TUSB_CLASS_AUDIO == desc_itf->bInterfaceClass && + AUDIO_SUBCLASS_CONTROL == desc_itf->bInterfaceSubClass && + AUDIO_FUNC_PROTOCOL_CODE_UNDEF == desc_itf->bInterfaceProtocol) { + uint8_t const* p = tu_desc_next(p_desc); + uint8_t const* const itf_end = p_desc + remaining_len; + while (p < itf_end) { + if (TUSB_DESC_CS_INTERFACE == tu_desc_type(p) && + AUDIO10_CS_AC_INTERFACE_HEADER == ((audio10_desc_cs_ac_interface_1_t const *) p)->bDescriptorSubType) { + audio10_desc_cs_ac_interface_1_t const * p_header = (audio10_desc_cs_ac_interface_1_t const *) p; + // AC + AS interfaces + assoc_itf_count = p_header->bInCollection + 1; + break; + } + p = tu_desc_next(p); + } + } + } + #endif } // bind (associated) interfaces to found driver |
