aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/pxa3xx.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-11-08 15:25:21 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-11-27 07:38:23 -0500
commit8c3abc7d903df492a7394b0adae4349d9a381aaf (patch)
tree8d17cd55ec47e694332229fdc5aeafa97b5ce621 /arch/arm/mach-pxa/pxa3xx.c
parent71a06da08c1a100bba7221d140403aa7a6cdebe7 (diff)
[ARM] pxa: convert to clkdev and match clocks by struct device where possible
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa/pxa3xx.c')
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c87
1 files changed, 51 insertions, 36 deletions
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index b3cd5d0b0f35..b7e53829d376 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -216,43 +216,58 @@ static const struct clkops clk_dummy_ops = {
216 .disable = clk_dummy_disable, 216 .disable = clk_dummy_disable,
217}; 217};
218 218
219static struct clk pxa3xx_clks[] = { 219static struct clk clk_pxa3xx_pout = {
220 { 220 .ops = &clk_pout_ops,
221 .name = "CLK_POUT", 221 .rate = 13000000,
222 .ops = &clk_pout_ops, 222 .delay = 70,
223 .rate = 13000000, 223};
224 .delay = 70,
225 },
226
227 /* Power I2C clock is always on */
228 {
229 .name = "I2CCLK",
230 .ops = &clk_dummy_ops,
231 .dev = &pxa3xx_device_i2c_power.dev,
232 },
233
234 PXA3xx_CK("LCDCLK", LCD, &clk_pxa3xx_hsio_ops, &pxa_device_fb.dev),
235 PXA3xx_CK("CAMCLK", CAMERA, &clk_pxa3xx_hsio_ops, NULL),
236 PXA3xx_CK("AC97CLK", AC97, &clk_pxa3xx_ac97_ops, NULL),
237
238 PXA3xx_CKEN("UARTCLK", FFUART, 14857000, 1, &pxa_device_ffuart.dev),
239 PXA3xx_CKEN("UARTCLK", BTUART, 14857000, 1, &pxa_device_btuart.dev),
240 PXA3xx_CKEN("UARTCLK", STUART, 14857000, 1, NULL),
241
242 PXA3xx_CKEN("I2CCLK", I2C, 32842000, 0, &pxa_device_i2c.dev),
243 PXA3xx_CKEN("UDCCLK", UDC, 48000000, 5, &pxa27x_device_udc.dev),
244 PXA3xx_CKEN("USBCLK", USBH, 48000000, 0, &pxa27x_device_ohci.dev),
245 PXA3xx_CKEN("KBDCLK", KEYPAD, 32768, 0, &pxa27x_device_keypad.dev),
246 224
247 PXA3xx_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev), 225static struct clk clk_dummy = {
248 PXA3xx_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev), 226 .ops = &clk_dummy_ops,
249 PXA3xx_CKEN("SSPCLK", SSP3, 13000000, 0, &pxa27x_device_ssp3.dev), 227};
250 PXA3xx_CKEN("SSPCLK", SSP4, 13000000, 0, &pxa3xx_device_ssp4.dev),
251 PXA3xx_CKEN("PWMCLK", PWM0, 13000000, 0, &pxa27x_device_pwm0.dev),
252 PXA3xx_CKEN("PWMCLK", PWM1, 13000000, 0, &pxa27x_device_pwm1.dev),
253 228
254 PXA3xx_CKEN("MMCCLK", MMC1, 19500000, 0, &pxa_device_mci.dev), 229static DEFINE_PXA3_CK(pxa3xx_lcd, LCD, &clk_pxa3xx_hsio_ops);
255 PXA3xx_CKEN("MMCCLK", MMC2, 19500000, 0, &pxa3xx_device_mci2.dev), 230static DEFINE_PXA3_CK(pxa3xx_camera, CAMERA, &clk_pxa3xx_hsio_ops);
231static DEFINE_PXA3_CK(pxa3xx_ac97, AC97, &clk_pxa3xx_ac97_ops);
232static DEFINE_PXA3_CKEN(pxa3xx_ffuart, FFUART, 14857000, 1);
233static DEFINE_PXA3_CKEN(pxa3xx_btuart, BTUART, 14857000, 1);
234static DEFINE_PXA3_CKEN(pxa3xx_stuart, STUART, 14857000, 1);
235static DEFINE_PXA3_CKEN(pxa3xx_i2c, I2C, 32842000, 0);
236static DEFINE_PXA3_CKEN(pxa3xx_udc, UDC, 48000000, 5);
237static DEFINE_PXA3_CKEN(pxa3xx_usbh, USBH, 48000000, 0);
238static DEFINE_PXA3_CKEN(pxa3xx_keypad, KEYPAD, 32768, 0);
239static DEFINE_PXA3_CKEN(pxa3xx_ssp1, SSP1, 13000000, 0);
240static DEFINE_PXA3_CKEN(pxa3xx_ssp2, SSP2, 13000000, 0);
241static DEFINE_PXA3_CKEN(pxa3xx_ssp3, SSP3, 13000000, 0);
242static DEFINE_PXA3_CKEN(pxa3xx_ssp4, SSP4, 13000000, 0);
243static DEFINE_PXA3_CKEN(pxa3xx_pwm0, PWM0, 13000000, 0);
244static DEFINE_PXA3_CKEN(pxa3xx_pwm1, PWM1, 13000000, 0);
245static DEFINE_PXA3_CKEN(pxa3xx_mmc1, MMC1, 19500000, 0);
246static DEFINE_PXA3_CKEN(pxa3xx_mmc2, MMC2, 19500000, 0);
247
248static struct clk_lookup pxa3xx_clkregs[] = {
249 INIT_CLKREG(&clk_pxa3xx_pout, NULL, "CLK_POUT"),
250 /* Power I2C clock is always on */
251 INIT_CLKREG(&clk_dummy, "pxa2xx-i2c.1", NULL),
252 INIT_CLKREG(&clk_pxa3xx_lcd, "pxa2xx-fb", NULL),
253 INIT_CLKREG(&clk_pxa3xx_camera, NULL, "CAMCLK"),
254 INIT_CLKREG(&clk_pxa3xx_ac97, NULL, "AC97CLK"),
255 INIT_CLKREG(&clk_pxa3xx_ffuart, "pxa2xx-uart.0", NULL),
256 INIT_CLKREG(&clk_pxa3xx_btuart, "pxa2xx-uart.1", NULL),
257 INIT_CLKREG(&clk_pxa3xx_stuart, "pxa2xx-uart.2", NULL),
258 INIT_CLKREG(&clk_pxa3xx_stuart, "pxa2xx-ir", "UARTCLK"),
259 INIT_CLKREG(&clk_pxa3xx_i2c, "pxa2xx-i2c.0", NULL),
260 INIT_CLKREG(&clk_pxa3xx_udc, "pxa27x-udc", NULL),
261 INIT_CLKREG(&clk_pxa3xx_usbh, "pxa27x-ohci", NULL),
262 INIT_CLKREG(&clk_pxa3xx_keypad, "pxa27x-keypad", NULL),
263 INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa27x-ssp.0", NULL),
264 INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa27x-ssp.1", NULL),
265 INIT_CLKREG(&clk_pxa3xx_ssp3, "pxa27x-ssp.2", NULL),
266 INIT_CLKREG(&clk_pxa3xx_ssp4, "pxa27x-ssp.3", NULL),
267 INIT_CLKREG(&clk_pxa3xx_pwm0, "pxa27x-pwm.0", NULL),
268 INIT_CLKREG(&clk_pxa3xx_pwm1, "pxa27x-pwm.1", NULL),
269 INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL),
270 INIT_CLKREG(&clk_pxa3xx_mmc2, "pxa2xx-mci.1", NULL),
256}; 271};
257 272
258#ifdef CONFIG_PM 273#ifdef CONFIG_PM
@@ -595,7 +610,7 @@ static int __init pxa3xx_init(void)
595 */ 610 */
596 ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S); 611 ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S);
597 612
598 clks_register(pxa3xx_clks, ARRAY_SIZE(pxa3xx_clks)); 613 clks_register(pxa3xx_clkregs, ARRAY_SIZE(pxa3xx_clkregs));
599 614
600 if ((ret = pxa_init_dma(32))) 615 if ((ret = pxa_init_dma(32)))
601 return ret; 616 return ret;