diff options
Diffstat (limited to 'arch/arm/mach-pxa/pxa27x.c')
-rw-r--r-- | arch/arm/mach-pxa/pxa27x.c | 115 |
1 files changed, 57 insertions, 58 deletions
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 3e4ab2279c99..411bec54fdc4 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -144,40 +144,59 @@ static const struct clkops clk_pxa27x_lcd_ops = { | |||
144 | .getrate = clk_pxa27x_lcd_getrate, | 144 | .getrate = clk_pxa27x_lcd_getrate, |
145 | }; | 145 | }; |
146 | 146 | ||
147 | static struct clk pxa27x_clks[] = { | 147 | static DEFINE_CK(pxa27x_lcd, LCD, &clk_pxa27x_lcd_ops); |
148 | INIT_CK("LCDCLK", LCD, &clk_pxa27x_lcd_ops, &pxa_device_fb.dev), | 148 | static DEFINE_CK(pxa27x_camera, CAMERA, &clk_pxa27x_lcd_ops); |
149 | INIT_CK("CAMCLK", CAMERA, &clk_pxa27x_lcd_ops, NULL), | 149 | static DEFINE_CKEN(pxa27x_ffuart, FFUART, 14857000, 1); |
150 | 150 | static DEFINE_CKEN(pxa27x_btuart, BTUART, 14857000, 1); | |
151 | INIT_CKEN("UARTCLK", FFUART, 14857000, 1, &pxa_device_ffuart.dev), | 151 | static DEFINE_CKEN(pxa27x_stuart, STUART, 14857000, 1); |
152 | INIT_CKEN("UARTCLK", BTUART, 14857000, 1, &pxa_device_btuart.dev), | 152 | static DEFINE_CKEN(pxa27x_i2s, I2S, 14682000, 0); |
153 | INIT_CKEN("UARTCLK", STUART, 14857000, 1, NULL), | 153 | static DEFINE_CKEN(pxa27x_i2c, I2C, 32842000, 0); |
154 | 154 | static DEFINE_CKEN(pxa27x_usb, USB, 48000000, 5); | |
155 | INIT_CKEN("I2SCLK", I2S, 14682000, 0, &pxa_device_i2s.dev), | 155 | static DEFINE_CKEN(pxa27x_mmc, MMC, 19500000, 0); |
156 | INIT_CKEN("I2CCLK", I2C, 32842000, 0, &pxa_device_i2c.dev), | 156 | static DEFINE_CKEN(pxa27x_ficp, FICP, 48000000, 0); |
157 | INIT_CKEN("UDCCLK", USB, 48000000, 5, &pxa27x_device_udc.dev), | 157 | static DEFINE_CKEN(pxa27x_usbhost, USBHOST, 48000000, 0); |
158 | INIT_CKEN("MMCCLK", MMC, 19500000, 0, &pxa_device_mci.dev), | 158 | static DEFINE_CKEN(pxa27x_pwri2c, PWRI2C, 13000000, 0); |
159 | INIT_CKEN("FICPCLK", FICP, 48000000, 0, &pxa_device_ficp.dev), | 159 | static DEFINE_CKEN(pxa27x_keypad, KEYPAD, 32768, 0); |
160 | 160 | static DEFINE_CKEN(pxa27x_ssp1, SSP1, 13000000, 0); | |
161 | INIT_CKEN("USBCLK", USBHOST, 48000000, 0, &pxa27x_device_ohci.dev), | 161 | static DEFINE_CKEN(pxa27x_ssp2, SSP2, 13000000, 0); |
162 | INIT_CKEN("I2CCLK", PWRI2C, 13000000, 0, &pxa27x_device_i2c_power.dev), | 162 | static DEFINE_CKEN(pxa27x_ssp3, SSP3, 13000000, 0); |
163 | INIT_CKEN("KBDCLK", KEYPAD, 32768, 0, &pxa27x_device_keypad.dev), | 163 | static DEFINE_CKEN(pxa27x_pwm0, PWM0, 13000000, 0); |
164 | 164 | static DEFINE_CKEN(pxa27x_pwm1, PWM1, 13000000, 0); | |
165 | INIT_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev), | 165 | static DEFINE_CKEN(pxa27x_ac97, AC97, 24576000, 0); |
166 | INIT_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev), | 166 | static DEFINE_CKEN(pxa27x_ac97conf, AC97CONF, 24576000, 0); |
167 | INIT_CKEN("SSPCLK", SSP3, 13000000, 0, &pxa27x_device_ssp3.dev), | 167 | static DEFINE_CKEN(pxa27x_msl, MSL, 48000000, 0); |
168 | INIT_CKEN("PWMCLK", PWM0, 13000000, 0, &pxa27x_device_pwm0.dev), | 168 | static DEFINE_CKEN(pxa27x_usim, USIM, 48000000, 0); |
169 | INIT_CKEN("PWMCLK", PWM1, 13000000, 0, &pxa27x_device_pwm1.dev), | 169 | static DEFINE_CKEN(pxa27x_memstk, MEMSTK, 19500000, 0); |
170 | 170 | static DEFINE_CKEN(pxa27x_im, IM, 0, 0); | |
171 | INIT_CKEN("AC97CLK", AC97, 24576000, 0, NULL), | 171 | static DEFINE_CKEN(pxa27x_memc, MEMC, 0, 0); |
172 | INIT_CKEN("AC97CONFCLK", AC97CONF, 24576000, 0, NULL), | 172 | |
173 | 173 | static struct clk_lookup pxa27x_clkregs[] = { | |
174 | /* | 174 | INIT_CLKREG(&clk_pxa27x_lcd, "pxa2xx-fb", NULL), |
175 | INIT_CKEN("MSLCLK", MSL, 48000000, 0, NULL), | 175 | INIT_CLKREG(&clk_pxa27x_camera, "pxa27x-camera.0", NULL), |
176 | INIT_CKEN("USIMCLK", USIM, 48000000, 0, NULL), | 176 | INIT_CLKREG(&clk_pxa27x_ffuart, "pxa2xx-uart.0", NULL), |
177 | INIT_CKEN("MSTKCLK", MEMSTK, 19500000, 0, NULL), | 177 | INIT_CLKREG(&clk_pxa27x_btuart, "pxa2xx-uart.1", NULL), |
178 | INIT_CKEN("IMCLK", IM, 0, 0, NULL), | 178 | INIT_CLKREG(&clk_pxa27x_stuart, "pxa2xx-uart.2", NULL), |
179 | INIT_CKEN("MEMCLK", MEMC, 0, 0, NULL), | 179 | INIT_CLKREG(&clk_pxa27x_i2s, "pxa2xx-i2s", NULL), |
180 | */ | 180 | INIT_CLKREG(&clk_pxa27x_i2c, "pxa2xx-i2c.0", NULL), |
181 | INIT_CLKREG(&clk_pxa27x_usb, "pxa27x-udc", NULL), | ||
182 | INIT_CLKREG(&clk_pxa27x_mmc, "pxa2xx-mci.0", NULL), | ||
183 | INIT_CLKREG(&clk_pxa27x_stuart, "pxa2xx-ir", "UARTCLK"), | ||
184 | INIT_CLKREG(&clk_pxa27x_ficp, "pxa2xx-ir", "FICPCLK"), | ||
185 | INIT_CLKREG(&clk_pxa27x_usbhost, "pxa27x-ohci", NULL), | ||
186 | INIT_CLKREG(&clk_pxa27x_pwri2c, "pxa2xx-i2c.1", NULL), | ||
187 | INIT_CLKREG(&clk_pxa27x_keypad, "pxa27x-keypad", NULL), | ||
188 | INIT_CLKREG(&clk_pxa27x_ssp1, "pxa27x-ssp.0", NULL), | ||
189 | INIT_CLKREG(&clk_pxa27x_ssp2, "pxa27x-ssp.1", NULL), | ||
190 | INIT_CLKREG(&clk_pxa27x_ssp3, "pxa27x-ssp.2", NULL), | ||
191 | INIT_CLKREG(&clk_pxa27x_pwm0, "pxa27x-pwm.0", NULL), | ||
192 | INIT_CLKREG(&clk_pxa27x_pwm1, "pxa27x-pwm.1", NULL), | ||
193 | INIT_CLKREG(&clk_pxa27x_ac97, NULL, "AC97CLK"), | ||
194 | INIT_CLKREG(&clk_pxa27x_ac97conf, NULL, "AC97CONFCLK"), | ||
195 | INIT_CLKREG(&clk_pxa27x_msl, NULL, "MSLCLK"), | ||
196 | INIT_CLKREG(&clk_pxa27x_usim, NULL, "USIMCLK"), | ||
197 | INIT_CLKREG(&clk_pxa27x_memstk, NULL, "MSTKCLK"), | ||
198 | INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"), | ||
199 | INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"), | ||
181 | }; | 200 | }; |
182 | 201 | ||
183 | #ifdef CONFIG_PM | 202 | #ifdef CONFIG_PM |
@@ -313,38 +332,18 @@ static int pxa27x_set_wake(unsigned int irq, unsigned int on) | |||
313 | void __init pxa27x_init_irq(void) | 332 | void __init pxa27x_init_irq(void) |
314 | { | 333 | { |
315 | pxa_init_irq(34, pxa27x_set_wake); | 334 | pxa_init_irq(34, pxa27x_set_wake); |
316 | pxa_init_gpio(128, pxa27x_set_wake); | 335 | pxa_init_gpio(121, pxa27x_set_wake); |
317 | } | 336 | } |
318 | 337 | ||
319 | /* | 338 | /* |
320 | * device registration specific to PXA27x. | 339 | * device registration specific to PXA27x. |
321 | */ | 340 | */ |
322 | |||
323 | static struct resource i2c_power_resources[] = { | ||
324 | { | ||
325 | .start = 0x40f00180, | ||
326 | .end = 0x40f001a3, | ||
327 | .flags = IORESOURCE_MEM, | ||
328 | }, { | ||
329 | .start = IRQ_PWRI2C, | ||
330 | .end = IRQ_PWRI2C, | ||
331 | .flags = IORESOURCE_IRQ, | ||
332 | }, | ||
333 | }; | ||
334 | |||
335 | struct platform_device pxa27x_device_i2c_power = { | ||
336 | .name = "pxa2xx-i2c", | ||
337 | .id = 1, | ||
338 | .resource = i2c_power_resources, | ||
339 | .num_resources = ARRAY_SIZE(i2c_power_resources), | ||
340 | }; | ||
341 | |||
342 | void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info) | 341 | void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info) |
343 | { | 342 | { |
344 | local_irq_disable(); | 343 | local_irq_disable(); |
345 | PCFR |= PCFR_PI2CEN; | 344 | PCFR |= PCFR_PI2CEN; |
346 | local_irq_enable(); | 345 | local_irq_enable(); |
347 | pxa27x_device_i2c_power.dev.platform_data = info; | 346 | pxa_register_device(&pxa27x_device_i2c_power, info); |
348 | } | 347 | } |
349 | 348 | ||
350 | static struct platform_device *devices[] __initdata = { | 349 | static struct platform_device *devices[] __initdata = { |
@@ -353,8 +352,8 @@ static struct platform_device *devices[] __initdata = { | |||
353 | &pxa_device_btuart, | 352 | &pxa_device_btuart, |
354 | &pxa_device_stuart, | 353 | &pxa_device_stuart, |
355 | &pxa_device_i2s, | 354 | &pxa_device_i2s, |
355 | &sa1100_device_rtc, | ||
356 | &pxa_device_rtc, | 356 | &pxa_device_rtc, |
357 | &pxa27x_device_i2c_power, | ||
358 | &pxa27x_device_ssp1, | 357 | &pxa27x_device_ssp1, |
359 | &pxa27x_device_ssp2, | 358 | &pxa27x_device_ssp2, |
360 | &pxa27x_device_ssp3, | 359 | &pxa27x_device_ssp3, |
@@ -380,7 +379,7 @@ static int __init pxa27x_init(void) | |||
380 | 379 | ||
381 | reset_status = RCSR; | 380 | reset_status = RCSR; |
382 | 381 | ||
383 | clks_register(pxa27x_clks, ARRAY_SIZE(pxa27x_clks)); | 382 | clks_register(pxa27x_clkregs, ARRAY_SIZE(pxa27x_clkregs)); |
384 | 383 | ||
385 | if ((ret = pxa_init_dma(32))) | 384 | if ((ret = pxa_init_dma(32))) |
386 | return ret; | 385 | return ret; |