From 5af40a6fa4e04b8e6e7df56139211755866cfad5 Mon Sep 17 00:00:00 2001 From: zhangyuan21 Date: Tue, 8 Aug 2023 14:54:48 +0800 Subject: [PATCH] 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 --- drivers/usbdev/Kconfig | 6 ++++++ drivers/usbdev/composite.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/usbdev/Kconfig b/drivers/usbdev/Kconfig index e1642858c7..d9b855ee46 100644 --- a/drivers/usbdev/Kconfig +++ b/drivers/usbdev/Kconfig @@ -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 diff --git a/drivers/usbdev/composite.h b/drivers/usbdev/composite.h index 308501579c..f98bb595d0 100644 --- a/drivers/usbdev/composite.h +++ b/drivers/usbdev/composite.h @@ -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