diff options
author | Mike Rapoport <mike@compulab.co.il> | 2008-08-17 01:23:05 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-09-09 11:32:51 -0400 |
commit | 9ba63c4fa10cf446eff06a3200822d22b0c31c31 (patch) | |
tree | bc67d381e703aa150799f07ef85a7d7369376b72 /drivers | |
parent | 57a7a62eb65b35f51814382b0841ff99be242880 (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 'drivers')
-rw-r--r-- | drivers/i2c/busses/i2c-pxa.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index 44d838410f1..5d5fbc518b7 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); |