Skip to content

Commit 44c8458

Browse files
papadkostasMaureenHelm
authored andcommitted
drivers: display: stm32_ltdc temporary patch for LTDC clock
LTDC clock on F4/F7 series, is generated from PLLSAI which yet is not implemented into Zephyr. Signed-off-by: Konstantinos Papadopoulos <[email protected]>
1 parent 901e3d0 commit 44c8458

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

drivers/display/display_stm32_ltdc.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <string.h>
1010
#include <device.h>
1111
#include <devicetree.h>
12+
#include <stm32_ll_rcc.h>
1213
#include <drivers/display.h>
1314
#include <drivers/gpio.h>
1415
#include <drivers/pinctrl.h>
@@ -248,6 +249,32 @@ static int stm32_ltdc_init(const struct device *dev)
248249
return err;
249250
}
250251

252+
#if defined(CONFIG_SOC_SERIES_STM32F4X)
253+
LL_RCC_PLLSAI_Disable();
254+
LL_RCC_PLLSAI_ConfigDomain_LTDC(LL_RCC_PLLSOURCE_HSE,
255+
LL_RCC_PLLSAIM_DIV_8,
256+
192,
257+
LL_RCC_PLLSAIR_DIV_4,
258+
LL_RCC_PLLSAIDIVR_DIV_8);
259+
260+
LL_RCC_PLLSAI_Enable();
261+
while (LL_RCC_PLLSAI_IsReady() != 1) {
262+
}
263+
#endif
264+
265+
#if defined(CONFIG_SOC_SERIES_STM32F7X)
266+
LL_RCC_PLLSAI_Disable();
267+
LL_RCC_PLLSAI_ConfigDomain_LTDC(LL_RCC_PLLSOURCE_HSE,
268+
LL_RCC_PLLM_DIV_8,
269+
192,
270+
LL_RCC_PLLSAIR_DIV_4,
271+
LL_RCC_PLLSAIDIVR_DIV_8);
272+
273+
LL_RCC_PLLSAI_Enable();
274+
while (LL_RCC_PLLSAI_IsReady() != 1) {
275+
}
276+
#endif
277+
251278
/* reset LTDC peripheral */
252279
__HAL_RCC_LTDC_FORCE_RESET();
253280
__HAL_RCC_LTDC_RELEASE_RESET();

0 commit comments

Comments
 (0)