i2c-pxa.c (86d688984deefa3ae5a802880c11f2b408b5d6cf) | i2c-pxa.c (9ba63c4fa10cf446eff06a3200822d22b0c31c31) |
---|---|
1/* 2 * i2c_adap_pxa.c 3 * 4 * I2C adapter for the PXA I2C bus access. 5 * 6 * Copyright (C) 2002 Intrinsyc Software Inc. 7 * Copyright (C) 2004-2005 Deep Blue Solutions Ltd. 8 * --- 46 unchanged lines hidden (view full) --- 55 struct i2c_slave_client *slave; 56#endif 57 58 unsigned int irqlogidx; 59 u32 isrlog[32]; 60 u32 icrlog[32]; 61 62 void __iomem *reg_base; | 1/* 2 * i2c_adap_pxa.c 3 * 4 * I2C adapter for the PXA I2C bus access. 5 * 6 * Copyright (C) 2002 Intrinsyc Software Inc. 7 * Copyright (C) 2004-2005 Deep Blue Solutions Ltd. 8 * --- 46 unchanged lines hidden (view full) --- 55 struct i2c_slave_client *slave; 56#endif 57 58 unsigned int irqlogidx; 59 u32 isrlog[32]; 60 u32 icrlog[32]; 61 62 void __iomem *reg_base; |
63 unsigned int reg_shift; |
|
63 64 unsigned long iobase; 65 unsigned long iosize; 66 67 int irq; 68 int use_pio; 69}; 70 | 64 65 unsigned long iobase; 66 unsigned long iosize; 67 68 int irq; 69 int use_pio; 70}; 71 |
71#define _IBMR(i2c) ((i2c)->reg_base + 0) 72#define _IDBR(i2c) ((i2c)->reg_base + 8) 73#define _ICR(i2c) ((i2c)->reg_base + 0x10) 74#define _ISR(i2c) ((i2c)->reg_base + 0x18) 75#define _ISAR(i2c) ((i2c)->reg_base + 0x20) | 72#define _IBMR(i2c) ((i2c)->reg_base + (0x0 << (i2c)->reg_shift)) 73#define _IDBR(i2c) ((i2c)->reg_base + (0x4 << (i2c)->reg_shift)) 74#define _ICR(i2c) ((i2c)->reg_base + (0x8 << (i2c)->reg_shift)) 75#define _ISR(i2c) ((i2c)->reg_base + (0xc << (i2c)->reg_shift)) 76#define _ISAR(i2c) ((i2c)->reg_base + (0x10 << (i2c)->reg_shift)) |
76 77/* 78 * I2C Slave mode address 79 */ 80#define I2C_PXA_SLAVE_ADDR 0x1 81 82#ifdef DEBUG 83 --- 904 unchanged lines hidden (view full) --- 988 goto eclk; 989 } 990 991 i2c->reg_base = ioremap(res->start, res_len(res)); 992 if (!i2c->reg_base) { 993 ret = -EIO; 994 goto eremap; 995 } | 77 78/* 79 * I2C Slave mode address 80 */ 81#define I2C_PXA_SLAVE_ADDR 0x1 82 83#ifdef DEBUG 84 --- 904 unchanged lines hidden (view full) --- 989 goto eclk; 990 } 991 992 i2c->reg_base = ioremap(res->start, res_len(res)); 993 if (!i2c->reg_base) { 994 ret = -EIO; 995 goto eremap; 996 } |
997 i2c->reg_shift = (cpu_is_pxa3xx() && (dev->id == 1)) ? 0 : 1; |
|
996 997 i2c->iobase = res->start; 998 i2c->iosize = res_len(res); 999 1000 i2c->irq = irq; 1001 1002 i2c->slave_addr = I2C_PXA_SLAVE_ADDR; 1003 --- 105 unchanged lines hidden --- | 998 999 i2c->iobase = res->start; 1000 i2c->iosize = res_len(res); 1001 1002 i2c->irq = irq; 1003 1004 i2c->slave_addr = I2C_PXA_SLAVE_ADDR; 1005 --- 105 unchanged lines hidden --- |