summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-pxa.c
diff options
context:
space:
mode:
authorMike Rapoport <mike@compulab.co.il>2008-08-17 06:23:05 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-09-09 16:32:51 +0100
commit9ba63c4fa10cf446eff06a3200822d22b0c31c31 (patch)
treebc67d381e703aa150799f07ef85a7d7369376b72 /drivers/i2c/busses/i2c-pxa.c
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 'drivers/i2c/busses/i2c-pxa.c')
-rw-r--r--drivers/i2c/busses/i2c-pxa.c12
1 files changed, 7 insertions, 5 deletions
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 {
u32 icrlog[32];
void __iomem *reg_base;
+ unsigned int reg_shift;
unsigned long iobase;
unsigned long iosize;
@@ -68,11 +69,11 @@ struct pxa_i2c {
int use_pio;
};
-#define _IBMR(i2c) ((i2c)->reg_base + 0)
-#define _IDBR(i2c) ((i2c)->reg_base + 8)
-#define _ICR(i2c) ((i2c)->reg_base + 0x10)
-#define _ISR(i2c) ((i2c)->reg_base + 0x18)
-#define _ISAR(i2c) ((i2c)->reg_base + 0x20)
+#define _IBMR(i2c) ((i2c)->reg_base + (0x0 << (i2c)->reg_shift))
+#define _IDBR(i2c) ((i2c)->reg_base + (0x4 << (i2c)->reg_shift))
+#define _ICR(i2c) ((i2c)->reg_base + (0x8 << (i2c)->reg_shift))
+#define _ISR(i2c) ((i2c)->reg_base + (0xc << (i2c)->reg_shift))
+#define _ISAR(i2c) ((i2c)->reg_base + (0x10 << (i2c)->reg_shift))
/*
* I2C Slave mode address
@@ -993,6 +994,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
ret = -EIO;
goto eremap;
}
+ i2c->reg_shift = (cpu_is_pxa3xx() && (dev->id == 1)) ? 0 : 1;
i2c->iobase = res->start;
i2c->iosize = res_len(res);