Skip to content

Commit 5b1a439

Browse files
xdarklightjbrun3t
authored andcommitted
clk: meson: gxbb: Limit the HDMI PLL OD to /4 on GXL/GXM SoCs
GXBB has the HDMI PLL OD in the HHI_HDMI_PLL_CNTL2 register while for GXL/GXM the OD has moved to HHI_HDMI_PLL_CNTL3. At first glance the rest of the OD setup seems identical. However, looking at the downstream kernel sources as well as testing shows that GXL only supports three OD values: - register value 0 means: divide by 1 - register value 1 means: divide by 2 - register value 2 means: divide by 4 Using register value 3 (which on GXBB means: divide by 8) still divides by 4 as verified using meson-clk-measure. Downstream sources are also only using OD register values 0, 1 and 2 for GXL (while for GXBB the downstream kernel sources are also using value 3). Add clk_div_table and have it replace the CLK_DIVIDER_POWER_OF_TWO flag to make the kernel's view of this register match with how the hardware actually works. Fixes: 69d9229 ("clk: meson: add the gxl hdmi pll") Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Link: https://lore.kernel.org/r/20260105204710.447779-2-martin.blumenstingl@googlemail.com Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
1 parent 4aca7e9 commit 5b1a439

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

drivers/clk/meson/gxbb.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,12 +349,23 @@ static struct clk_regmap gxbb_hdmi_pll = {
349349
},
350350
};
351351

352+
/*
353+
* GXL hdmi OD dividers are POWER_OF_TWO dividers but limited to /4.
354+
* A divider value of 3 should map to /8 but instead map /4 so ignore it.
355+
*/
356+
static const struct clk_div_table gxl_hdmi_pll_od_div_table[] = {
357+
{ .val = 0, .div = 1 },
358+
{ .val = 1, .div = 2 },
359+
{ .val = 2, .div = 4 },
360+
{ /* sentinel */ }
361+
};
362+
352363
static struct clk_regmap gxl_hdmi_pll_od = {
353364
.data = &(struct clk_regmap_div_data){
354365
.offset = HHI_HDMI_PLL_CNTL + 8,
355366
.shift = 21,
356367
.width = 2,
357-
.flags = CLK_DIVIDER_POWER_OF_TWO,
368+
.table = gxl_hdmi_pll_od_div_table,
358369
},
359370
.hw.init = &(struct clk_init_data){
360371
.name = "hdmi_pll_od",
@@ -372,7 +383,7 @@ static struct clk_regmap gxl_hdmi_pll_od2 = {
372383
.offset = HHI_HDMI_PLL_CNTL + 8,
373384
.shift = 23,
374385
.width = 2,
375-
.flags = CLK_DIVIDER_POWER_OF_TWO,
386+
.table = gxl_hdmi_pll_od_div_table,
376387
},
377388
.hw.init = &(struct clk_init_data){
378389
.name = "hdmi_pll_od2",
@@ -390,7 +401,7 @@ static struct clk_regmap gxl_hdmi_pll = {
390401
.offset = HHI_HDMI_PLL_CNTL + 8,
391402
.shift = 19,
392403
.width = 2,
393-
.flags = CLK_DIVIDER_POWER_OF_TWO,
404+
.table = gxl_hdmi_pll_od_div_table,
394405
},
395406
.hw.init = &(struct clk_init_data){
396407
.name = "hdmi_pll",

0 commit comments

Comments
 (0)