stm32: Use new CONFIG_USB to determine if USB needs to be configured

Introduce a CONFIG_USB build symbol that is set whenever
CONFIG_USBSERIAL or CONFIG_USBCANBUS is set.  Use that symbol during
setup so that the USB controller is properly initialized for both usb
serial and usb canbus bridge configurations.

This fixes the clock configuration for usb canbus bridge mode on
stm32f446.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2022-08-16 21:12:42 -04:00
parent a709ba43af
commit 6aec6efcc9
5 changed files with 14 additions and 12 deletions

View File

@@ -57,18 +57,21 @@ config USBSERIAL
bool
config USBCANBUS
bool
config USB
bool
default y if USBSERIAL || USBCANBUS
config USB_VENDOR_ID
default 0x1d50
config USB_DEVICE_ID
default 0x614e
config USB_SERIAL_NUMBER_CHIPID
depends on HAVE_CHIPID && (USBSERIAL || USBCANBUS)
depends on USB && HAVE_CHIPID
default y
config USB_SERIAL_NUMBER
default "12345"
menu "USB ids"
depends on (USBSERIAL || USBCANBUS) && LOW_LEVEL_OPTIONS
depends on USB && LOW_LEVEL_OPTIONS
config USB_VENDOR_ID
hex "USB vendor ID" if USBSERIAL
config USB_DEVICE_ID