Skip to content

Commit daffad2

Browse files
Gabriel-Fernandez-stmbebarino
authored andcommitted
clk: stm32f4: fix: exclude values 0 and 1 for PLLQ
0000: PLLQ = 0, wrong configuration 0001: PLLQ = 1, wrong configuration ... 0010: PLLQ = 2 0011: PLLQ = 3 0100: PLLQ = 4 ... 1111: PLLQ = 1 Use divider table to exclude 0 and 1 values. Fixes: 83135ad ("clk: stm32f4: Add PLL_I2S & PLL_SAI for STM32F429/469 boards") Signed-off-by: Gabriel Fernandez <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 7f0b97d commit daffad2

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

drivers/clk/clk-stm32f4.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,13 @@ static const struct clk_div_table pll_divp_table[] = {
429429
{ 0, 2 }, { 1, 4 }, { 2, 6 }, { 3, 8 }, { 0 }
430430
};
431431

432+
static const struct clk_div_table pll_divq_table[] = {
433+
{ 2, 2 }, { 3, 3 }, { 4, 4 }, { 5, 5 }, { 6, 6 }, { 7, 7 },
434+
{ 8, 8 }, { 9, 9 }, { 10, 10 }, { 11, 11 }, { 12, 12 }, { 13, 13 },
435+
{ 14, 14 }, { 15, 15 },
436+
{ 0 }
437+
};
438+
432439
static const struct clk_div_table pll_divr_table[] = {
433440
{ 2, 2 }, { 3, 3 }, { 4, 4 }, { 5, 5 }, { 6, 6 }, { 7, 7 }, { 0 }
434441
};
@@ -496,9 +503,9 @@ struct stm32f4_div_data {
496503

497504
#define MAX_PLL_DIV 3
498505
static const struct stm32f4_div_data div_data[MAX_PLL_DIV] = {
499-
{ 16, 2, 0, pll_divp_table },
500-
{ 24, 4, CLK_DIVIDER_ONE_BASED, NULL },
501-
{ 28, 3, 0, pll_divr_table },
506+
{ 16, 2, 0, pll_divp_table },
507+
{ 24, 4, 0, pll_divq_table },
508+
{ 28, 3, 0, pll_divr_table },
502509
};
503510

504511
struct stm32f4_pll_data {

0 commit comments

Comments
 (0)