Skip to content

Commit 2568528

Browse files
xdarklightjbrun3t
authored andcommitted
clk: meson: meson8b: add the vclk2_en gate clock
HHI_VIID_CLK_CNTL[19] is not part of the public S805 datasheet. However, the GXBB driver defines this bit as a gate called "vclk2" and in the 3.10 kernel GPL code dump the following line can found: WRITE_LCD_CBUS_REG_BITS(HHI_VIID_CLK_CNTL, 0, 19, 1); //disable vclk2_en Add this gate clock to the Meson8/Meson8b/Meson8m2 clock controller to complete the VCLK2 clock tree. Signed-off-by: Martin Blumenstingl <[email protected]> Signed-off-by: Jerome Brunet <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e653b41 commit 2568528

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
@@ -1387,6 +1387,22 @@ static struct clk_regmap meson8b_vclk2_clk_in_en = {
13871387
},
13881388
};
13891389

1390+
static struct clk_regmap meson8b_vclk2_clk_en = {
1391+
.data = &(struct clk_regmap_gate_data){
1392+
.offset = HHI_VIID_CLK_DIV,
1393+
.bit_idx = 19,
1394+
},
1395+
.hw.init = &(struct clk_init_data){
1396+
.name = "vclk2_en",
1397+
.ops = &clk_regmap_gate_ro_ops,
1398+
.parent_hws = (const struct clk_hw *[]) {
1399+
&meson8b_vclk2_clk_in_en.hw
1400+
},
1401+
.num_parents = 1,
1402+
.flags = CLK_SET_RATE_PARENT,
1403+
},
1404+
};
1405+
13901406
static struct clk_regmap meson8b_vclk2_div1_gate = {
13911407
.data = &(struct clk_regmap_gate_data){
13921408
.offset = HHI_VIID_CLK_DIV,
@@ -1396,7 +1412,7 @@ static struct clk_regmap meson8b_vclk2_div1_gate = {
13961412
.name = "vclk2_div1_en",
13971413
.ops = &clk_regmap_gate_ro_ops,
13981414
.parent_hws = (const struct clk_hw *[]) {
1399-
&meson8b_vclk2_clk_in_en.hw
1415+
&meson8b_vclk2_clk_en.hw
14001416
},
14011417
.num_parents = 1,
14021418
.flags = CLK_SET_RATE_PARENT,
@@ -1410,7 +1426,7 @@ static struct clk_fixed_factor meson8b_vclk2_div2_div = {
14101426
.name = "vclk2_div2",
14111427
.ops = &clk_fixed_factor_ops,
14121428
.parent_hws = (const struct clk_hw *[]) {
1413-
&meson8b_vclk2_clk_in_en.hw
1429+
&meson8b_vclk2_clk_en.hw
14141430
},
14151431
.num_parents = 1,
14161432
.flags = CLK_SET_RATE_PARENT,
@@ -1440,7 +1456,7 @@ static struct clk_fixed_factor meson8b_vclk2_div4_div = {
14401456
.name = "vclk2_div4",
14411457
.ops = &clk_fixed_factor_ops,
14421458
.parent_hws = (const struct clk_hw *[]) {
1443-
&meson8b_vclk2_clk_in_en.hw
1459+
&meson8b_vclk2_clk_en.hw
14441460
},
14451461
.num_parents = 1,
14461462
.flags = CLK_SET_RATE_PARENT,
@@ -1470,7 +1486,7 @@ static struct clk_fixed_factor meson8b_vclk2_div6_div = {
14701486
.name = "vclk2_div6",
14711487
.ops = &clk_fixed_factor_ops,
14721488
.parent_hws = (const struct clk_hw *[]) {
1473-
&meson8b_vclk2_clk_in_en.hw
1489+
&meson8b_vclk2_clk_en.hw
14741490
},
14751491
.num_parents = 1,
14761492
.flags = CLK_SET_RATE_PARENT,
@@ -1500,7 +1516,7 @@ static struct clk_fixed_factor meson8b_vclk2_div12_div = {
15001516
.name = "vclk2_div12",
15011517
.ops = &clk_fixed_factor_ops,
15021518
.parent_hws = (const struct clk_hw *[]) {
1503-
&meson8b_vclk2_clk_in_en.hw
1519+
&meson8b_vclk2_clk_en.hw
15041520
},
15051521
.num_parents = 1,
15061522
.flags = CLK_SET_RATE_PARENT,
@@ -2848,6 +2864,7 @@ static struct clk_hw_onecell_data meson8_hw_onecell_data = {
28482864
[CLKID_VCLK_DIV12] = &meson8b_vclk_div12_div_gate.hw,
28492865
[CLKID_VCLK2_IN_SEL] = &meson8b_vclk2_in_sel.hw,
28502866
[CLKID_VCLK2_IN_EN] = &meson8b_vclk2_clk_in_en.hw,
2867+
[CLKID_VCLK2_EN] = &meson8b_vclk2_clk_en.hw,
28512868
[CLKID_VCLK2_DIV1] = &meson8b_vclk2_div1_gate.hw,
28522869
[CLKID_VCLK2_DIV2_DIV] = &meson8b_vclk2_div2_div.hw,
28532870
[CLKID_VCLK2_DIV2] = &meson8b_vclk2_div2_div_gate.hw,
@@ -3054,6 +3071,7 @@ static struct clk_hw_onecell_data meson8b_hw_onecell_data = {
30543071
[CLKID_VCLK_DIV12] = &meson8b_vclk_div12_div_gate.hw,
30553072
[CLKID_VCLK2_IN_SEL] = &meson8b_vclk2_in_sel.hw,
30563073
[CLKID_VCLK2_IN_EN] = &meson8b_vclk2_clk_in_en.hw,
3074+
[CLKID_VCLK2_EN] = &meson8b_vclk2_clk_en.hw,
30573075
[CLKID_VCLK2_DIV1] = &meson8b_vclk2_div1_gate.hw,
30583076
[CLKID_VCLK2_DIV2_DIV] = &meson8b_vclk2_div2_div.hw,
30593077
[CLKID_VCLK2_DIV2] = &meson8b_vclk2_div2_div_gate.hw,
@@ -3271,6 +3289,7 @@ static struct clk_hw_onecell_data meson8m2_hw_onecell_data = {
32713289
[CLKID_VCLK_DIV12] = &meson8b_vclk_div12_div_gate.hw,
32723290
[CLKID_VCLK2_IN_SEL] = &meson8b_vclk2_in_sel.hw,
32733291
[CLKID_VCLK2_IN_EN] = &meson8b_vclk2_clk_in_en.hw,
3292+
[CLKID_VCLK2_EN] = &meson8b_vclk2_clk_en.hw,
32743293
[CLKID_VCLK2_DIV1] = &meson8b_vclk2_div1_gate.hw,
32753294
[CLKID_VCLK2_DIV2_DIV] = &meson8b_vclk2_div2_div.hw,
32763295
[CLKID_VCLK2_DIV2] = &meson8b_vclk2_div2_div_gate.hw,
@@ -3470,6 +3489,7 @@ static struct clk_regmap *const meson8b_clk_regmaps[] = {
34703489
&meson8b_vclk_div12_div_gate,
34713490
&meson8b_vclk2_in_sel,
34723491
&meson8b_vclk2_clk_in_en,
3492+
&meson8b_vclk2_clk_en,
34733493
&meson8b_vclk2_div1_gate,
34743494
&meson8b_vclk2_div2_div_gate,
34753495
&meson8b_vclk2_div4_div_gate,

drivers/clk/meson/meson8b.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,9 @@
181181
#define CLKID_CTS_MCLK_I958_SEL 210
182182
#define CLKID_CTS_MCLK_I958_DIV 211
183183
#define CLKID_VCLK_EN 214
184+
#define CLKID_VCLK2_EN 215
184185

185-
#define CLK_NR_CLKS 215
186+
#define CLK_NR_CLKS 216
186187

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

0 commit comments

Comments
 (0)