Skip to content

Commit 618044e

Browse files
kbidanidanieldegrasse
authored andcommitted
drivers: clock_control: fix PLL input frequency
Correct PLL input frequency calculation to consider HSI clock divider in clock_stm32_ll_h7.c file. For sake of simplicity, use PLLSRC_FREQmacro that already considers the HSI clock divider when applicable. Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
1 parent 05616c5 commit 618044e

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

drivers/clock_control/clock_stm32_ll_h7.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -217,17 +217,12 @@ static uint32_t get_pllout_frequency(uint32_t pllsrc_freq,
217217
__unused
218218
static uint32_t get_pllsrc_frequency(void)
219219
{
220-
switch (LL_RCC_PLL_GetSource()) {
221-
case LL_RCC_PLLSOURCE_HSI:
222-
return STM32_HSI_FREQ;
223-
case LL_RCC_PLLSOURCE_CSI:
224-
return STM32_CSI_FREQ;
225-
case LL_RCC_PLLSOURCE_HSE:
226-
return STM32_HSE_FREQ;
227-
case LL_RCC_PLLSOURCE_NONE:
228-
default:
229-
return 0;
230-
}
220+
/* M4 is not expected to call this function */
221+
#ifdef CONFIG_CPU_CORTEX_M7
222+
return PLLSRC_FREQ;
223+
#else
224+
return 0;
225+
#endif
231226
}
232227

233228
__unused

0 commit comments

Comments
 (0)