Skip to content

Commit e653b41

Browse files
xdarklightjbrun3t
authored andcommitted
clk: meson: meson8b: add the vclk_en gate clock
HHI_VID_CLK_CNTL[19] is documented as CLK_EN0. This description is the same in the public S912 datasheet and the GXBB driver calls this gate "vclk". Add this gate clock to the Meson8/Meson8b/Meson8m2 clock controller because it's needed to make the video output work. Signed-off-by: Martin Blumenstingl <[email protected]> Signed-off-by: Jerome Brunet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d4db572 commit e653b41

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

drivers/clk/meson/meson8b.c

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,22 @@ static struct clk_regmap meson8b_vclk_in_en = {
12041204
},
12051205
};
12061206

1207+
static struct clk_regmap meson8b_vclk_en = {
1208+
.data = &(struct clk_regmap_gate_data){
1209+
.offset = HHI_VID_CLK_CNTL,
1210+
.bit_idx = 19,
1211+
},
1212+
.hw.init = &(struct clk_init_data){
1213+
.name = "vclk_en",
1214+
.ops = &clk_regmap_gate_ro_ops,
1215+
.parent_hws = (const struct clk_hw *[]) {
1216+
&meson8b_vclk_in_en.hw
1217+
},
1218+
.num_parents = 1,
1219+
.flags = CLK_SET_RATE_PARENT,
1220+
},
1221+
};
1222+
12071223
static struct clk_regmap meson8b_vclk_div1_gate = {
12081224
.data = &(struct clk_regmap_gate_data){
12091225
.offset = HHI_VID_CLK_CNTL,
@@ -1213,7 +1229,7 @@ static struct clk_regmap meson8b_vclk_div1_gate = {
12131229
.name = "vclk_div1_en",
12141230
.ops = &clk_regmap_gate_ro_ops,
12151231
.parent_hws = (const struct clk_hw *[]) {
1216-
&meson8b_vclk_in_en.hw
1232+
&meson8b_vclk_en.hw
12171233
},
12181234
.num_parents = 1,
12191235
.flags = CLK_SET_RATE_PARENT,
@@ -1227,7 +1243,7 @@ static struct clk_fixed_factor meson8b_vclk_div2_div = {
12271243
.name = "vclk_div2",
12281244
.ops = &clk_fixed_factor_ops,
12291245
.parent_hws = (const struct clk_hw *[]) {
1230-
&meson8b_vclk_in_en.hw
1246+
&meson8b_vclk_en.hw
12311247
},
12321248
.num_parents = 1,
12331249
.flags = CLK_SET_RATE_PARENT,
@@ -1257,7 +1273,7 @@ static struct clk_fixed_factor meson8b_vclk_div4_div = {
12571273
.name = "vclk_div4",
12581274
.ops = &clk_fixed_factor_ops,
12591275
.parent_hws = (const struct clk_hw *[]) {
1260-
&meson8b_vclk_in_en.hw
1276+
&meson8b_vclk_en.hw
12611277
},
12621278
.num_parents = 1,
12631279
.flags = CLK_SET_RATE_PARENT,
@@ -1287,7 +1303,7 @@ static struct clk_fixed_factor meson8b_vclk_div6_div = {
12871303
.name = "vclk_div6",
12881304
.ops = &clk_fixed_factor_ops,
12891305
.parent_hws = (const struct clk_hw *[]) {
1290-
&meson8b_vclk_in_en.hw
1306+
&meson8b_vclk_en.hw
12911307
},
12921308
.num_parents = 1,
12931309
.flags = CLK_SET_RATE_PARENT,
@@ -1317,7 +1333,7 @@ static struct clk_fixed_factor meson8b_vclk_div12_div = {
13171333
.name = "vclk_div12",
13181334
.ops = &clk_fixed_factor_ops,
13191335
.parent_hws = (const struct clk_hw *[]) {
1320-
&meson8b_vclk_in_en.hw
1336+
&meson8b_vclk_en.hw
13211337
},
13221338
.num_parents = 1,
13231339
.flags = CLK_SET_RATE_PARENT,
@@ -2820,6 +2836,7 @@ static struct clk_hw_onecell_data meson8_hw_onecell_data = {
28202836
[CLKID_VID_PLL_FINAL_DIV] = &meson8b_vid_pll_final_div.hw,
28212837
[CLKID_VCLK_IN_SEL] = &meson8b_vclk_in_sel.hw,
28222838
[CLKID_VCLK_IN_EN] = &meson8b_vclk_in_en.hw,
2839+
[CLKID_VCLK_EN] = &meson8b_vclk_en.hw,
28232840
[CLKID_VCLK_DIV1] = &meson8b_vclk_div1_gate.hw,
28242841
[CLKID_VCLK_DIV2_DIV] = &meson8b_vclk_div2_div.hw,
28252842
[CLKID_VCLK_DIV2] = &meson8b_vclk_div2_div_gate.hw,
@@ -3025,6 +3042,7 @@ static struct clk_hw_onecell_data meson8b_hw_onecell_data = {
30253042
[CLKID_VID_PLL_FINAL_DIV] = &meson8b_vid_pll_final_div.hw,
30263043
[CLKID_VCLK_IN_SEL] = &meson8b_vclk_in_sel.hw,
30273044
[CLKID_VCLK_IN_EN] = &meson8b_vclk_in_en.hw,
3045+
[CLKID_VCLK_EN] = &meson8b_vclk_en.hw,
30283046
[CLKID_VCLK_DIV1] = &meson8b_vclk_div1_gate.hw,
30293047
[CLKID_VCLK_DIV2_DIV] = &meson8b_vclk_div2_div.hw,
30303048
[CLKID_VCLK_DIV2] = &meson8b_vclk_div2_div_gate.hw,
@@ -3241,6 +3259,7 @@ static struct clk_hw_onecell_data meson8m2_hw_onecell_data = {
32413259
[CLKID_VID_PLL_FINAL_DIV] = &meson8b_vid_pll_final_div.hw,
32423260
[CLKID_VCLK_IN_SEL] = &meson8b_vclk_in_sel.hw,
32433261
[CLKID_VCLK_IN_EN] = &meson8b_vclk_in_en.hw,
3262+
[CLKID_VCLK_EN] = &meson8b_vclk_en.hw,
32443263
[CLKID_VCLK_DIV1] = &meson8b_vclk_div1_gate.hw,
32453264
[CLKID_VCLK_DIV2_DIV] = &meson8b_vclk_div2_div.hw,
32463265
[CLKID_VCLK_DIV2] = &meson8b_vclk_div2_div_gate.hw,
@@ -3443,6 +3462,7 @@ static struct clk_regmap *const meson8b_clk_regmaps[] = {
34433462
&meson8b_vid_pll_final_div,
34443463
&meson8b_vclk_in_sel,
34453464
&meson8b_vclk_in_en,
3465+
&meson8b_vclk_en,
34463466
&meson8b_vclk_div1_gate,
34473467
&meson8b_vclk_div2_div_gate,
34483468
&meson8b_vclk_div4_div_gate,

drivers/clk/meson/meson8b.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,9 @@
180180
#define CLKID_CTS_AMCLK_DIV 208
181181
#define CLKID_CTS_MCLK_I958_SEL 210
182182
#define CLKID_CTS_MCLK_I958_DIV 211
183+
#define CLKID_VCLK_EN 214
183184

184-
#define CLK_NR_CLKS 214
185+
#define CLK_NR_CLKS 215
185186

186187
/*
187188
* include the CLKID and RESETID that have

0 commit comments

Comments
 (0)