diff options
author | Magnus Damm <damm@opensource.se> | 2010-05-20 10:45:03 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-05-22 04:22:56 -0400 |
commit | 83ca5c87cb4bac32f8e0cf7f0c640bfcf310bb5d (patch) | |
tree | 7f7c9b1940670f67cdbfe3c74d303275ec0dc5bf | |
parent | 33c9607acf159da986c85983e1b58b739bcb46c2 (diff) |
ARM: mach-shmobile: sh7372 clock fixes
Fixes for the sh7372 clock framework:
- remove unused #include <linux/platform_device.h>
- add sh7372 prefix to user modifiable root clocks
- put modifiable root clock prototypes in header file
- fix off-by-one id error on VEU MSTP clocks
- make arrays static
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/arm/mach-shmobile/clock-sh7372.c | 33 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/common.h | 4 |
2 files changed, 19 insertions, 18 deletions
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c index ac46b4bce522..023de5e5a33c 100644 --- a/arch/arm/mach-shmobile/clock-sh7372.c +++ b/arch/arm/mach-shmobile/clock-sh7372.c | |||
@@ -18,7 +18,6 @@ | |||
18 | */ | 18 | */ |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/kernel.h> | 20 | #include <linux/kernel.h> |
21 | #include <linux/platform_device.h> | ||
22 | #include <linux/io.h> | 21 | #include <linux/io.h> |
23 | #include <linux/sh_clk.h> | 22 | #include <linux/sh_clk.h> |
24 | #include <mach/common.h> | 23 | #include <mach/common.h> |
@@ -60,7 +59,7 @@ static struct clk r_clk = { | |||
60 | * 26MHz default rate for the EXTAL1 root input clock. | 59 | * 26MHz default rate for the EXTAL1 root input clock. |
61 | * If needed, reset this with clk_set_rate() from the platform code. | 60 | * If needed, reset this with clk_set_rate() from the platform code. |
62 | */ | 61 | */ |
63 | struct clk extal1_clk = { | 62 | struct clk sh7372_extal1_clk = { |
64 | .rate = 26666666, | 63 | .rate = 26666666, |
65 | }; | 64 | }; |
66 | 65 | ||
@@ -68,7 +67,7 @@ struct clk extal1_clk = { | |||
68 | * 48MHz default rate for the EXTAL2 root input clock. | 67 | * 48MHz default rate for the EXTAL2 root input clock. |
69 | * If needed, reset this with clk_set_rate() from the platform code. | 68 | * If needed, reset this with clk_set_rate() from the platform code. |
70 | */ | 69 | */ |
71 | struct clk extal2_clk = { | 70 | struct clk sh7372_extal2_clk = { |
72 | .rate = 48000000, | 71 | .rate = 48000000, |
73 | }; | 72 | }; |
74 | 73 | ||
@@ -85,13 +84,13 @@ static struct clk_ops div2_clk_ops = { | |||
85 | /* Divide extal1 by two */ | 84 | /* Divide extal1 by two */ |
86 | static struct clk extal1_div2_clk = { | 85 | static struct clk extal1_div2_clk = { |
87 | .ops = &div2_clk_ops, | 86 | .ops = &div2_clk_ops, |
88 | .parent = &extal1_clk, | 87 | .parent = &sh7372_extal1_clk, |
89 | }; | 88 | }; |
90 | 89 | ||
91 | /* Divide extal2 by two */ | 90 | /* Divide extal2 by two */ |
92 | static struct clk extal2_div2_clk = { | 91 | static struct clk extal2_div2_clk = { |
93 | .ops = &div2_clk_ops, | 92 | .ops = &div2_clk_ops, |
94 | .parent = &extal2_clk, | 93 | .parent = &sh7372_extal2_clk, |
95 | }; | 94 | }; |
96 | 95 | ||
97 | /* Divide extal2 by four */ | 96 | /* Divide extal2 by four */ |
@@ -156,10 +155,10 @@ static struct clk pllc2_clk = { | |||
156 | .parent = &extal1_div2_clk, | 155 | .parent = &extal1_div2_clk, |
157 | }; | 156 | }; |
158 | 157 | ||
159 | struct clk *main_clks[] = { | 158 | static struct clk *main_clks[] = { |
160 | &r_clk, | 159 | &r_clk, |
161 | &extal1_clk, | 160 | &sh7372_extal1_clk, |
162 | &extal2_clk, | 161 | &sh7372_extal2_clk, |
163 | &extal1_div2_clk, | 162 | &extal1_div2_clk, |
164 | &extal2_div2_clk, | 163 | &extal2_div2_clk, |
165 | &extal2_div4_clk, | 164 | &extal2_div4_clk, |
@@ -200,7 +199,7 @@ enum { DIV4_I, DIV4_ZG, DIV4_B, DIV4_M1, DIV4_CSIR, | |||
200 | #define DIV4(_reg, _bit, _mask, _flags) \ | 199 | #define DIV4(_reg, _bit, _mask, _flags) \ |
201 | SH_CLK_DIV4(&pllc1_clk, _reg, _bit, _mask, _flags) | 200 | SH_CLK_DIV4(&pllc1_clk, _reg, _bit, _mask, _flags) |
202 | 201 | ||
203 | struct clk div4_clks[DIV4_NR] = { | 202 | static struct clk div4_clks[DIV4_NR] = { |
204 | [DIV4_I] = DIV4(FRQCRA, 20, 0x6fff, CLK_ENABLE_ON_INIT), | 203 | [DIV4_I] = DIV4(FRQCRA, 20, 0x6fff, CLK_ENABLE_ON_INIT), |
205 | [DIV4_ZG] = DIV4(FRQCRA, 16, 0x6fff, CLK_ENABLE_ON_INIT), | 204 | [DIV4_ZG] = DIV4(FRQCRA, 16, 0x6fff, CLK_ENABLE_ON_INIT), |
206 | [DIV4_B] = DIV4(FRQCRA, 8, 0x6fff, CLK_ENABLE_ON_INIT), | 205 | [DIV4_B] = DIV4(FRQCRA, 8, 0x6fff, CLK_ENABLE_ON_INIT), |
@@ -223,7 +222,7 @@ enum { DIV6_VCK1, DIV6_VCK2, DIV6_VCK3, DIV6_FMSI, DIV6_FMSO, | |||
223 | DIV6_VOU, DIV6_HDMI, DIV6_DSIT, DIV6_DSI0P, DIV6_DSI1P, | 222 | DIV6_VOU, DIV6_HDMI, DIV6_DSIT, DIV6_DSI0P, DIV6_DSI1P, |
224 | DIV6_NR }; | 223 | DIV6_NR }; |
225 | 224 | ||
226 | struct clk div6_clks[DIV6_NR] = { | 225 | static struct clk div6_clks[DIV6_NR] = { |
227 | [DIV6_VCK1] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR1, 0), | 226 | [DIV6_VCK1] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR1, 0), |
228 | [DIV6_VCK2] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR2, 0), | 227 | [DIV6_VCK2] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR2, 0), |
229 | [DIV6_VCK3] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR3, 0), | 228 | [DIV6_VCK3] = SH_CLK_DIV6(&pllc1_div2_clk, VCLKCR3, 0), |
@@ -231,7 +230,7 @@ struct clk div6_clks[DIV6_NR] = { | |||
231 | [DIV6_FMSO] = SH_CLK_DIV6(&pllc1_div2_clk, FMSOCKCR, 0), | 230 | [DIV6_FMSO] = SH_CLK_DIV6(&pllc1_div2_clk, FMSOCKCR, 0), |
232 | [DIV6_FSIA] = SH_CLK_DIV6(&pllc1_div2_clk, FSIACKCR, 0), | 231 | [DIV6_FSIA] = SH_CLK_DIV6(&pllc1_div2_clk, FSIACKCR, 0), |
233 | [DIV6_FSIB] = SH_CLK_DIV6(&pllc1_div2_clk, FSIBCKCR, 0), | 232 | [DIV6_FSIB] = SH_CLK_DIV6(&pllc1_div2_clk, FSIBCKCR, 0), |
234 | [DIV6_SUB] = SH_CLK_DIV6(&extal2_clk, SUBCKCR, 0), | 233 | [DIV6_SUB] = SH_CLK_DIV6(&sh7372_extal2_clk, SUBCKCR, 0), |
235 | [DIV6_SPU] = SH_CLK_DIV6(&pllc1_div2_clk, SPUCKCR, 0), | 234 | [DIV6_SPU] = SH_CLK_DIV6(&pllc1_div2_clk, SPUCKCR, 0), |
236 | [DIV6_VOU] = SH_CLK_DIV6(&pllc1_div2_clk, VOUCKCR, 0), | 235 | [DIV6_VOU] = SH_CLK_DIV6(&pllc1_div2_clk, VOUCKCR, 0), |
237 | [DIV6_HDMI] = SH_CLK_DIV6(&pllc1_div2_clk, HDMICKCR, 0), | 236 | [DIV6_HDMI] = SH_CLK_DIV6(&pllc1_div2_clk, HDMICKCR, 0), |
@@ -286,8 +285,8 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
286 | static struct clk_lookup lookups[] = { | 285 | static struct clk_lookup lookups[] = { |
287 | /* main clocks */ | 286 | /* main clocks */ |
288 | CLKDEV_CON_ID("r_clk", &r_clk), | 287 | CLKDEV_CON_ID("r_clk", &r_clk), |
289 | CLKDEV_CON_ID("extal1", &extal1_clk), | 288 | CLKDEV_CON_ID("extal1", &sh7372_extal1_clk), |
290 | CLKDEV_CON_ID("extal2", &extal2_clk), | 289 | CLKDEV_CON_ID("extal2", &sh7372_extal2_clk), |
291 | CLKDEV_CON_ID("extal1_div2_clk", &extal1_div2_clk), | 290 | CLKDEV_CON_ID("extal1_div2_clk", &extal1_div2_clk), |
292 | CLKDEV_CON_ID("extal2_div2_clk", &extal2_div2_clk), | 291 | CLKDEV_CON_ID("extal2_div2_clk", &extal2_div2_clk), |
293 | CLKDEV_CON_ID("extal2_div4_clk", &extal2_div4_clk), | 292 | CLKDEV_CON_ID("extal2_div4_clk", &extal2_div4_clk), |
@@ -331,10 +330,10 @@ static struct clk_lookup lookups[] = { | |||
331 | 330 | ||
332 | /* MSTP32 clocks */ | 331 | /* MSTP32 clocks */ |
333 | CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */ | 332 | CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */ |
334 | CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[MSTP131]), /* VEU3 */ | 333 | CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[MSTP131]), /* VEU3 */ |
335 | CLKDEV_DEV_ID("uio_pdrv_genirq.2", &mstp_clks[MSTP130]), /* VEU2 */ | 334 | CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[MSTP130]), /* VEU2 */ |
336 | CLKDEV_DEV_ID("uio_pdrv_genirq.1", &mstp_clks[MSTP129]), /* VEU1 */ | 335 | CLKDEV_DEV_ID("uio_pdrv_genirq.2", &mstp_clks[MSTP129]), /* VEU1 */ |
337 | CLKDEV_DEV_ID("uio_pdrv_genirq.0", &mstp_clks[MSTP128]), /* VEU0 */ | 336 | CLKDEV_DEV_ID("uio_pdrv_genirq.1", &mstp_clks[MSTP128]), /* VEU0 */ |
338 | CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* IIC0 */ | 337 | CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* IIC0 */ |
339 | CLKDEV_DEV_ID("uio_pdrv_genirq.5", &mstp_clks[MSTP106]), /* JPU */ | 338 | CLKDEV_DEV_ID("uio_pdrv_genirq.5", &mstp_clks[MSTP106]), /* JPU */ |
340 | CLKDEV_DEV_ID("uio_pdrv_genirq.0", &mstp_clks[MSTP101]), /* VPU */ | 339 | CLKDEV_DEV_ID("uio_pdrv_genirq.0", &mstp_clks[MSTP101]), /* VPU */ |
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h index 780bd65140da..38e9a2d275f0 100644 --- a/arch/arm/mach-shmobile/include/mach/common.h +++ b/arch/arm/mach-shmobile/include/mach/common.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | extern struct sys_timer shmobile_timer; | 4 | extern struct sys_timer shmobile_timer; |
5 | extern void shmobile_setup_console(void); | 5 | extern void shmobile_setup_console(void); |
6 | 6 | struct clk; | |
7 | extern int clk_init(void); | 7 | extern int clk_init(void); |
8 | 8 | ||
9 | extern void sh7367_init_irq(void); | 9 | extern void sh7367_init_irq(void); |
@@ -22,5 +22,7 @@ extern void sh7372_add_early_devices(void); | |||
22 | extern void sh7372_add_standard_devices(void); | 22 | extern void sh7372_add_standard_devices(void); |
23 | extern void sh7372_clock_init(void); | 23 | extern void sh7372_clock_init(void); |
24 | extern void sh7372_pinmux_init(void); | 24 | extern void sh7372_pinmux_init(void); |
25 | extern struct clk sh7372_extal1_clk; | ||
26 | extern struct clk sh7372_extal2_clk; | ||
25 | 27 | ||
26 | #endif /* __ARCH_MACH_COMMON_H */ | 28 | #endif /* __ARCH_MACH_COMMON_H */ |