Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333384
b: refs/heads/master
c: 1d7afc9
h: refs/heads/master
v: v3
  • Loading branch information
Felipe Balbi authored and Wolfram Sang committed Sep 12, 2012
1 parent e9c95ac commit 28f68b8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 66b9298878742f08cb6e79b7c7d5632d782fd1e1
refs/heads/master: 1d7afc95946487945cc7f5019b41255b72224b70
28 changes: 16 additions & 12 deletions trunk/drivers/i2c/busses/i2c-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,21 +850,19 @@ omap_i2c_isr(int this_irq, void *dev_id)
}

complete:
/*
* Ack the stat in one go, but [R/X]DR and [R/X]RDY should be
* acked after the data operation is complete.
* Ref: TRM SWPU114Q Figure 18-31
*/
omap_i2c_write_reg(dev, OMAP_I2C_STAT_REG, stat &
~(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));

if (stat & OMAP_I2C_STAT_NACK)
if (stat & OMAP_I2C_STAT_NACK) {
err |= OMAP_I2C_STAT_NACK;
omap_i2c_ack_stat(dev, OMAP_I2C_STAT_NACK);
omap_i2c_complete_cmd(dev, err);
return IRQ_HANDLED;
}

if (stat & OMAP_I2C_STAT_AL) {
dev_err(dev->dev, "Arbitration lost\n");
err |= OMAP_I2C_STAT_AL;
omap_i2c_ack_stat(dev, OMAP_I2C_STAT_AL);
omap_i2c_complete_cmd(dev, err);
return IRQ_HANDLED;
}

/*
Expand Down Expand Up @@ -941,12 +939,18 @@ omap_i2c_isr(int this_irq, void *dev_id)

if (stat & OMAP_I2C_STAT_ROVR) {
dev_err(dev->dev, "Receive overrun\n");
dev->cmd_err |= OMAP_I2C_STAT_ROVR;
err |= OMAP_I2C_STAT_ROVR;
omap_i2c_ack_stat(dev, OMAP_I2C_STAT_ROVR);
omap_i2c_complete_cmd(dev, err);
return IRQ_HANDLED;
}

if (stat & OMAP_I2C_STAT_XUDF) {
dev_err(dev->dev, "Transmit underflow\n");
dev->cmd_err |= OMAP_I2C_STAT_XUDF;
err |= OMAP_I2C_STAT_XUDF;
omap_i2c_ack_stat(dev, OMAP_I2C_STAT_XUDF);
omap_i2c_complete_cmd(dev, err);
return IRQ_HANDLED;
}
} while (stat);

Expand Down

0 comments on commit 28f68b8

Please sign in to comment.