Skip to content

Commit 4fe2c5b

Browse files
jfischer-nocfriedt
authored andcommitted
drivers: udc: allow to use timeout Kconfig option on nRF54LM20A SoC
Kconfig option UDC_DWC2_USBHS_VBUS_READY_TIMEOUT depends on services exclusively available for nRF54H20, but the option can also be used for nRF54LM20A, where there are no service dependencies, and VREG can be accessed by the driver directly. Let depend the option on the SOC series, as the controller can be used by the different CPUs on the SOC. Signed-off-by: Johann Fischer <[email protected]>
1 parent 0018e8d commit 4fe2c5b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

drivers/usb/udc/Kconfig.dwc2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ config UDC_DWC2_THREAD_PRIORITY
4949

5050
config UDC_DWC2_USBHS_VBUS_READY_TIMEOUT
5151
int "UDC DWC2 USBHS VBUS ready event timeout in ms"
52-
depends on NRFS_HAS_VBUS_DETECTOR_SERVICE
52+
depends on SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX
5353
default 0
5454
help
5555
UDC DWC2 USBHS VBUS ready event timeout. If the VBUS is not ready

drivers/usb/udc/udc_dwc2_vendor_quirks.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,10 @@ static inline int usbhs_enable_core(const struct device *dev)
393393
k_timeout_t timeout = K_FOREVER;
394394
int err;
395395

396+
if (CONFIG_UDC_DWC2_USBHS_VBUS_READY_TIMEOUT) {
397+
timeout = K_MSEC(CONFIG_UDC_DWC2_USBHS_VBUS_READY_TIMEOUT);
398+
}
399+
396400
if (!k_event_wait(&usbhs_events, USBHS_VBUS_READY, false, K_NO_WAIT)) {
397401
LOG_WRN("VBUS is not ready, block udc_enable()");
398402
if (!k_event_wait(&usbhs_events, USBHS_VBUS_READY, false, timeout)) {

0 commit comments

Comments
 (0)