diff options
Diffstat (limited to 'drivers/i2c')
-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 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); |