Skip to content

Commit 730feea

Browse files
macromorganwens
authored andcommitted
clk: sunxi-ng: h616: Add clock/reset for LCD TCON
Add the required clock and reset which is used for the LCD TCON. Please note that these clocks are exposed on the T507, H616, and H700; however the H616 does not expose an LCD controller for which these clocks are needed. Signed-off-by: Chris Morgan <macromorgan@hotmail.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Tested-by: Ryan Walklin <ryan@testtoast.com> Link: https://patch.msgid.link/20250213172248.158447-3-macroalpha82@gmail.com Signed-off-by: Chen-Yu Tsai <wens@csie.org>
1 parent c240648 commit 730feea

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

drivers/clk/sunxi-ng/ccu-sun50i-h616.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,20 @@ static const char * const tcon_tv_parents[] = { "pll-video0",
645645
"pll-video0-4x",
646646
"pll-video1",
647647
"pll-video1-4x" };
648+
static SUNXI_CCU_MUX_WITH_GATE(tcon_lcd0_clk, "tcon-lcd0",
649+
tcon_tv_parents, 0xb60,
650+
24, 3, /* mux */
651+
BIT(31), /* gate */
652+
CLK_SET_RATE_PARENT);
653+
static SUNXI_CCU_MUX_WITH_GATE(tcon_lcd1_clk, "tcon-lcd1",
654+
tcon_tv_parents, 0xb64,
655+
24, 3, /* mux */
656+
BIT(31), /* gate */
657+
CLK_SET_RATE_PARENT);
658+
static SUNXI_CCU_GATE(bus_tcon_lcd0_clk, "bus-tcon-lcd0", "ahb3",
659+
0xb7c, BIT(0), 0);
660+
static SUNXI_CCU_GATE(bus_tcon_lcd1_clk, "bus-tcon-lcd1", "ahb3",
661+
0xb7c, BIT(1), 0);
648662
static SUNXI_CCU_MP_WITH_MUX_GATE(tcon_tv0_clk, "tcon-tv0",
649663
tcon_tv_parents, 0xb80,
650664
0, 4, /* M */
@@ -855,8 +869,12 @@ static struct ccu_common *sun50i_h616_ccu_clks[] = {
855869
&hdmi_cec_clk.common,
856870
&bus_hdmi_clk.common,
857871
&bus_tcon_top_clk.common,
872+
&tcon_lcd0_clk.common,
873+
&tcon_lcd1_clk.common,
858874
&tcon_tv0_clk.common,
859875
&tcon_tv1_clk.common,
876+
&bus_tcon_lcd0_clk.common,
877+
&bus_tcon_lcd1_clk.common,
860878
&bus_tcon_tv0_clk.common,
861879
&bus_tcon_tv1_clk.common,
862880
&tve0_clk.common,
@@ -989,8 +1007,12 @@ static struct clk_hw_onecell_data sun50i_h616_hw_clks = {
9891007
[CLK_HDMI_CEC] = &hdmi_cec_clk.common.hw,
9901008
[CLK_BUS_HDMI] = &bus_hdmi_clk.common.hw,
9911009
[CLK_BUS_TCON_TOP] = &bus_tcon_top_clk.common.hw,
1010+
[CLK_TCON_LCD0] = &tcon_lcd0_clk.common.hw,
1011+
[CLK_TCON_LCD1] = &tcon_lcd1_clk.common.hw,
9921012
[CLK_TCON_TV0] = &tcon_tv0_clk.common.hw,
9931013
[CLK_TCON_TV1] = &tcon_tv1_clk.common.hw,
1014+
[CLK_BUS_TCON_LCD0] = &bus_tcon_lcd0_clk.common.hw,
1015+
[CLK_BUS_TCON_LCD1] = &bus_tcon_lcd1_clk.common.hw,
9941016
[CLK_BUS_TCON_TV0] = &bus_tcon_tv0_clk.common.hw,
9951017
[CLK_BUS_TCON_TV1] = &bus_tcon_tv1_clk.common.hw,
9961018
[CLK_TVE0] = &tve0_clk.common.hw,
@@ -1062,6 +1084,8 @@ static const struct ccu_reset_map sun50i_h616_ccu_resets[] = {
10621084
[RST_BUS_HDMI] = { 0xb1c, BIT(16) },
10631085
[RST_BUS_HDMI_SUB] = { 0xb1c, BIT(17) },
10641086
[RST_BUS_TCON_TOP] = { 0xb5c, BIT(16) },
1087+
[RST_BUS_TCON_LCD0] = { 0xb7c, BIT(16) },
1088+
[RST_BUS_TCON_LCD1] = { 0xb7c, BIT(17) },
10651089
[RST_BUS_TCON_TV0] = { 0xb9c, BIT(16) },
10661090
[RST_BUS_TCON_TV1] = { 0xb9c, BIT(17) },
10671091
[RST_BUS_TVE_TOP] = { 0xbbc, BIT(16) },

drivers/clk/sunxi-ng/ccu-sun50i-h616.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@
5151

5252
#define CLK_BUS_DRAM 56
5353

54-
#define CLK_NUMBER (CLK_BUS_GPADC + 1)
54+
#define CLK_NUMBER (CLK_BUS_TCON_LCD1 + 1)
5555

5656
#endif /* _CCU_SUN50I_H616_H_ */

0 commit comments

Comments
 (0)