From 7175da2645b16123a14f7afddc2257f753fb2259 Mon Sep 17 00:00:00 2001 From: Erwan Gouriou Date: Fri, 4 Mar 2022 10:43:40 +0100 Subject: [PATCH] drivers/clock_control: stm32u5: Don't disable other clocks Don't disable other clocks after a clock is configured. This should be left to the API. Signed-off-by: Erwan Gouriou --- drivers/clock_control/clock_stm32_ll_u5.c | 29 ----------------------- 1 file changed, 29 deletions(-) diff --git a/drivers/clock_control/clock_stm32_ll_u5.c b/drivers/clock_control/clock_stm32_ll_u5.c index 9f610b30fdc..becc514eda6 100644 --- a/drivers/clock_control/clock_stm32_ll_u5.c +++ b/drivers/clock_control/clock_stm32_ll_u5.c @@ -308,19 +308,9 @@ void config_src_sysclk_pll(LL_UTILS_ClkInitTypeDef s_ClkInitStruct) /* Switch to PLL with MSI as clock source */ LL_PLL_ConfigSystemClock_MSI(&s_PLLInitStruct, &s_ClkInitStruct); - - /* Disable other clocks */ - LL_RCC_HSI_Disable(); - LL_RCC_HSE_Disable(); - } else if (IS_ENABLED(STM32_PLL_SRC_HSI)) { /* Switch to PLL with HSI as clock source */ LL_PLL_ConfigSystemClock_HSI(&s_PLLInitStruct, &s_ClkInitStruct); - - /* Disable other clocks */ - LL_RCC_HSE_Disable(); - LL_RCC_MSIS_Disable(); - } else if (IS_ENABLED(STM32_PLL_SRC_HSE)) { int hse_bypass; @@ -335,10 +325,6 @@ void config_src_sysclk_pll(LL_UTILS_ClkInitTypeDef s_ClkInitStruct) hse_bypass, &s_PLLInitStruct, &s_ClkInitStruct); - - /* Disable other clocks */ - LL_RCC_HSI_Disable(); - LL_RCC_MSIS_Disable(); } #endif /* STM32_SYSCLK_SRC_PLL */ @@ -396,11 +382,6 @@ void config_src_sysclk_hse(LL_UTILS_ClkInitTypeDef s_ClkInitStruct) LL_SetFlashLatency(new_hclk_freq); } - /* Disable other clocks */ - LL_RCC_HSI_Disable(); - LL_RCC_MSIS_Disable(); - LL_RCC_PLL1_Disable(); - #endif /* STM32_SYSCLK_SRC_HSE */ } @@ -444,11 +425,6 @@ void config_src_sysclk_msis(LL_UTILS_ClkInitTypeDef s_ClkInitStruct) LL_SetFlashLatency(new_hclk_freq); } - /* Disable other clocks */ - LL_RCC_HSE_Disable(); - LL_RCC_HSI_Disable(); - LL_RCC_PLL1_Disable(); - #endif /* STM32_SYSCLK_SRC_MSIS */ } @@ -465,11 +441,6 @@ void config_src_sysclk_hsi(LL_UTILS_ClkInitTypeDef s_ClkInitStruct) /* HSI used as SYSCLK, set latency to 0 */ LL_FLASH_SetLatency(LL_FLASH_LATENCY_0); - /* Disable other clocks */ - LL_RCC_HSE_Disable(); - LL_RCC_MSIS_Disable(); - LL_RCC_PLL1_Disable(); - #endif /* STM32_SYSCLK_SRC_HSI */ }