diff options
author | wanzongshun <mcuos.com@gmail.com> | 2009-07-14 10:10:43 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-07-17 08:38:17 -0400 |
commit | db58e90fdbe9d12b431ae8d8e856961ce75d74f0 (patch) | |
tree | 3367a0abc6e955ecb16cbc8f33873a015b70230c | |
parent | d2c241955095b129459985a8c02d85b70984b945 (diff) |
[ARM] 5602/1: Add sub clock api for w90p910 platform
Add sub clock api for w90p910 platform.
Signed-off-by: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-w90x900/clock.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-w90x900/clock.h | 8 | ||||
-rw-r--r-- | arch/arm/mach-w90x900/w90p910.c | 6 |
3 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-w90x900/clock.c b/arch/arm/mach-w90x900/clock.c index f420613cd395..49cf1fbc14eb 100644 --- a/arch/arm/mach-w90x900/clock.c +++ b/arch/arm/mach-w90x900/clock.c | |||
@@ -25,6 +25,8 @@ | |||
25 | 25 | ||
26 | #include "clock.h" | 26 | #include "clock.h" |
27 | 27 | ||
28 | #define SUBCLK 0x24 | ||
29 | |||
28 | static DEFINE_SPINLOCK(clocks_lock); | 30 | static DEFINE_SPINLOCK(clocks_lock); |
29 | 31 | ||
30 | int clk_enable(struct clk *clk) | 32 | int clk_enable(struct clk *clk) |
@@ -68,6 +70,22 @@ void w90x900_clk_enable(struct clk *clk, int enable) | |||
68 | __raw_writel(clken, W90X900_VA_CLKPWR); | 70 | __raw_writel(clken, W90X900_VA_CLKPWR); |
69 | } | 71 | } |
70 | 72 | ||
73 | void w90x900_subclk_enable(struct clk *clk, int enable) | ||
74 | { | ||
75 | unsigned int clocks = clk->cken; | ||
76 | unsigned long clken; | ||
77 | |||
78 | clken = __raw_readl(W90X900_VA_CLKPWR + SUBCLK); | ||
79 | |||
80 | if (enable) | ||
81 | clken |= clocks; | ||
82 | else | ||
83 | clken &= ~clocks; | ||
84 | |||
85 | __raw_writel(clken, W90X900_VA_CLKPWR + SUBCLK); | ||
86 | } | ||
87 | |||
88 | |||
71 | void clks_register(struct clk_lookup *clks, size_t num) | 89 | void clks_register(struct clk_lookup *clks, size_t num) |
72 | { | 90 | { |
73 | int i; | 91 | int i; |
diff --git a/arch/arm/mach-w90x900/clock.h b/arch/arm/mach-w90x900/clock.h index 4f27bda76d56..d2f0e50a70bf 100644 --- a/arch/arm/mach-w90x900/clock.h +++ b/arch/arm/mach-w90x900/clock.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <asm/clkdev.h> | 13 | #include <asm/clkdev.h> |
14 | 14 | ||
15 | void w90x900_clk_enable(struct clk *clk, int enable); | 15 | void w90x900_clk_enable(struct clk *clk, int enable); |
16 | void w90x900_subclk_enable(struct clk *clk, int enable); | ||
16 | void clks_register(struct clk_lookup *clks, size_t num); | 17 | void clks_register(struct clk_lookup *clks, size_t num); |
17 | 18 | ||
18 | struct clk { | 19 | struct clk { |
@@ -27,6 +28,13 @@ struct clk clk_##_name = { \ | |||
27 | .cken = (1 << _ctrlbit), \ | 28 | .cken = (1 << _ctrlbit), \ |
28 | } | 29 | } |
29 | 30 | ||
31 | #define DEFINE_SUBCLK(_name, _ctrlbit) \ | ||
32 | struct clk clk_##_name = { \ | ||
33 | .enable = w90x900_subclk_enable, \ | ||
34 | .cken = (1 << _ctrlbit), \ | ||
35 | } | ||
36 | |||
37 | |||
30 | #define DEF_CLKLOOK(_clk, _devname, _conname) \ | 38 | #define DEF_CLKLOOK(_clk, _devname, _conname) \ |
31 | { \ | 39 | { \ |
32 | .clk = _clk, \ | 40 | .clk = _clk, \ |
diff --git a/arch/arm/mach-w90x900/w90p910.c b/arch/arm/mach-w90x900/w90p910.c index 1c97e4930b7a..1bde69eac3df 100644 --- a/arch/arm/mach-w90x900/w90p910.c +++ b/arch/arm/mach-w90x900/w90p910.c | |||
@@ -57,9 +57,12 @@ static struct map_desc w90p910_iodesc[] __initdata = { | |||
57 | static DEFINE_CLK(lcd, 0); | 57 | static DEFINE_CLK(lcd, 0); |
58 | static DEFINE_CLK(audio, 1); | 58 | static DEFINE_CLK(audio, 1); |
59 | static DEFINE_CLK(fmi, 4); | 59 | static DEFINE_CLK(fmi, 4); |
60 | static DEFINE_SUBCLK(ms, 0); | ||
61 | static DEFINE_SUBCLK(sd, 1); | ||
60 | static DEFINE_CLK(dmac, 5); | 62 | static DEFINE_CLK(dmac, 5); |
61 | static DEFINE_CLK(atapi, 6); | 63 | static DEFINE_CLK(atapi, 6); |
62 | static DEFINE_CLK(emc, 7); | 64 | static DEFINE_CLK(emc, 7); |
65 | static DEFINE_SUBCLK(rmii, 2); | ||
63 | static DEFINE_CLK(usbd, 8); | 66 | static DEFINE_CLK(usbd, 8); |
64 | static DEFINE_CLK(usbh, 9); | 67 | static DEFINE_CLK(usbh, 9); |
65 | static DEFINE_CLK(g2d, 10);; | 68 | static DEFINE_CLK(g2d, 10);; |
@@ -75,9 +78,12 @@ static struct clk_lookup w90p910_clkregs[] = { | |||
75 | DEF_CLKLOOK(&clk_lcd, "w90p910-lcd", NULL), | 78 | DEF_CLKLOOK(&clk_lcd, "w90p910-lcd", NULL), |
76 | DEF_CLKLOOK(&clk_audio, "w90p910-audio", NULL), | 79 | DEF_CLKLOOK(&clk_audio, "w90p910-audio", NULL), |
77 | DEF_CLKLOOK(&clk_fmi, "w90p910-fmi", NULL), | 80 | DEF_CLKLOOK(&clk_fmi, "w90p910-fmi", NULL), |
81 | DEF_CLKLOOK(&clk_ms, "w90p910-fmi", "MS"), | ||
82 | DEF_CLKLOOK(&clk_sd, "w90p910-fmi", "SD"), | ||
78 | DEF_CLKLOOK(&clk_dmac, "w90p910-dmac", NULL), | 83 | DEF_CLKLOOK(&clk_dmac, "w90p910-dmac", NULL), |
79 | DEF_CLKLOOK(&clk_atapi, "w90p910-atapi", NULL), | 84 | DEF_CLKLOOK(&clk_atapi, "w90p910-atapi", NULL), |
80 | DEF_CLKLOOK(&clk_emc, "w90p910-emc", NULL), | 85 | DEF_CLKLOOK(&clk_emc, "w90p910-emc", NULL), |
86 | DEF_CLKLOOK(&clk_rmii, "w90p910-emc", "RMII"), | ||
81 | DEF_CLKLOOK(&clk_usbd, "w90p910-usbd", NULL), | 87 | DEF_CLKLOOK(&clk_usbd, "w90p910-usbd", NULL), |
82 | DEF_CLKLOOK(&clk_usbh, "w90p910-usbh", NULL), | 88 | DEF_CLKLOOK(&clk_usbh, "w90p910-usbh", NULL), |
83 | DEF_CLKLOOK(&clk_g2d, "w90p910-g2d", NULL), | 89 | DEF_CLKLOOK(&clk_g2d, "w90p910-g2d", NULL), |