Skip to content

Commit c9c7f5b

Browse files
jfischer-nocarlescufi
authored andcommitted
[nrf fromtree] 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]> (cherry picked from commit 4fe2c5b)
1 parent b2d9c44 commit c9c7f5b

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
@@ -381,6 +381,10 @@ static inline int usbhs_enable_core(const struct device *dev)
381381
k_timeout_t timeout = K_FOREVER;
382382
int err;
383383

384+
if (CONFIG_UDC_DWC2_USBHS_VBUS_READY_TIMEOUT) {
385+
timeout = K_MSEC(CONFIG_UDC_DWC2_USBHS_VBUS_READY_TIMEOUT);
386+
}
387+
384388
if (!k_event_wait(&usbhs_events, USBHS_VBUS_READY, false, K_NO_WAIT)) {
385389
LOG_WRN("VBUS is not ready, block udc_enable()");
386390
if (!k_event_wait(&usbhs_events, USBHS_VBUS_READY, false, timeout)) {

0 commit comments

Comments
 (0)