diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2011-12-06 01:28:18 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-12-06 01:58:03 -0500 |
commit | 171f1bc77c2d34308392841bcffa69b8a22c2e09 (patch) | |
tree | 501353916fc59f6cad5b9b547c5c3abb810314a7 /arch/sh/kernel/cpu/sh4a | |
parent | 7e28c7bb377d8f46c46e79e2b18f0297e7bb4940 (diff) |
sh: clkfwk: clock-sh7724: all div6_clks use SH_CLK_DIV6_EXT()
Current div6 clocks can specify their current parent clocks
from its register value if it is registered
by sh_clk_div6_reparent_register().
This patch modifies all div6 clocks into SH_CLK_DIV6_EXT().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a')
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/clock-sh7724.c | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c index 77118387f1cf..9ee4b3667ddf 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c | |||
@@ -111,13 +111,16 @@ static struct clk div3_clk = { | |||
111 | .parent = &pll_clk, | 111 | .parent = &pll_clk, |
112 | }; | 112 | }; |
113 | 113 | ||
114 | /* External input clock (pin name: FSIMCKA/FSIMCKB ) */ | 114 | /* External input clock (pin name: FSIMCKA/FSIMCKB/DV_CLKI ) */ |
115 | struct clk sh7724_fsimcka_clk = { | 115 | struct clk sh7724_fsimcka_clk = { |
116 | }; | 116 | }; |
117 | 117 | ||
118 | struct clk sh7724_fsimckb_clk = { | 118 | struct clk sh7724_fsimckb_clk = { |
119 | }; | 119 | }; |
120 | 120 | ||
121 | struct clk sh7724_dv_clki = { | ||
122 | }; | ||
123 | |||
121 | static struct clk *main_clks[] = { | 124 | static struct clk *main_clks[] = { |
122 | &r_clk, | 125 | &r_clk, |
123 | &extal_clk, | 126 | &extal_clk, |
@@ -126,6 +129,7 @@ static struct clk *main_clks[] = { | |||
126 | &div3_clk, | 129 | &div3_clk, |
127 | &sh7724_fsimcka_clk, | 130 | &sh7724_fsimcka_clk, |
128 | &sh7724_fsimckb_clk, | 131 | &sh7724_fsimckb_clk, |
132 | &sh7724_dv_clki, | ||
129 | }; | 133 | }; |
130 | 134 | ||
131 | static void div4_kick(struct clk *clk) | 135 | static void div4_kick(struct clk *clk) |
@@ -163,17 +167,20 @@ struct clk div4_clks[DIV4_NR] = { | |||
163 | [DIV4_M1] = DIV4(FRQCRB, 4, 0x2f7c, CLK_ENABLE_ON_INIT), | 167 | [DIV4_M1] = DIV4(FRQCRB, 4, 0x2f7c, CLK_ENABLE_ON_INIT), |
164 | }; | 168 | }; |
165 | 169 | ||
166 | enum { DIV6_V, DIV6_I, DIV6_S, DIV6_NR }; | 170 | enum { DIV6_V, DIV6_I, DIV6_S, DIV6_FA, DIV6_FB, DIV6_NR }; |
167 | 171 | ||
168 | static struct clk div6_clks[DIV6_NR] = { | 172 | /* Indices are important - they are the actual src selecting values */ |
169 | [DIV6_V] = SH_CLK_DIV6(&div3_clk, VCLKCR, 0), | 173 | static struct clk *common_parent[] = { |
170 | [DIV6_I] = SH_CLK_DIV6(&div3_clk, IRDACLKCR, 0), | 174 | [0] = &div3_clk, |
171 | [DIV6_S] = SH_CLK_DIV6(&div3_clk, SPUCLKCR, CLK_ENABLE_ON_INIT), | 175 | [1] = NULL, |
172 | }; | 176 | }; |
173 | 177 | ||
174 | enum { DIV6_FA, DIV6_FB, DIV6_REPARENT_NR }; | 178 | static struct clk *vclkcr_parent[8] = { |
179 | [0] = &div3_clk, | ||
180 | [2] = &sh7724_dv_clki, | ||
181 | [4] = &extal_clk, | ||
182 | }; | ||
175 | 183 | ||
176 | /* Indices are important - they are the actual src selecting values */ | ||
177 | static struct clk *fclkacr_parent[] = { | 184 | static struct clk *fclkacr_parent[] = { |
178 | [0] = &div3_clk, | 185 | [0] = &div3_clk, |
179 | [1] = NULL, | 186 | [1] = NULL, |
@@ -188,7 +195,13 @@ static struct clk *fclkbcr_parent[] = { | |||
188 | [3] = NULL, | 195 | [3] = NULL, |
189 | }; | 196 | }; |
190 | 197 | ||
191 | static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = { | 198 | static struct clk div6_clks[DIV6_NR] = { |
199 | [DIV6_V] = SH_CLK_DIV6_EXT(VCLKCR, 0, | ||
200 | vclkcr_parent, ARRAY_SIZE(vclkcr_parent), 12, 3), | ||
201 | [DIV6_I] = SH_CLK_DIV6_EXT(IRDACLKCR, 0, | ||
202 | common_parent, ARRAY_SIZE(common_parent), 6, 1), | ||
203 | [DIV6_S] = SH_CLK_DIV6_EXT(SPUCLKCR, CLK_ENABLE_ON_INIT, | ||
204 | common_parent, ARRAY_SIZE(common_parent), 6, 1), | ||
192 | [DIV6_FA] = SH_CLK_DIV6_EXT(FCLKACR, 0, | 205 | [DIV6_FA] = SH_CLK_DIV6_EXT(FCLKACR, 0, |
193 | fclkacr_parent, ARRAY_SIZE(fclkacr_parent), 6, 2), | 206 | fclkacr_parent, ARRAY_SIZE(fclkacr_parent), 6, 2), |
194 | [DIV6_FB] = SH_CLK_DIV6_EXT(FCLKBCR, 0, | 207 | [DIV6_FB] = SH_CLK_DIV6_EXT(FCLKBCR, 0, |
@@ -269,8 +282,8 @@ static struct clk_lookup lookups[] = { | |||
269 | 282 | ||
270 | /* DIV6 clocks */ | 283 | /* DIV6 clocks */ |
271 | CLKDEV_CON_ID("video_clk", &div6_clks[DIV6_V]), | 284 | CLKDEV_CON_ID("video_clk", &div6_clks[DIV6_V]), |
272 | CLKDEV_CON_ID("fsia_clk", &div6_reparent_clks[DIV6_FA]), | 285 | CLKDEV_CON_ID("fsia_clk", &div6_clks[DIV6_FA]), |
273 | CLKDEV_CON_ID("fsib_clk", &div6_reparent_clks[DIV6_FB]), | 286 | CLKDEV_CON_ID("fsib_clk", &div6_clks[DIV6_FB]), |
274 | CLKDEV_CON_ID("irda_clk", &div6_clks[DIV6_I]), | 287 | CLKDEV_CON_ID("irda_clk", &div6_clks[DIV6_I]), |
275 | CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_S]), | 288 | CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_S]), |
276 | 289 | ||
@@ -356,10 +369,7 @@ int __init arch_clk_init(void) | |||
356 | ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); | 369 | ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table); |
357 | 370 | ||
358 | if (!ret) | 371 | if (!ret) |
359 | ret = sh_clk_div6_register(div6_clks, DIV6_NR); | 372 | ret = sh_clk_div6_reparent_register(div6_clks, DIV6_NR); |
360 | |||
361 | if (!ret) | ||
362 | ret = sh_clk_div6_reparent_register(div6_reparent_clks, DIV6_REPARENT_NR); | ||
363 | 373 | ||
364 | if (!ret) | 374 | if (!ret) |
365 | ret = sh_hwblk_clk_register(mstp_clks, HWBLK_NR); | 375 | ret = sh_hwblk_clk_register(mstp_clks, HWBLK_NR); |