composite: add COMPOSITE_DEVICES config for composite device

Add COMPOSITE_DEVICES configuration so that external composite
devices can also know the maximum number of supported classes.
The default COMPOSITE_DEVICES number is 8.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
zhangyuan21 2023-08-08 14:54:48 +08:00 committed by Xiang Xiao
parent dc0b0d6b4c
commit 5af40a6fa4
2 changed files with 7 additions and 1 deletions

View File

@ -265,6 +265,12 @@ config COMPOSITE_MSFT_OS_DESCRIPTORS
Enabling this feature in composite driver will pass these requests
onwards to the interface drivers.
config COMPOSITE_DEVICES
int "Max class object for composite device"
default 8
---help---
Composite device class object number.
endif
config PL2303

View File

@ -40,7 +40,7 @@
****************************************************************************/
#ifdef CONFIG_USBDEV_COMPOSITE
# define NUM_DEVICES_TO_HANDLE (8)
# define NUM_DEVICES_TO_HANDLE (CONFIG_COMPOSITE_DEVICES)
#else
# define NUM_DEVICES_TO_HANDLE (1)
#endif