aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-07 19:29:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-07 19:29:29 -0400
commitf1bb20a8365f6753e0f7b6e94981ca2b662bae13 (patch)
treeda5c2299763087c754d8a801f868ac9aaed82ab3 /drivers/i2c
parent90c69064c903f0993c7268c49670ad1f32030942 (diff)
parent69f81e86540716e68e98e401bb91f339d6a0d31f (diff)
Merge branch 'for-30-rc5/all-i2c' of git://git.fluff.org/bjdooks/linux
* 'for-30-rc5/all-i2c' of git://git.fluff.org/bjdooks/linux: i2c-bfin-twi: abort transfer is MEM bit is reset unexpectedly i2c-s3c2410: Remove useless break code i2c-s3c2410: Fix typo 'i2s' -> 'i2c' i2c: tegra: Assign unused slave address
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-bfin-twi.c8
-rw-r--r--drivers/i2c/busses/i2c-s3c2410.c7
-rw-r--r--drivers/i2c/busses/i2c-tegra.c8
3 files changed, 17 insertions, 6 deletions
diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c
index 52b545a795f..cbc98aea5b0 100644
--- a/drivers/i2c/busses/i2c-bfin-twi.c
+++ b/drivers/i2c/busses/i2c-bfin-twi.c
@@ -193,7 +193,13 @@ static void bfin_twi_handle_interrupt(struct bfin_twi_iface *iface,
193 return; 193 return;
194 } 194 }
195 if (twi_int_status & MCOMP) { 195 if (twi_int_status & MCOMP) {
196 if (iface->cur_mode == TWI_I2C_MODE_COMBINED) { 196 if ((read_MASTER_CTL(iface) & MEN) == 0 &&
197 (iface->cur_mode == TWI_I2C_MODE_REPEAT ||
198 iface->cur_mode == TWI_I2C_MODE_COMBINED)) {
199 iface->result = -1;
200 write_INT_MASK(iface, 0);
201 write_MASTER_CTL(iface, 0);
202 } else if (iface->cur_mode == TWI_I2C_MODE_COMBINED) {
197 if (iface->readNum == 0) { 203 if (iface->readNum == 0) {
198 /* set the read number to 1 and ask for manual 204 /* set the read number to 1 and ask for manual
199 * stop in block combine mode 205 * stop in block combine mode
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 6c00c107ebf..f84a63c6dd9 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -248,12 +248,12 @@ static inline int is_msgend(struct s3c24xx_i2c *i2c)
248 return i2c->msg_ptr >= i2c->msg->len; 248 return i2c->msg_ptr >= i2c->msg->len;
249} 249}
250 250
251/* i2s_s3c_irq_nextbyte 251/* i2c_s3c_irq_nextbyte
252 * 252 *
253 * process an interrupt and work out what to do 253 * process an interrupt and work out what to do
254 */ 254 */
255 255
256static int i2s_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat) 256static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)
257{ 257{
258 unsigned long tmp; 258 unsigned long tmp;
259 unsigned char byte; 259 unsigned char byte;
@@ -264,7 +264,6 @@ static int i2s_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)
264 case STATE_IDLE: 264 case STATE_IDLE:
265 dev_err(i2c->dev, "%s: called in STATE_IDLE\n", __func__); 265 dev_err(i2c->dev, "%s: called in STATE_IDLE\n", __func__);
266 goto out; 266 goto out;
267 break;
268 267
269 case STATE_STOP: 268 case STATE_STOP:
270 dev_err(i2c->dev, "%s: called in STATE_STOP\n", __func__); 269 dev_err(i2c->dev, "%s: called in STATE_STOP\n", __func__);
@@ -444,7 +443,7 @@ static irqreturn_t s3c24xx_i2c_irq(int irqno, void *dev_id)
444 /* pretty much this leaves us with the fact that we've 443 /* pretty much this leaves us with the fact that we've
445 * transmitted or received whatever byte we last sent */ 444 * transmitted or received whatever byte we last sent */
446 445
447 i2s_s3c_irq_nextbyte(i2c, status); 446 i2c_s3c_irq_nextbyte(i2c, status);
448 447
449 out: 448 out:
450 return IRQ_HANDLED; 449 return IRQ_HANDLED;
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index 4d9319665e3..fb3b4f8f815 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -40,8 +40,10 @@
40#define I2C_CNFG_NEW_MASTER_FSM (1<<11) 40#define I2C_CNFG_NEW_MASTER_FSM (1<<11)
41#define I2C_STATUS 0x01C 41#define I2C_STATUS 0x01C
42#define I2C_SL_CNFG 0x020 42#define I2C_SL_CNFG 0x020
43#define I2C_SL_CNFG_NACK (1<<1)
43#define I2C_SL_CNFG_NEWSL (1<<2) 44#define I2C_SL_CNFG_NEWSL (1<<2)
44#define I2C_SL_ADDR1 0x02c 45#define I2C_SL_ADDR1 0x02c
46#define I2C_SL_ADDR2 0x030
45#define I2C_TX_FIFO 0x050 47#define I2C_TX_FIFO 0x050
46#define I2C_RX_FIFO 0x054 48#define I2C_RX_FIFO 0x054
47#define I2C_PACKET_TRANSFER_STATUS 0x058 49#define I2C_PACKET_TRANSFER_STATUS 0x058
@@ -337,7 +339,11 @@ static int tegra_i2c_init(struct tegra_i2c_dev *i2c_dev)
337 339
338 if (!i2c_dev->is_dvc) { 340 if (!i2c_dev->is_dvc) {
339 u32 sl_cfg = i2c_readl(i2c_dev, I2C_SL_CNFG); 341 u32 sl_cfg = i2c_readl(i2c_dev, I2C_SL_CNFG);
340 i2c_writel(i2c_dev, sl_cfg | I2C_SL_CNFG_NEWSL, I2C_SL_CNFG); 342 sl_cfg |= I2C_SL_CNFG_NACK | I2C_SL_CNFG_NEWSL;
343 i2c_writel(i2c_dev, sl_cfg, I2C_SL_CNFG);
344 i2c_writel(i2c_dev, 0xfc, I2C_SL_ADDR1);
345 i2c_writel(i2c_dev, 0x00, I2C_SL_ADDR2);
346
341 } 347 }
342 348
343 val = 7 << I2C_FIFO_CONTROL_TX_TRIG_SHIFT | 349 val = 7 << I2C_FIFO_CONTROL_TX_TRIG_SHIFT |