usb: remove Kconfig option CONFIG_USB

The USB configuration option is actually a global switch
to enable USB drivers in general, but currently only
the device controller drivers are meant.

USB device controller drivers also have USB_DEVICE_DRIVER option.
Thus the option USB is actually redundant and can be replaced
by the self-explanatory option USB_DEVICE_DRIVER.
The name USB itself is not unique and should not be used as an
configuration option.

With these changes the option USB_DEVICE_DRIVER generally
enables USB device controller drivers. The option USB_DEVICE_STACK
enables USB device support. It is sufficient to enable only option
USB_DEVICE_STACK because it selects USB_DEVICE_DRIVER.

CONFIG_USB Kconfig option is temporary added to subsys/usb/Kconfig.
This is necessary to pass CI and will be removed again
when the USB configuration has been adapted in modules.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit is contained in:
Johann Fischer 2021-06-29 18:48:30 +02:00 committed by Anas Nashif
commit ae074e81d4
8 changed files with 31 additions and 37 deletions

View file

@ -7,6 +7,7 @@ add_subdirectory(interrupt_controller)
add_subdirectory(misc) add_subdirectory(misc)
add_subdirectory(pcie) add_subdirectory(pcie)
add_subdirectory(disk) add_subdirectory(disk)
add_subdirectory(usb)
add_subdirectory_ifdef(CONFIG_ADC adc) add_subdirectory_ifdef(CONFIG_ADC adc)
add_subdirectory_ifdef(CONFIG_CLOCK_CONTROL clock_control) add_subdirectory_ifdef(CONFIG_CLOCK_CONTROL clock_control)
@ -28,7 +29,6 @@ add_subdirectory_ifdef(CONFIG_PINMUX pinmux)
add_subdirectory_ifdef(CONFIG_PWM pwm) add_subdirectory_ifdef(CONFIG_PWM pwm)
add_subdirectory_ifdef(CONFIG_SENSOR sensor) add_subdirectory_ifdef(CONFIG_SENSOR sensor)
add_subdirectory_ifdef(CONFIG_SPI spi) add_subdirectory_ifdef(CONFIG_SPI spi)
add_subdirectory_ifdef(CONFIG_USB usb)
add_subdirectory_ifdef(CONFIG_WATCHDOG watchdog) add_subdirectory_ifdef(CONFIG_WATCHDOG watchdog)
add_subdirectory_ifdef(CONFIG_WIFI wifi) add_subdirectory_ifdef(CONFIG_WIFI wifi)
add_subdirectory_ifdef(CONFIG_CAN can) add_subdirectory_ifdef(CONFIG_CAN can)

View file

@ -1,3 +1,3 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
add_subdirectory_ifdef(CONFIG_USB device) add_subdirectory_ifdef(CONFIG_USB_DEVICE_DRIVER device)

View file

@ -3,9 +3,4 @@
# Copyright (c) 2016 Wind River Systems, Inc. # Copyright (c) 2016 Wind River Systems, Inc.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
menuconfig USB
bool "USB"
help
Enable USB drivers.
source "drivers/usb/device/Kconfig" source "drivers/usb/device/Kconfig"

View file

@ -3,14 +3,15 @@
# Copyright (c) 2016 Wind River Systems, Inc. # Copyright (c) 2016 Wind River Systems, Inc.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
if USB menuconfig USB_DEVICE_DRIVER
bool "Enable USB device controller drivers"
help
Enable USB device controller drivers.
config USB_DEVICE_DRIVER if USB_DEVICE_DRIVER
bool
config USB_DW config USB_DW
bool "Designware USB Device Controller Driver" bool "Designware USB Device Controller Driver"
select USB_DEVICE_DRIVER
help help
Designware USB Device Controller Driver. Designware USB Device Controller Driver.
@ -23,7 +24,6 @@ config USB_DW_USB_2_0
config USB_DC_STM32 config USB_DC_STM32
bool "USB device controller driver for STM32 devices" bool "USB device controller driver for STM32 devices"
depends on SOC_FAMILY_STM32 depends on SOC_FAMILY_STM32
select USB_DEVICE_DRIVER
select USE_STM32_LL_USB select USE_STM32_LL_USB
select USE_STM32_HAL_PCD select USE_STM32_HAL_PCD
select USE_STM32_HAL_PCD_EX select USE_STM32_HAL_PCD_EX
@ -31,11 +31,17 @@ config USB_DC_STM32
Enable USB support on the STM32 F0, F1, F2, F3, F4, F7, L0, L4 and G4 family of Enable USB support on the STM32 F0, F1, F2, F3, F4, F7, L0, L4 and G4 family of
processors. processors.
config USB_DC_STM32_DISCONN_ENABLE
bool
depends on USB_DC_STM32
help
Say Y if your board uses USB DISCONNECT pin to enable the
pull-up resistor on USB DP.
config USB_DC_SAM0 config USB_DC_SAM0
bool "SAM0 series USB Device Controller driver" bool "SAM0 series USB Device Controller driver"
default y default y
depends on SOC_FAMILY_SAM0 depends on SOC_FAMILY_SAM0
select USB_DEVICE_DRIVER
help help
SAM0 family USB device controller Driver. SAM0 family USB device controller Driver.
@ -43,15 +49,13 @@ config USB_DC_SAM_USBHS
bool "SAM series USB HS Device Controller driver" bool "SAM series USB HS Device Controller driver"
depends on SOC_SERIES_SAME70 || \ depends on SOC_SERIES_SAME70 || \
SOC_SERIES_SAMV71 SOC_SERIES_SAMV71
select USB_DEVICE_DRIVER
help help
SAM family USB HS device controller Driver. SAM family USB HS device controller Driver.
menuconfig USB_NRFX config USB_NRFX
bool "Nordic Semiconductor USB Device Controller Driver" bool "Nordic Semiconductor USB Device Controller Driver"
default y default y
depends on HAS_HW_NRF_USBD depends on HAS_HW_NRF_USBD
select USB_DEVICE_DRIVER
select NRFX_USBD select NRFX_USBD
select NRFX_POWER select NRFX_POWER
help help
@ -86,33 +90,23 @@ config USB_NRFX_ATTACHED_EVENT_DELAY
config USB_KINETIS config USB_KINETIS
bool "Kinetis USB Device Controller Driver" bool "Kinetis USB Device Controller Driver"
select USB_DEVICE_DRIVER
help help
Kinetis USB Device Controller Driver. Kinetis USB Device Controller Driver.
config USB_DC_NXP_EHCI config USB_DC_NXP_EHCI
bool "Kinetis and RT EHCI USB Device Controller Driver" bool "Kinetis and RT EHCI USB Device Controller Driver"
depends on HAS_MCUX_USB_EHCI depends on HAS_MCUX_USB_EHCI
select USB_DEVICE_DRIVER
select NOCACHE_MEMORY if HAS_MCUX_CACHE select NOCACHE_MEMORY if HAS_MCUX_CACHE
help help
Kinetis and RT EHCI USB Device Controller Driver. Kinetis and RT EHCI USB Device Controller Driver.
config USB_NATIVE_POSIX
bool "Native Posix USB Device Controller Driver"
help
Native Posix USB Device Controller Driver.
module = USB_DRIVER module = USB_DRIVER
module-str = usb driver module-str = usb driver
source "subsys/logging/Kconfig.template.log_config" source "subsys/logging/Kconfig.template.log_config"
config USB_DC_STM32_DISCONN_ENABLE endif # USB_DEVICE_DRIVER
bool
depends on USB_DC_STM32
help
Say Y if your board uses USB DISCONNECT pin to enable the
pull-up resistor on USB DP.
config USB_NATIVE_POSIX
bool "Native Posix USB Device Controller Driver"
select USB_DEVICE_DRIVER
help
Native Posix USB Device Controller Driver.
endif # USB

View file

@ -72,7 +72,7 @@ static const struct soc_gpio_pinctrl usb_pinctrl[] =
* controller. STM32 F4 and F7 series support USB_OTG_FS device controller. * controller. STM32 F4 and F7 series support USB_OTG_FS device controller.
* STM32 F1 and L4 series support either USB or USB_OTG_FS device controller. * STM32 F1 and L4 series support either USB or USB_OTG_FS device controller.
* *
* WARNING: Don't mix USB defined in STM32Cube HAL and CONFIG_USB from Zephyr * WARNING: Don't mix USB defined in STM32Cube HAL and CONFIG_USB_* from Zephyr
* Kconfig system. * Kconfig system.
*/ */
#ifdef USB #ifdef USB

View file

@ -14,7 +14,7 @@ add_subdirectory(ipc)
add_subdirectory(mgmt) add_subdirectory(mgmt)
add_subdirectory_ifdef(CONFIG_MCUBOOT_IMG_MANAGER dfu) add_subdirectory_ifdef(CONFIG_MCUBOOT_IMG_MANAGER dfu)
add_subdirectory_ifdef(CONFIG_NET_BUF net) add_subdirectory_ifdef(CONFIG_NET_BUF net)
add_subdirectory_ifdef(CONFIG_USB usb) add_subdirectory_ifdef(CONFIG_USB_DEVICE_STACK usb)
add_subdirectory(random) add_subdirectory(random)
add_subdirectory(storage) add_subdirectory(storage)
add_subdirectory_ifdef(CONFIG_SETTINGS settings) add_subdirectory_ifdef(CONFIG_SETTINGS settings)

View file

@ -137,7 +137,7 @@ config TRACING_BACKEND_UART
config TRACING_BACKEND_USB config TRACING_BACKEND_USB
bool "Enable USB backend" bool "Enable USB backend"
depends on USB depends on USB_DEVICE_STACK
depends on TRACING_ASYNC depends on TRACING_ASYNC
help help
Use USB to output tracing data. Use USB to output tracing data.

View file

@ -3,9 +3,15 @@
# Copyright (c) 2016 Wind River Systems, Inc. # Copyright (c) 2016 Wind River Systems, Inc.
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
config USB
bool "Enable USB device stack (DEPRECATED)"
select USB_DEVICE_STACK
help
Compatibility option for the external modules.
menuconfig USB_DEVICE_STACK menuconfig USB_DEVICE_STACK
bool "USB Device Support" bool "USB Device Support"
depends on USB_DEVICE_DRIVER || ARCH_POSIX select USB_DEVICE_DRIVER
select HWINFO select HWINFO
help help
Enable USB device stack. Enable USB device stack.
@ -52,7 +58,6 @@ config USB_DEVICE_SN
config USB_COMPOSITE_DEVICE config USB_COMPOSITE_DEVICE
bool "Enable composite device driver" bool "Enable composite device driver"
depends on USB
help help
Enable composite USB device driver. Enable composite USB device driver.