Skip to content

Commit 8920e87

Browse files
committed
drivers/clock_control: stm32h7: Add support for CKPER clock mux
Add support for CKPER clock mux. Signed-off-by: Erwan Gouriou <[email protected]>
1 parent 9476ccd commit 8920e87

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

drivers/clock_control/clock_stm32_ll_h7.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,26 @@ static inline int enabled_clock(uint32_t src_clk)
319319
switch (src_clk) {
320320
case STM32_SRC_SYSCLK:
321321
break;
322+
case STM32_SRC_CKPER:
323+
if (!IS_ENABLED(STM32_CKPER_ENABLED)) {
324+
r = -ENOTSUP;
325+
}
326+
break;
322327
case STM32_SRC_HSE:
323328
if (!IS_ENABLED(STM32_HSE_ENABLED)) {
324329
r = -ENOTSUP;
325330
}
326331
break;
332+
case STM32_SRC_HSI_KER:
333+
if (!IS_ENABLED(STM32_HSI_ENABLED)) {
334+
r = -ENOTSUP;
335+
}
336+
break;
337+
case STM32_SRC_CSI_KER:
338+
if (!IS_ENABLED(STM32_CSI_ENABLED)) {
339+
r = -ENOTSUP;
340+
}
341+
break;
327342
case STM32_SRC_LSE:
328343
if (!IS_ENABLED(STM32_LSE_ENABLED)) {
329344
r = -ENOTSUP;
@@ -502,6 +517,11 @@ static int stm32_clock_control_get_subsys_rate(const struct device *clock,
502517
case STM32_SRC_SYSCLK:
503518
*rate = get_hclk_frequency();
504519
break;
520+
#if defined(STM32_CKPER_ENABLED)
521+
case STM32_SRC_CKPER:
522+
*rate = LL_RCC_GetCLKPClockFreq(LL_RCC_CLKP_CLKSOURCE);
523+
break;
524+
#endif /* STM32_CKPER_ENABLED */
505525
#if defined(STM32_HSE_ENABLED)
506526
case STM32_SRC_HSE:
507527
*rate = STM32_HSE_FREQ;

0 commit comments

Comments
 (0)