aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/ingenic/jz4780-cgu.c
diff options
context:
space:
mode:
author周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com>2020-07-25 13:11:36 +0800
committerStephen Boyd <sboyd@kernel.org>2020-07-27 18:17:52 -0700
commit82df5b7329aaeb21b3e8fc86fa2d62a3d68602aa (patch)
tree1691bee97f203a4f045d13376f2aadc2274f26b6 /drivers/clk/ingenic/jz4780-cgu.c
parentdt-bindings: clock: Add tabs to align code. (diff)
downloadlinux-dev-82df5b7329aaeb21b3e8fc86fa2d62a3d68602aa.tar.xz
linux-dev-82df5b7329aaeb21b3e8fc86fa2d62a3d68602aa.zip
clk: Ingenic: Add RTC related clocks for Ingenic SoCs.
The RTC unit in the Ingenic SoCs has two clock sources, one is from an external 32.768kHz clock, and the other is from an external 24MHz/48MHz main clock that is divided by 512. The choice of these two clocks is controlled by the ERCS bit in the OPCR register. The RNG unit will also use this clock. Tested-by: 周正 (Zhou Zheng) <sernia.zhou@foxmail.com> Signed-off-by: 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com> Link: https://lore.kernel.org/r/20200725051136.58220-4-zhouyanjie@wanyeetech.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/ingenic/jz4780-cgu.c')
-rw-r--r--drivers/clk/ingenic/jz4780-cgu.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/clk/ingenic/jz4780-cgu.c b/drivers/clk/ingenic/jz4780-cgu.c
index 6c5b8029cc8a..288e9694285b 100644
--- a/drivers/clk/ingenic/jz4780-cgu.c
+++ b/drivers/clk/ingenic/jz4780-cgu.c
@@ -516,6 +516,18 @@ static const struct ingenic_cgu_clk_info jz4780_cgu_clocks[] = {
.gate = { CGU_REG_CLKGR0, 1 },
},
+ [JZ4780_CLK_EXCLK_DIV512] = {
+ "exclk_div512", CGU_CLK_FIXDIV,
+ .parents = { JZ4780_CLK_EXCLK },
+ .fixdiv = { 512 },
+ },
+
+ [JZ4780_CLK_RTC] = {
+ "rtc_ercs", CGU_CLK_MUX | CGU_CLK_GATE,
+ .parents = { JZ4780_CLK_EXCLK_DIV512, JZ4780_CLK_RTCLK },
+ .mux = { CGU_REG_OPCR, 2, 1},
+ },
+
/* Gate-only clocks */
[JZ4780_CLK_NEMC] = {