drivers/clock_control: stm32: msi: Enable MSI range config in PLL mode
When MSI clock is used a source of PLL, it should be possible to select its frequency range. Fix this. Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
parent
6d31b1075a
commit
c4d9de1850
|
@ -65,7 +65,7 @@ config CLOCK_STM32_HSE_CLOCK
|
|||
|
||||
config CLOCK_STM32_MSI_RANGE
|
||||
int "MSI frequency range"
|
||||
depends on CLOCK_STM32_SYSCLK_SRC_MSI
|
||||
depends on CLOCK_STM32_SYSCLK_SRC_MSI || CLOCK_STM32_PLL_SRC_MSI
|
||||
default 8
|
||||
help
|
||||
Frequency range of MSI when MSI range is provided in RCC_CR register
|
||||
|
|
|
@ -329,6 +329,12 @@ static int stm32_clock_control_init(struct device *dev)
|
|||
|
||||
#ifdef CONFIG_CLOCK_STM32_PLL_SRC_MSI
|
||||
|
||||
/* Set MSI Range */
|
||||
LL_RCC_MSI_EnableRangeSelection();
|
||||
LL_RCC_MSI_SetRange(CONFIG_CLOCK_STM32_MSI_RANGE
|
||||
<< RCC_CR_MSIRANGE_Pos);
|
||||
LL_RCC_MSI_SetCalibTrimming(0);
|
||||
|
||||
#ifdef CONFIG_CLOCK_STM32_MSI_PLL_MODE
|
||||
/* Enable MSI hardware auto calibration */
|
||||
LL_RCC_MSI_EnablePLLMode();
|
||||
|
|
Loading…
Reference in a new issue