Skip to content

Commit 0594058

Browse files
committed
Merge tag 'sunxi-clk-for-5.19-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-allwinner
Pull Allwinner clk driver updates from Jernej Skrabec: - Allwinner H6 RTC clock - Allwinner H616 32 kHz clock * tag 'sunxi-clk-for-5.19-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: clk: sunxi-ng: h616: Add PLL derived 32KHz clock clk: sunxi-ng: h6-r: Add RTC gate clock
2 parents 3123109 + 31ab516 commit 0594058

6 files changed

Lines changed: 17 additions & 2 deletions

File tree

drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ static SUNXI_CCU_GATE(r_apb1_ir_clk, "r-apb1-ir", "r-apb1",
9898
0x1cc, BIT(0), 0);
9999
static SUNXI_CCU_GATE(r_apb1_w1_clk, "r-apb1-w1", "r-apb1",
100100
0x1ec, BIT(0), 0);
101+
static SUNXI_CCU_GATE(r_apb1_rtc_clk, "r-apb1-rtc", "r-apb1",
102+
0x20c, BIT(0), CLK_IGNORE_UNUSED);
101103

102104
/* Information of IR(RX) mod clock is gathered from BSP source code */
103105
static const char * const r_mod0_default_parents[] = { "osc32k", "osc24M" };
@@ -147,6 +149,7 @@ static struct ccu_common *sun50i_h616_r_ccu_clks[] = {
147149
&r_apb2_i2c_clk.common,
148150
&r_apb2_rsb_clk.common,
149151
&r_apb1_ir_clk.common,
152+
&r_apb1_rtc_clk.common,
150153
&ir_clk.common,
151154
};
152155

@@ -164,6 +167,7 @@ static struct clk_hw_onecell_data sun50i_h6_r_hw_clks = {
164167
[CLK_R_APB2_RSB] = &r_apb2_rsb_clk.common.hw,
165168
[CLK_R_APB1_IR] = &r_apb1_ir_clk.common.hw,
166169
[CLK_R_APB1_W1] = &r_apb1_w1_clk.common.hw,
170+
[CLK_R_APB1_RTC] = &r_apb1_rtc_clk.common.hw,
167171
[CLK_IR] = &ir_clk.common.hw,
168172
[CLK_W1] = &w1_clk.common.hw,
169173
},
@@ -179,6 +183,7 @@ static struct clk_hw_onecell_data sun50i_h616_r_hw_clks = {
179183
[CLK_R_APB2_I2C] = &r_apb2_i2c_clk.common.hw,
180184
[CLK_R_APB2_RSB] = &r_apb2_rsb_clk.common.hw,
181185
[CLK_R_APB1_IR] = &r_apb1_ir_clk.common.hw,
186+
[CLK_R_APB1_RTC] = &r_apb1_rtc_clk.common.hw,
182187
[CLK_IR] = &ir_clk.common.hw,
183188
},
184189
.num = CLK_NUMBER,

drivers/clk/sunxi-ng/ccu-sun50i-h6-r.h

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

1515
#define CLK_R_APB2 3
1616

17-
#define CLK_NUMBER (CLK_R_APB2_RSB + 1)
17+
#define CLK_NUMBER (CLK_R_APB1_RTC + 1)
1818

1919
#endif /* _CCU_SUN50I_H6_R_H */

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,13 @@ static CLK_FIXED_FACTOR_HWS(pll_periph0_2x_clk, "pll-periph0-2x",
704704
pll_periph0_parents,
705705
1, 2, 0);
706706

707+
static const struct clk_hw *pll_periph0_2x_hws[] = {
708+
&pll_periph0_2x_clk.hw
709+
};
710+
711+
static CLK_FIXED_FACTOR_HWS(pll_system_32k_clk, "pll-system-32k",
712+
pll_periph0_2x_hws, 36621, 1, 0);
713+
707714
static const struct clk_hw *pll_periph1_parents[] = {
708715
&pll_periph1_clk.common.hw
709716
};
@@ -852,6 +859,7 @@ static struct clk_hw_onecell_data sun50i_h616_hw_clks = {
852859
[CLK_PLL_DDR1] = &pll_ddr1_clk.common.hw,
853860
[CLK_PLL_PERIPH0] = &pll_periph0_clk.common.hw,
854861
[CLK_PLL_PERIPH0_2X] = &pll_periph0_2x_clk.hw,
862+
[CLK_PLL_SYSTEM_32K] = &pll_system_32k_clk.hw,
855863
[CLK_PLL_PERIPH1] = &pll_periph1_clk.common.hw,
856864
[CLK_PLL_PERIPH1_2X] = &pll_periph1_2x_clk.hw,
857865
[CLK_PLL_GPU] = &pll_gpu_clk.common.hw,

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_HDCP + 1)
54+
#define CLK_NUMBER (CLK_PLL_SYSTEM_32K + 1)
5555

5656
#endif /* _CCU_SUN50I_H616_H_ */

include/dt-bindings/clock/sun50i-h6-r-ccu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
#define CLK_W1 12
2323

2424
#define CLK_R_APB2_RSB 13
25+
#define CLK_R_APB1_RTC 14
2526

2627
#endif /* _DT_BINDINGS_CLK_SUN50I_H6_R_CCU_H_ */

include/dt-bindings/clock/sun50i-h616-ccu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,6 @@
111111
#define CLK_BUS_TVE0 125
112112
#define CLK_HDCP 126
113113
#define CLK_BUS_HDCP 127
114+
#define CLK_PLL_SYSTEM_32K 128
114115

115116
#endif /* _DT_BINDINGS_CLK_SUN50I_H616_H_ */

0 commit comments

Comments
 (0)