usb: device: clarify the impact of Kconfig option USB_COMPOSITE_DEVICE

Effectively, this option changes code triple in device descriptor.
Although the name is misleading, renaming it would again lead
to negative user experiences. Instead, clarify what the option does
and always select it where it is required.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
diff --git a/subsys/usb/device/Kconfig b/subsys/usb/device/Kconfig
index 20addc2..476f740 100644
--- a/subsys/usb/device/Kconfig
+++ b/subsys/usb/device/Kconfig
@@ -49,9 +49,11 @@
 	  Hardware Information Driver (HWINFO).
 
 config USB_COMPOSITE_DEVICE
-	bool "Composite device driver"
+	bool "Use Interface Association Descriptor code triple"
 	help
-	  Enable composite USB device driver.
+	  This option modifies the code triple in the device descriptor
+	  to signal that one of the functions has two or more interfaces and
+	  uses the Interface Association Descriptor.
 
 config USB_MAX_NUM_TRANSFERS
     int "Set number of USB transfer data buffers"
diff --git a/subsys/usb/device/class/Kconfig.cdc b/subsys/usb/device/class/Kconfig.cdc
index af1d8ab..7c74802 100644
--- a/subsys/usb/device/class/Kconfig.cdc
+++ b/subsys/usb/device/class/Kconfig.cdc
@@ -6,6 +6,7 @@
 config USB_CDC_ACM
 	bool "USB CDC ACM Class support"
 	default y
+	select USB_COMPOSITE_DEVICE
 	depends on SERIAL
 	depends on DT_HAS_ZEPHYR_CDC_ACM_UART_ENABLED
 	select SERIAL_HAS_DRIVER
diff --git a/subsys/usb/device/class/audio/Kconfig b/subsys/usb/device/class/audio/Kconfig
index e38bf11..825f258 100644
--- a/subsys/usb/device/class/audio/Kconfig
+++ b/subsys/usb/device/class/audio/Kconfig
@@ -6,6 +6,7 @@
 config USB_DEVICE_AUDIO
 	bool "USB Audio Device Class Driver"
 	select EXPERIMENTAL
+	select USB_COMPOSITE_DEVICE
 	help
 	  USB Audio Device Class driver.
 	  Zephyr USB Audio Class is considered experimental
diff --git a/subsys/usb/device/class/audio/audio.c b/subsys/usb/device/class/audio/audio.c
index 6370960..dc7e15f 100644
--- a/subsys/usb/device/class/audio/audio.c
+++ b/subsys/usb/device/class/audio/audio.c
@@ -292,12 +292,10 @@
 	struct usb_if_descriptor *iface = (struct usb_if_descriptor *)head;
 	struct cs_ac_if_descriptor *header;
 
-#ifdef CONFIG_USB_COMPOSITE_DEVICE
 	struct usb_association_descriptor *iad =
 		(struct usb_association_descriptor *)
 		((char *)iface - sizeof(struct usb_association_descriptor));
 	iad->bFirstInterface = bInterfaceNumber;
-#endif
 	fix_fu_descriptors(iface);
 
 	/* Audio Control Interface */
diff --git a/subsys/usb/device/class/audio/usb_audio_internal.h b/subsys/usb/device/class/audio/usb_audio_internal.h
index 1cf8a10..c0d5383 100644
--- a/subsys/usb/device/class/audio/usb_audio_internal.h
+++ b/subsys/usb/device/class/audio/usb_audio_internal.h
@@ -328,13 +328,8 @@
 	.iFunction = 0,						\
 }
 
-#ifdef CONFIG_USB_COMPOSITE_DEVICE
 #define USB_AUDIO_IAD_DECLARE struct usb_association_descriptor iad;
 #define USB_AUDIO_IAD(if_cnt)  .iad = INIT_IAD(USB_AUDIO_AUDIOCONTROL, if_cnt),
-#else
-#define USB_AUDIO_IAD_DECLARE
-#define USB_AUDIO_IAD(if_cnt)
-#endif
 
 #define DECLARE_DESCRIPTOR(dev, i, ifaces)				\
 DECLARE_HEADER(dev, i, ifaces);						\
diff --git a/subsys/usb/device/class/cdc_acm.c b/subsys/usb/device/class/cdc_acm.c
index ab14732..9262cd5 100644
--- a/subsys/usb/device/class/cdc_acm.c
+++ b/subsys/usb/device/class/cdc_acm.c
@@ -80,9 +80,7 @@
 #define ACM_IN_EP_IDX			2
 
 struct usb_cdc_acm_config {
-#if (CONFIG_USB_COMPOSITE_DEVICE || CONFIG_CDC_ACM_IAD)
 	struct usb_association_descriptor iad_cdc;
-#endif
 	struct usb_if_descriptor if0;
 	struct cdc_header_descriptor if0_header;
 	struct cdc_cm_descriptor if0_cm;
@@ -437,9 +435,7 @@
 	desc->if0_union.bControlInterface = bInterfaceNumber;
 	desc->if1.bInterfaceNumber = bInterfaceNumber + 1;
 	desc->if0_union.bSubordinateInterface0 = bInterfaceNumber + 1;
-#if (CONFIG_USB_COMPOSITE_DEVICE || CONFIG_CDC_ACM_IAD)
 	desc->iad_cdc.bFirstInterface = bInterfaceNumber;
-#endif
 }
 
 /**
@@ -1051,7 +1047,6 @@
 #endif /* CONFIG_UART_USE_RUNTIME_CONFIGURE */
 };
 
-#if (CONFIG_USB_COMPOSITE_DEVICE || CONFIG_CDC_ACM_IAD)
 #define INITIALIZER_IAD							\
 	.iad_cdc = {							\
 		.bLength = sizeof(struct usb_association_descriptor),	\
@@ -1063,9 +1058,6 @@
 		.bFunctionProtocol = 0,					\
 		.iFunction = 0,						\
 	},
-#else
-#define INITIALIZER_IAD
-#endif
 
 #define INITIALIZER_IF(iface_num, num_ep, class, subclass)		\
 	{								\
diff --git a/subsys/usb/device/class/netusb/Kconfig b/subsys/usb/device/class/netusb/Kconfig
index 8033225..e358c9b 100644
--- a/subsys/usb/device/class/netusb/Kconfig
+++ b/subsys/usb/device/class/netusb/Kconfig
@@ -12,6 +12,7 @@
 config USB_DEVICE_NETWORK_ECM
 	bool "USB Ethernet Control Model (ECM) Networking device"
 	select USB_DEVICE_NETWORK
+	select USB_COMPOSITE_DEVICE
 	help
 	  Ethernet Control Model (ECM) is a part of  Communications Device
 	  Class (CDC) USB protocol specified by USB-IF.
@@ -27,6 +28,7 @@
 config USB_DEVICE_NETWORK_RNDIS
 	bool "USB Remote NDIS (RNDIS) Networking device"
 	select USB_DEVICE_NETWORK
+	select USB_COMPOSITE_DEVICE
 	help
 	  Remote NDIS (RNDIS) is commonly used Microsoft vendor protocol with
 	  Specification available from Microsoft web site.
diff --git a/subsys/usb/device/class/netusb/function_ecm.c b/subsys/usb/device/class/netusb/function_ecm.c
index b5eaa0d..256cf9b 100644
--- a/subsys/usb/device/class/netusb/function_ecm.c
+++ b/subsys/usb/device/class/netusb/function_ecm.c
@@ -31,9 +31,7 @@
 static uint8_t tx_buf[NET_ETH_MAX_FRAME_SIZE], rx_buf[NET_ETH_MAX_FRAME_SIZE];
 
 struct usb_cdc_ecm_config {
-#ifdef CONFIG_USB_COMPOSITE_DEVICE
 	struct usb_association_descriptor iad;
-#endif
 	struct usb_if_descriptor if0;
 	struct cdc_header_descriptor if0_header;
 	struct cdc_union_descriptor if0_union;
@@ -48,7 +46,6 @@
 } __packed;
 
 USBD_CLASS_DESCR_DEFINE(primary, 0) struct usb_cdc_ecm_config cdc_ecm_cfg = {
-#ifdef CONFIG_USB_COMPOSITE_DEVICE
 	.iad = {
 		.bLength = sizeof(struct usb_association_descriptor),
 		.bDescriptorType = USB_DESC_INTERFACE_ASSOC,
@@ -59,7 +56,6 @@
 		.bFunctionProtocol = 0,
 		.iFunction = 0,
 	},
-#endif
 	/* Interface descriptor 0 */
 	/* CDC Communication interface */
 	.if0 = {
@@ -422,9 +418,7 @@
 	cdc_ecm_cfg.if0_union.bSubordinateInterface0 = bInterfaceNumber + 1;
 	cdc_ecm_cfg.if1_0.bInterfaceNumber = bInterfaceNumber + 1;
 	cdc_ecm_cfg.if1_1.bInterfaceNumber = bInterfaceNumber + 1;
-#ifdef CONFIG_USB_COMPOSITE_DEVICE
 	cdc_ecm_cfg.iad.bFirstInterface = bInterfaceNumber;
-#endif
 }
 
 USBD_DEFINE_CFG_DATA(cdc_ecm_config) = {