Skip to content

Commit 9e544b7

Browse files
xdarklightjbrun3t
authored andcommitted
clk: meson: meson8b: Add the vid_pll_lvds_en gate clock
HHI_VID_DIVIDER_CNTL[11] must be enabled for the video clock tree to work. This bit is described as "LVDS_CLK_EN". It is not 100% clear where this bit has to be placed in the hierarchy. But since the "LVDS_OUT" of the HDMI PLL uses it's own set of registers it's more likely that this "LVDS_CLK_EN" bit actually enables the input of the "hdmi_pll_lvds_out" clock to the "vid_pll_in_sel" tree. Add a gate definition for this bit (which will not be exported) so that the kernel can manage all required bits to enable and disable the video clocks. Signed-off-by: Martin Blumenstingl <[email protected]> Signed-off-by: Jerome Brunet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1792bda commit 9e544b7

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

drivers/clk/meson/meson8b.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,23 @@ static struct clk_regmap meson8b_l2_dram_clk_gate = {
10451045
},
10461046
};
10471047

1048+
/* also called LVDS_CLK_EN */
1049+
static struct clk_regmap meson8b_vid_pll_lvds_en = {
1050+
.data = &(struct clk_regmap_gate_data){
1051+
.offset = HHI_VID_DIVIDER_CNTL,
1052+
.bit_idx = 11,
1053+
},
1054+
.hw.init = &(struct clk_init_data){
1055+
.name = "vid_pll_lvds_en",
1056+
.ops = &clk_regmap_gate_ro_ops,
1057+
.parent_hws = (const struct clk_hw *[]) {
1058+
&meson8b_hdmi_pll_lvds_out.hw
1059+
},
1060+
.num_parents = 1,
1061+
.flags = CLK_SET_RATE_PARENT,
1062+
},
1063+
};
1064+
10481065
static struct clk_regmap meson8b_vid_pll_in_sel = {
10491066
.data = &(struct clk_regmap_mux_data){
10501067
.offset = HHI_VID_DIVIDER_CNTL,
@@ -1061,7 +1078,7 @@ static struct clk_regmap meson8b_vid_pll_in_sel = {
10611078
* Meson8m2: vid2_pll
10621079
*/
10631080
.parent_hws = (const struct clk_hw *[]) {
1064-
&meson8b_hdmi_pll_lvds_out.hw
1081+
&meson8b_vid_pll_lvds_en.hw
10651082
},
10661083
.num_parents = 1,
10671084
.flags = CLK_SET_RATE_PARENT,
@@ -2905,6 +2922,7 @@ static struct clk_hw_onecell_data meson8_hw_onecell_data = {
29052922
[CLKID_CTS_MCLK_I958_DIV] = &meson8b_cts_mclk_i958_div.hw,
29062923
[CLKID_CTS_MCLK_I958] = &meson8b_cts_mclk_i958.hw,
29072924
[CLKID_CTS_I958] = &meson8b_cts_i958.hw,
2925+
[CLKID_VID_PLL_LVDS_EN] = &meson8b_vid_pll_lvds_en.hw,
29082926
[CLK_NR_CLKS] = NULL,
29092927
},
29102928
.num = CLK_NR_CLKS,
@@ -3122,6 +3140,7 @@ static struct clk_hw_onecell_data meson8b_hw_onecell_data = {
31223140
[CLKID_CTS_MCLK_I958_DIV] = &meson8b_cts_mclk_i958_div.hw,
31233141
[CLKID_CTS_MCLK_I958] = &meson8b_cts_mclk_i958.hw,
31243142
[CLKID_CTS_I958] = &meson8b_cts_i958.hw,
3143+
[CLKID_VID_PLL_LVDS_EN] = &meson8b_vid_pll_lvds_en.hw,
31253144
[CLK_NR_CLKS] = NULL,
31263145
},
31273146
.num = CLK_NR_CLKS,
@@ -3341,6 +3360,7 @@ static struct clk_hw_onecell_data meson8m2_hw_onecell_data = {
33413360
[CLKID_CTS_MCLK_I958_DIV] = &meson8b_cts_mclk_i958_div.hw,
33423361
[CLKID_CTS_MCLK_I958] = &meson8b_cts_mclk_i958.hw,
33433362
[CLKID_CTS_I958] = &meson8b_cts_i958.hw,
3363+
[CLKID_VID_PLL_LVDS_EN] = &meson8b_vid_pll_lvds_en.hw,
33443364
[CLK_NR_CLKS] = NULL,
33453365
},
33463366
.num = CLK_NR_CLKS,
@@ -3539,6 +3559,7 @@ static struct clk_regmap *const meson8b_clk_regmaps[] = {
35393559
&meson8b_cts_mclk_i958_div,
35403560
&meson8b_cts_mclk_i958,
35413561
&meson8b_cts_i958,
3562+
&meson8b_vid_pll_lvds_en,
35423563
};
35433564

35443565
static const struct meson8b_clk_reset_line {

drivers/clk/meson/meson8b.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,9 @@
172172
#define CLKID_CTS_MCLK_I958_DIV 211
173173
#define CLKID_VCLK_EN 214
174174
#define CLKID_VCLK2_EN 215
175+
#define CLKID_VID_PLL_LVDS_EN 216
175176

176-
#define CLK_NR_CLKS 216
177+
#define CLK_NR_CLKS 217
177178

178179
/*
179180
* include the CLKID and RESETID that have

0 commit comments

Comments
 (0)