Skip to content

Commit 073302b

Browse files
committed
drivers/i2s_ll_stm32.c: pass proper PLLR param when setting I2S PLL
The PLLR parameter in LL_RCC_PLLI2S_ConfigDomain_I2S() API should be selected among the following list of (already shifted) values: * @arg @ref LL_RCC_PLLI2SR_DIV_2 * @arg @ref LL_RCC_PLLI2SR_DIV_3 * @arg @ref LL_RCC_PLLI2SR_DIV_4 * @arg @ref LL_RCC_PLLI2SR_DIV_5 * @arg @ref LL_RCC_PLLI2SR_DIV_6 * @arg @ref LL_RCC_PLLI2SR_DIV_7 This commit fixes PR #12609. Signed-off-by: Armando Visconti <[email protected]>
1 parent f9763e9 commit 073302b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/i2s/i2s_ll_stm32.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ static int i2s_stm32_enable_clock(struct device *dev)
109109
#ifdef CONFIG_I2S_STM32_USE_PLLI2S_ENABLE
110110
#define PLLI2S_MAX_MS_TIME 1 /* PLLI2S lock time is 300us max */
111111
static u16_t plli2s_ms_count;
112+
113+
#define _pllr(v) LL_RCC_PLLI2SR_DIV_ ## v
114+
#define pllr(v) _pllr(v)
112115
#endif
113116

114117
static int i2s_stm32_set_clock(struct device *dev, u32_t bit_clk_freq)
@@ -127,7 +130,7 @@ static int i2s_stm32_set_clock(struct device *dev, u32_t bit_clk_freq)
127130
LL_RCC_PLLI2S_ConfigDomain_I2S(pll_src,
128131
CONFIG_I2S_STM32_PLLI2S_PLLM,
129132
CONFIG_I2S_STM32_PLLI2S_PLLN,
130-
CONFIG_I2S_STM32_PLLI2S_PLLR);
133+
pllr(CONFIG_I2S_STM32_PLLI2S_PLLR));
131134
LL_RCC_PLLI2S_Enable();
132135

133136
/* wait until PLLI2S gets locked */

0 commit comments

Comments
 (0)