aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorMike Rapoport <mike@compulab.co.il>2008-08-17 01:23:05 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-09-09 11:32:51 -0400
commit9ba63c4fa10cf446eff06a3200822d22b0c31c31 (patch)
treebc67d381e703aa150799f07ef85a7d7369376b72 /arch/arm
parent57a7a62eb65b35f51814382b0841ff99be242880 (diff)
[ARM] 5201/1: PXA3xx: Add support for power i2c bus
Add power I2C support for PXA3xx processors Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-pxa/devices.h1
-rw-r--r--arch/arm/mach-pxa/include/mach/i2c.h6
-rw-r--r--arch/arm/mach-pxa/pxa27x.c2
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c45
4 files changed, 52 insertions, 2 deletions
diff --git a/arch/arm/mach-pxa/devices.h b/arch/arm/mach-pxa/devices.h
index 887c738f5911..bb04af4b0aa3 100644
--- a/arch/arm/mach-pxa/devices.h
+++ b/arch/arm/mach-pxa/devices.h
@@ -32,5 +32,6 @@ extern struct platform_device pxa27x_device_pwm0;
32extern struct platform_device pxa27x_device_pwm1; 32extern struct platform_device pxa27x_device_pwm1;
33 33
34extern struct platform_device pxa3xx_device_nand; 34extern struct platform_device pxa3xx_device_nand;
35extern struct platform_device pxa3xx_device_i2c_power;
35 36
36void __init pxa_register_device(struct platform_device *dev, void *data); 37void __init pxa_register_device(struct platform_device *dev, void *data);
diff --git a/arch/arm/mach-pxa/include/mach/i2c.h b/arch/arm/mach-pxa/include/mach/i2c.h
index 80596b013443..897e71752177 100644
--- a/arch/arm/mach-pxa/include/mach/i2c.h
+++ b/arch/arm/mach-pxa/include/mach/i2c.h
@@ -71,7 +71,11 @@ struct i2c_pxa_platform_data {
71extern void pxa_set_i2c_info(struct i2c_pxa_platform_data *info); 71extern void pxa_set_i2c_info(struct i2c_pxa_platform_data *info);
72 72
73#ifdef CONFIG_PXA27x 73#ifdef CONFIG_PXA27x
74extern void pxa_set_i2c_power_info(struct i2c_pxa_platform_data *info); 74extern void pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info);
75#endif
76
77#ifdef CONFIG_PXA3xx
78extern void pxa3xx_set_i2c_power_info(struct i2c_pxa_platform_data *info);
75#endif 79#endif
76 80
77#endif 81#endif
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index f9f6a9c31f4b..c33cf6ac8c81 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -349,7 +349,7 @@ struct platform_device pxa27x_device_i2c_power = {
349 .num_resources = ARRAY_SIZE(i2c_power_resources), 349 .num_resources = ARRAY_SIZE(i2c_power_resources),
350}; 350};
351 351
352void __init pxa_set_i2c_power_info(struct i2c_pxa_platform_data *info) 352void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
353{ 353{
354 local_irq_disable(); 354 local_irq_disable();
355 PCFR |= PCFR_PI2CEN; 355 PCFR |= PCFR_PI2CEN;
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index 03cbc38103ed..b3cd5d0b0f35 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -203,6 +203,19 @@ static const struct clkops clk_pout_ops = {
203 .disable = clk_pout_disable, 203 .disable = clk_pout_disable,
204}; 204};
205 205
206static void clk_dummy_enable(struct clk *clk)
207{
208}
209
210static void clk_dummy_disable(struct clk *clk)
211{
212}
213
214static const struct clkops clk_dummy_ops = {
215 .enable = clk_dummy_enable,
216 .disable = clk_dummy_disable,
217};
218
206static struct clk pxa3xx_clks[] = { 219static struct clk pxa3xx_clks[] = {
207 { 220 {
208 .name = "CLK_POUT", 221 .name = "CLK_POUT",
@@ -211,6 +224,13 @@ static struct clk pxa3xx_clks[] = {
211 .delay = 70, 224 .delay = 70,
212 }, 225 },
213 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
214 PXA3xx_CK("LCDCLK", LCD, &clk_pxa3xx_hsio_ops, &pxa_device_fb.dev), 234 PXA3xx_CK("LCDCLK", LCD, &clk_pxa3xx_hsio_ops, &pxa_device_fb.dev),
215 PXA3xx_CK("CAMCLK", CAMERA, &clk_pxa3xx_hsio_ops, NULL), 235 PXA3xx_CK("CAMCLK", CAMERA, &clk_pxa3xx_hsio_ops, NULL),
216 PXA3xx_CK("AC97CLK", AC97, &clk_pxa3xx_ac97_ops, NULL), 236 PXA3xx_CK("AC97CLK", AC97, &clk_pxa3xx_ac97_ops, NULL),
@@ -509,6 +529,30 @@ void __init pxa3xx_init_irq(void)
509 * device registration specific to PXA3xx. 529 * device registration specific to PXA3xx.
510 */ 530 */
511 531
532static struct resource i2c_power_resources[] = {
533 {
534 .start = 0x40f500c0,
535 .end = 0x40f500d3,
536 .flags = IORESOURCE_MEM,
537 }, {
538 .start = IRQ_PWRI2C,
539 .end = IRQ_PWRI2C,
540 .flags = IORESOURCE_IRQ,
541 },
542};
543
544struct platform_device pxa3xx_device_i2c_power = {
545 .name = "pxa2xx-i2c",
546 .id = 1,
547 .resource = i2c_power_resources,
548 .num_resources = ARRAY_SIZE(i2c_power_resources),
549};
550
551void __init pxa3xx_set_i2c_power_info(struct i2c_pxa_platform_data *info)
552{
553 pxa3xx_device_i2c_power.dev.platform_data = info;
554}
555
512static struct platform_device *devices[] __initdata = { 556static struct platform_device *devices[] __initdata = {
513/* &pxa_device_udc, The UDC driver is PXA25x only */ 557/* &pxa_device_udc, The UDC driver is PXA25x only */
514 &pxa_device_ffuart, 558 &pxa_device_ffuart,
@@ -522,6 +566,7 @@ static struct platform_device *devices[] __initdata = {
522 &pxa3xx_device_ssp4, 566 &pxa3xx_device_ssp4,
523 &pxa27x_device_pwm0, 567 &pxa27x_device_pwm0,
524 &pxa27x_device_pwm1, 568 &pxa27x_device_pwm1,
569 &pxa3xx_device_i2c_power,
525}; 570};
526 571
527static struct sys_device pxa3xx_sysdev[] = { 572static struct sys_device pxa3xx_sysdev[] = {