Skip to content

Commit 505e1e5

Browse files
FRASTMnashif
authored andcommitted
drivers: clock control: stm32 pll clock config for I2S
The stm32F41x have a PLLI2S M divider for their PLL I2S but others like the stm32F401 or stm32F74x have the PLL M divider from the main PLL : might affect the sysclock. LL Function is the same for configuring the PLL I2S but parameter could depends on the stm32 serie. Signed-off-by: Francois Ramu <francois.ramu@st.com>
1 parent f415212 commit 505e1e5

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

drivers/clock_control/clock_stm32_ll_common.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@
2727
#define z_pllr(v) LL_RCC_PLLR_DIV_ ## v
2828
#define pllr(v) z_pllr(v)
2929

30+
#if defined(RCC_PLLI2SCFGR_PLLI2SM)
31+
/* Some stm32F4 devices have a dedicated PLL I2S with M divider */
3032
#define z_plli2s_m(v) LL_RCC_PLLI2SM_DIV_ ## v
33+
#else
34+
/* Some stm32F4 devices (typ. stm32F401) have a dedicated PLL I2S with PLL M divider */
35+
#define z_plli2s_m(v) LL_RCC_PLLM_DIV_ ## v
36+
#endif /* RCC_PLLI2SCFGR_PLLI2SM */
3137
#define plli2sm(v) z_plli2s_m(v)
3238

3339
#define z_plli2s_r(v) LL_RCC_PLLI2SR_DIV_ ## v

drivers/clock_control/clock_stm32f2_f4_f7.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,10 @@ void config_pll_sysclock(void)
104104
__unused
105105
void config_plli2s(void)
106106
{
107-
#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32f4_plli2s_clock)
108107
LL_RCC_PLLI2S_ConfigDomain_I2S(get_pll_source(),
109-
pllm(STM32_PLLI2S_M_DIVISOR),
110-
STM32_PLLI2S_N_MULTIPLIER,
111-
plli2sr(STM32_PLLI2S_R_DIVISOR));
112-
#elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32f412_plli2s_clock)
113-
LL_RCC_PLL_ConfigDomain_I2S(get_pll_source(),
114108
plli2sm(STM32_PLLI2S_M_DIVISOR),
115109
STM32_PLLI2S_N_MULTIPLIER,
116110
plli2sr(STM32_PLLI2S_R_DIVISOR));
117-
#endif
118111
}
119112

120113
#endif /* STM32_PLLI2S_ENABLED */

0 commit comments

Comments
 (0)