aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
-rw-r--r--drivers/i2c/busses/i2c-pxa.c12
5 files changed, 59 insertions, 7 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[] = {
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 44d838410f15..5d5fbc518b7b 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -60,6 +60,7 @@ struct pxa_i2c {
60 u32 icrlog[32]; 60 u32 icrlog[32];
61 61
62 void __iomem *reg_base; 62 void __iomem *reg_base;
63 unsigned int reg_shift;
63 64
64 unsigned long iobase; 65 unsigned long iobase;
65 unsigned long iosize; 66 unsigned long iosize;
@@ -68,11 +69,11 @@ struct pxa_i2c {
68 int use_pio; 69 int use_pio;
69}; 70};
70 71
71#define _IBMR(i2c) ((i2c)->reg_base + 0) 72#define _IBMR(i2c) ((i2c)->reg_base + (0x0 << (i2c)->reg_shift))
72#define _IDBR(i2c) ((i2c)->reg_base + 8) 73#define _IDBR(i2c) ((i2c)->reg_base + (0x4 << (i2c)->reg_shift))
73#define _ICR(i2c) ((i2c)->reg_base + 0x10) 74#define _ICR(i2c) ((i2c)->reg_base + (0x8 << (i2c)->reg_shift))
74#define _ISR(i2c) ((i2c)->reg_base + 0x18) 75#define _ISR(i2c) ((i2c)->reg_base + (0xc << (i2c)->reg_shift))
75#define _ISAR(i2c) ((i2c)->reg_base + 0x20) 76#define _ISAR(i2c) ((i2c)->reg_base + (0x10 << (i2c)->reg_shift))
76 77
77/* 78/*
78 * I2C Slave mode address 79 * I2C Slave mode address
@@ -993,6 +994,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
993 ret = -EIO; 994 ret = -EIO;
994 goto eremap; 995 goto eremap;
995 } 996 }
997 i2c->reg_shift = (cpu_is_pxa3xx() && (dev->id == 1)) ? 0 : 1;
996 998
997 i2c->iobase = res->start; 999 i2c->iobase = res->start;
998 i2c->iosize = res_len(res); 1000 i2c->iosize = res_len(res);