aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/clock-r8a7779.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-12-20 03:53:52 -0500
committerPaul Mundt <lethal@linux-sh.org>2012-01-08 20:24:16 -0500
commit916b1f8c81ea563611288d1a9b082df3f723e4fe (patch)
treed83ab92f45c87d35c65c9f252ec69daa09fa4341 /arch/arm/mach-shmobile/clock-r8a7779.c
parentb5813c73860687ccc634d463416c377fc96b257e (diff)
ARM: mach-shmobile: clock-r8a7779: clkz/clkzs support
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile/clock-r8a7779.c')
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7779.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index 29c33063dc92..b4b0e8cd096d 100644
--- a/arch/arm/mach-shmobile/clock-r8a7779.c
+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -102,9 +102,35 @@ static struct clk mstp_clks[MSTP_NR] = {
102 [MSTP014] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 14, 0), /* TMU2 */ 102 [MSTP014] = SH_CLK_MSTP32(&div4_clks[DIV4_P], MSTPCR0, 14, 0), /* TMU2 */
103}; 103};
104 104
105static unsigned long mul4_recalc(struct clk *clk)
106{
107 return clk->parent->rate * 4;
108}
109
110static struct clk_ops mul4_clk_ops = {
111 .recalc = mul4_recalc,
112};
113
114struct clk clkz_clk = {
115 .ops = &mul4_clk_ops,
116 .parent = &div4_clks[DIV4_S],
117};
118
119struct clk clkzs_clk = {
120 /* clks x 4 / 4 = clks */
121 .parent = &div4_clks[DIV4_S],
122};
123
124static struct clk *late_main_clks[] = {
125 &clkz_clk,
126 &clkzs_clk,
127};
128
105static struct clk_lookup lookups[] = { 129static struct clk_lookup lookups[] = {
106 /* main clocks */ 130 /* main clocks */
107 CLKDEV_CON_ID("plla_clk", &plla_clk), 131 CLKDEV_CON_ID("plla_clk", &plla_clk),
132 CLKDEV_CON_ID("clkz_clk", &clkz_clk),
133 CLKDEV_CON_ID("clkzs_clk", &clkzs_clk),
108 134
109 /* DIV4 clocks */ 135 /* DIV4 clocks */
110 CLKDEV_CON_ID("shyway_clk", &div4_clks[DIV4_S]), 136 CLKDEV_CON_ID("shyway_clk", &div4_clks[DIV4_S]),
@@ -138,6 +164,9 @@ void __init r8a7779_clock_init(void)
138 if (!ret) 164 if (!ret)
139 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR); 165 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
140 166
167 for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++)
168 ret = clk_register(late_main_clks[k]);
169
141 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 170 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
142 171
143 if (!ret) 172 if (!ret)