diff options
| author | tswan22 <[email protected]> | 2025-11-01 12:51:40 -0400 |
|---|---|---|
| committer | tswan22 <[email protected]> | 2025-11-01 12:51:40 -0400 |
| commit | ca44c772f7ad87a8d12de0b3a57ad8816f2edc10 (patch) | |
| tree | 2ac98dc0c073ca161741751504fdbeb0b710dd11 /src/device/usbd.c | |
| parent | 9d46cca57637cfd086499970a8f5d5669ba9bfa0 (diff) | |
| parent | a6c16d147593732028ed89292805e0e6a972e4b5 (diff) | |
Merge branch 'master' of https://github.com/hathach/tinyusb
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 339ccf4b4..05fc752af 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 |
