Browse Source

usb: device_next: Change speed selection Kconfig dependency

In my opinion, the user is supposed to configure the speed of the stack
and drivers ough to honor that choice. However current Zephyr USB
maintainer imposes that the dependency is the other way round, i.e.
that user first needs to disable High-Speed chirp at driver level and
only then can select Full-Speed only operation. Adhere to the
arbitrarily set up rule to allow this really necessary functionality to
enter Zephyr.

I consider this change to be harmful because it opens up a Kconfig trap
that allows configuring High-Speed capable stack with a device driver
limited to Full-Speed only operation.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
pull/88430/head
Tomasz Moń 3 months ago committed by Benjamin Cabé
parent
commit
d6a8bd5870
  1. 6
      drivers/usb/udc/Kconfig
  2. 2
      subsys/usb/device_next/Kconfig

6
drivers/usb/udc/Kconfig

@ -15,7 +15,11 @@ config UDC_DRIVER_HAS_HIGH_SPEED_SUPPORT @@ -15,7 +15,11 @@ config UDC_DRIVER_HAS_HIGH_SPEED_SUPPORT
bool
config UDC_DRIVER_HIGH_SPEED_SUPPORT_ENABLED
bool
bool "Allow High-Speed chirp"
default y if UDC_DRIVER_HAS_HIGH_SPEED_SUPPORT
help
Allow High-Speed capable device to operate at High-Speed. Disable this
option to force Full-Speed only operation.
config UDC_BUF_COUNT
int "Number of buffers in the pool"

2
subsys/usb/device_next/Kconfig

@ -24,10 +24,10 @@ choice USBD_MAX_SPEED_CHOICE @@ -24,10 +24,10 @@ choice USBD_MAX_SPEED_CHOICE
config USBD_MAX_SPEED_HIGH
bool "High-Speed"
depends on UDC_DRIVER_HAS_HIGH_SPEED_SUPPORT
select UDC_DRIVER_HIGH_SPEED_SUPPORT_ENABLED
config USBD_MAX_SPEED_FULL
bool "Full-Speed"
depends on !UDC_DRIVER_HIGH_SPEED_SUPPORT_ENABLED
endchoice

Loading…
Cancel
Save