Skip to content

Commit 0ef3801

Browse files
ndrs-pstkartben
authored andcommitted
drivers: udc: stm32: update STM32_CLOCK_CHECK definition
Introduce `UDC_STM32_CLOCK_CHECK` Kconfig option since `USB_DC_STM32_CLOCK_CHECK` was intended for use with `usb_dc_stm32.c`, which is mutually exclusive with `udc_stm32.c`. Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
1 parent bb3ac84 commit 0ef3801

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

drivers/usb/udc/Kconfig.stm32

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,12 @@ config UDC_STM32_MAX_QMESSAGES
3535
help
3636
Maximum number of messages for handling of STM32 USBD ISR events.
3737

38+
config UDC_STM32_CLOCK_CHECK
39+
bool "Runtime USB 48MHz clock check"
40+
default y if !(SOC_SERIES_STM32F1X || SOC_SERIES_STM32F3X || SOC_SERIES_STM32U5X)
41+
help
42+
Enable USB clock 48MHz configuration runtime check.
43+
In specific cases, this check might provide wrong verdict and should
44+
be disabled.
45+
3846
endif

drivers/usb/udc/udc_stm32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ static int priv_clock_enable(void)
11161116
return -EIO;
11171117
}
11181118

1119-
if (IS_ENABLED(CONFIG_USB_DC_STM32_CLOCK_CHECK)) {
1119+
if (IS_ENABLED(CONFIG_UDC_STM32_CLOCK_CHECK)) {
11201120
uint32_t usb_clock_rate;
11211121

11221122
if (clock_control_get_rate(clk,

0 commit comments

Comments
 (0)