]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
clk: stm32f: fix setting of division factor for LCD_CLK
authorDario Binacchi <dario.binacchi@amarulasolutions.com>
Sat, 11 Nov 2023 10:46:18 +0000 (11:46 +0100)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Fri, 15 Dec 2023 14:03:18 +0000 (15:03 +0100)
The value to be written to the register must be appropriately shifted,
as is correctly done in other parts of the code.

Fixes: 5e993508cb25 ("clk: clk_stm32f: Add set_rate for LTDC clock")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
drivers/clk/stm32/clk-stm32f.c

index ed7660196ef0e1ea422071b57982d34ba51c0840..4c1864193357f8fe4b8d1c503d846bf42a41e4f7 100644 (file)
@@ -530,7 +530,8 @@ static ulong stm32_set_rate(struct clk *clk, ulong rate)
                        /* set pll_saidivr with found value */
                        clrsetbits_le32(&regs->dckcfgr,
                                        RCC_DCKCFGR_PLLSAIDIVR_MASK,
-                                       pllsaidivr_table[i]);
+                                       pllsaidivr_table[i] <<
+                                       RCC_DCKCFGR_PLLSAIDIVR_SHIFT);
                        return rate;
                }