diff options
author | Magnus Damm <damm@opensource.se> | 2010-02-09 03:22:30 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-02-09 04:24:31 -0500 |
commit | 801cd56e3e2c2b727399d2c50c50139b2d7c98e8 (patch) | |
tree | 61e31674f52dfe8b111c16d0e33e4794cb503208 /arch/sh | |
parent | e6f077592d1de2f6a4fc760e7b5d6f20b37d3a27 (diff) |
sh: break out enable/reparent div4 clocks on sh7723
Break out sh7723 div4 clocks for SIU and IRDA as
reparent / enable clocks. Similar to the SIU clock
patch for sh7722 by Guennadi.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/clock-sh7723.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c index 20a31c2255a8..76731b61998e 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c | |||
@@ -117,8 +117,7 @@ static struct clk_div_mult_table div4_table = { | |||
117 | .nr_multipliers = ARRAY_SIZE(multipliers), | 117 | .nr_multipliers = ARRAY_SIZE(multipliers), |
118 | }; | 118 | }; |
119 | 119 | ||
120 | enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P, | 120 | enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P, DIV4_NR }; |
121 | DIV4_SIUA, DIV4_SIUB, DIV4_IRDA, DIV4_NR }; | ||
122 | 121 | ||
123 | #define DIV4(_str, _reg, _bit, _mask, _flags) \ | 122 | #define DIV4(_str, _reg, _bit, _mask, _flags) \ |
124 | SH_CLK_DIV4(_str, &pll_clk, _reg, _bit, _mask, _flags) | 123 | SH_CLK_DIV4(_str, &pll_clk, _reg, _bit, _mask, _flags) |
@@ -130,11 +129,20 @@ struct clk div4_clks[DIV4_NR] = { | |||
130 | [DIV4_B] = DIV4("bus_clk", FRQCR, 8, 0x0dbf, CLK_ENABLE_ON_INIT), | 129 | [DIV4_B] = DIV4("bus_clk", FRQCR, 8, 0x0dbf, CLK_ENABLE_ON_INIT), |
131 | [DIV4_B3] = DIV4("b3_clk", FRQCR, 4, 0x0db4, CLK_ENABLE_ON_INIT), | 130 | [DIV4_B3] = DIV4("b3_clk", FRQCR, 4, 0x0db4, CLK_ENABLE_ON_INIT), |
132 | [DIV4_P] = DIV4("peripheral_clk", FRQCR, 0, 0x0dbf, 0), | 131 | [DIV4_P] = DIV4("peripheral_clk", FRQCR, 0, 0x0dbf, 0), |
133 | [DIV4_SIUA] = DIV4("siua_clk", SCLKACR, 0, 0x0dbf, 0), | 132 | }; |
134 | [DIV4_SIUB] = DIV4("siub_clk", SCLKBCR, 0, 0x0dbf, 0), | 133 | |
134 | enum { DIV4_IRDA, DIV4_ENABLE_NR }; | ||
135 | |||
136 | struct clk div4_enable_clks[DIV4_ENABLE_NR] = { | ||
135 | [DIV4_IRDA] = DIV4("irda_clk", IRDACLKCR, 0, 0x0dbf, 0), | 137 | [DIV4_IRDA] = DIV4("irda_clk", IRDACLKCR, 0, 0x0dbf, 0), |
136 | }; | 138 | }; |
137 | 139 | ||
140 | enum { DIV4_SIUA, DIV4_SIUB, DIV4_REPARENT_NR }; | ||
141 | |||
142 | struct clk div4_reparent_clks[DIV4_REPARENT_NR] = { | ||
143 | [DIV4_SIUA] = DIV4("siua_clk", SCLKACR, 0, 0x0dbf, 0), | ||
144 | [DIV4_SIUB] = DIV4("siub_clk", SCLKBCR, 0, 0x0dbf, 0), | ||
145 | }; | ||
138 | struct clk div6_clks[] = { | 146 | struct clk div6_clks[] = { |
139 | SH_CLK_DIV6("video_clk", &pll_clk, VCLKCR, 0), | 147 | SH_CLK_DIV6("video_clk", &pll_clk, VCLKCR, 0), |
140 | }; | 148 | }; |
@@ -216,6 +224,14 @@ int __init arch_clk_init(void) | |||
216 | ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); | 224 | ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); |
217 | 225 | ||
218 | if (!ret) | 226 | if (!ret) |
227 | ret = sh_clk_div4_enable_register(div4_enable_clks, | ||
228 | DIV4_ENABLE_NR, &div4_table); | ||
229 | |||
230 | if (!ret) | ||
231 | ret = sh_clk_div4_reparent_register(div4_reparent_clks, | ||
232 | DIV4_REPARENT_NR, &div4_table); | ||
233 | |||
234 | if (!ret) | ||
219 | ret = sh_clk_div6_register(div6_clks, ARRAY_SIZE(div6_clks)); | 235 | ret = sh_clk_div6_register(div6_clks, ARRAY_SIZE(div6_clks)); |
220 | 236 | ||
221 | if (!ret) | 237 | if (!ret) |