Skip to content

Commit

Permalink
drivers: use fracn in clock stm32h7 driver
Browse files Browse the repository at this point in the history
use fracn value if defined for each PLL 1, 2 and 3 based on stm32u5 code

Signed-off-by: Nathan Olff <[email protected]>
  • Loading branch information
nono313 authored and carlescufi committed Sep 16, 2024
1 parent 9dd25ad commit f979252
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion drivers/clock_control/clock_stm32_ll_h7.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,8 +800,11 @@ static int set_up_plls(void)

LL_RCC_PLL1_SetN(STM32_PLL_N_MULTIPLIER);

/* FRACN disable DIVP,DIVQ,DIVR enable*/
LL_RCC_PLL1FRACN_Disable();
if (IS_ENABLED(STM32_PLL_FRACN_ENABLED)) {
LL_RCC_PLL1_SetFRACN(STM32_PLL_FRACN_VALUE);
LL_RCC_PLL1FRACN_Enable();
}

if (IS_ENABLED(STM32_PLL_P_ENABLED)) {
LL_RCC_PLL1_SetP(STM32_PLL_P_DIVISOR);
Expand Down Expand Up @@ -846,6 +849,10 @@ static int set_up_plls(void)
LL_RCC_PLL2_SetN(STM32_PLL2_N_MULTIPLIER);

LL_RCC_PLL2FRACN_Disable();
if (IS_ENABLED(STM32_PLL2_FRACN_ENABLED)) {
LL_RCC_PLL2_SetFRACN(STM32_PLL2_FRACN_VALUE);
LL_RCC_PLL2FRACN_Enable();
}

if (IS_ENABLED(STM32_PLL2_P_ENABLED)) {
LL_RCC_PLL2_SetP(STM32_PLL2_P_DIVISOR);
Expand Down Expand Up @@ -896,6 +903,10 @@ static int set_up_plls(void)
LL_RCC_PLL3_SetN(STM32_PLL3_N_MULTIPLIER);

LL_RCC_PLL3FRACN_Disable();
if (IS_ENABLED(STM32_PLL3_FRACN_ENABLED)) {
LL_RCC_PLL3_SetFRACN(STM32_PLL3_FRACN_VALUE);
LL_RCC_PLL3FRACN_Enable();
}

if (IS_ENABLED(STM32_PLL3_P_ENABLED)) {
LL_RCC_PLL3_SetP(STM32_PLL3_P_DIVISOR);
Expand Down

0 comments on commit f979252

Please sign in to comment.