diff options
author | Ian Molton <spyro@f2s.com> | 2008-07-08 05:32:08 -0400 |
---|---|---|
committer | Ian Molton <spyro@f2s.com> | 2008-07-10 05:28:43 -0400 |
commit | ed847782f6459a5c94aa0c9f93679f6a4176a47a (patch) | |
tree | 6a08b8a941ef60b22ab404bb5803fa23a3e30cc8 | |
parent | aa9ae8eb1a917c8794bceef0a8e6ff1f4d7c46de (diff) |
Clocklib: Provide for GPIO 12 clock on PXA
Signed-off-by: Ian Molton <spyro@f2s.com>
-rw-r--r-- | arch/arm/mach-pxa/clock.h | 9 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa25x.c | 24 |
2 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/clock.h b/arch/arm/mach-pxa/clock.h index 83cbfaba485d..32d0c074b351 100644 --- a/arch/arm/mach-pxa/clock.h +++ b/arch/arm/mach-pxa/clock.h | |||
@@ -47,6 +47,15 @@ struct clk { | |||
47 | .other = _other, \ | 47 | .other = _other, \ |
48 | } | 48 | } |
49 | 49 | ||
50 | #define INIT_CLK(_name, _ops, _rate, _delay, _dev) \ | ||
51 | { \ | ||
52 | .name = _name, \ | ||
53 | .dev = _dev, \ | ||
54 | .ops = _ops, \ | ||
55 | .rate = _rate, \ | ||
56 | .delay = _delay, \ | ||
57 | } | ||
58 | |||
50 | extern const struct clkops clk_cken_ops; | 59 | extern const struct clkops clk_cken_ops; |
51 | 60 | ||
52 | void clk_cken_enable(struct clk *clk); | 61 | void clk_cken_enable(struct clk *clk); |
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index 90b441f5df5a..034d3a6c31d8 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c | |||
@@ -109,6 +109,29 @@ static const struct clkops clk_pxa25x_lcd_ops = { | |||
109 | .getrate = clk_pxa25x_lcd_getrate, | 109 | .getrate = clk_pxa25x_lcd_getrate, |
110 | }; | 110 | }; |
111 | 111 | ||
112 | static unsigned long gpio12_config_32k[] = { | ||
113 | GPIO12_32KHz, | ||
114 | }; | ||
115 | |||
116 | static unsigned long gpio12_config_gpio[] = { | ||
117 | GPIO12_GPIO, | ||
118 | }; | ||
119 | |||
120 | static void clk_gpio12_enable(struct clk *clk) | ||
121 | { | ||
122 | pxa2xx_mfp_config(gpio12_config_32k, 1); | ||
123 | } | ||
124 | |||
125 | static void clk_gpio12_disable(struct clk *clk) | ||
126 | { | ||
127 | pxa2xx_mfp_config(gpio12_config_gpio, 1); | ||
128 | } | ||
129 | |||
130 | static const struct clkops clk_pxa25x_gpio12_ops = { | ||
131 | .enable = clk_gpio12_enable, | ||
132 | .disable = clk_gpio12_disable, | ||
133 | }; | ||
134 | |||
112 | /* | 135 | /* |
113 | * 3.6864MHz -> OST, GPIO, SSP, PWM, PLLs (95.842MHz, 147.456MHz) | 136 | * 3.6864MHz -> OST, GPIO, SSP, PWM, PLLs (95.842MHz, 147.456MHz) |
114 | * 95.842MHz -> MMC 19.169MHz, I2C 31.949MHz, FICP 47.923MHz, USB 47.923MHz | 137 | * 95.842MHz -> MMC 19.169MHz, I2C 31.949MHz, FICP 47.923MHz, USB 47.923MHz |
@@ -128,6 +151,7 @@ static struct clk pxa25x_clks[] = { | |||
128 | INIT_CKEN("UARTCLK", BTUART, 14745600, 1, &pxa_device_btuart.dev), | 151 | INIT_CKEN("UARTCLK", BTUART, 14745600, 1, &pxa_device_btuart.dev), |
129 | INIT_CKEN("UARTCLK", STUART, 14745600, 1, NULL), | 152 | INIT_CKEN("UARTCLK", STUART, 14745600, 1, NULL), |
130 | INIT_CKEN("UDCCLK", USB, 47923000, 5, &pxa25x_device_udc.dev), | 153 | INIT_CKEN("UDCCLK", USB, 47923000, 5, &pxa25x_device_udc.dev), |
154 | INIT_CLK("GPIO12_CLK", &clk_pxa25x_gpio12_ops, 32768, 0, NULL), | ||
131 | INIT_CKEN("MMCCLK", MMC, 19169000, 0, &pxa_device_mci.dev), | 155 | INIT_CKEN("MMCCLK", MMC, 19169000, 0, &pxa_device_mci.dev), |
132 | INIT_CKEN("I2CCLK", I2C, 31949000, 0, &pxa_device_i2c.dev), | 156 | INIT_CKEN("I2CCLK", I2C, 31949000, 0, &pxa_device_i2c.dev), |
133 | 157 | ||