Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333386
b: refs/heads/master
c: 079d8af
h: refs/heads/master
v: v3
  • Loading branch information
Felipe Balbi authored and Wolfram Sang committed Sep 12, 2012
1 parent 6c4308f commit b544517
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ac79e4b24972c69debef90a5e16b145e59222388
refs/heads/master: 079d8af24b948261e1dae5d7df6b31b7bf205cb4
8 changes: 8 additions & 0 deletions trunk/drivers/i2c/busses/i2c-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ struct omap_i2c_dev {
*/
u8 rev;
unsigned b_hw:1; /* bad h/w fixes */
unsigned receiver:1; /* true when we're in receiver mode */
u16 iestate; /* Saved interrupt register */
u16 pscstate;
u16 scllstate;
Expand Down Expand Up @@ -492,6 +493,7 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,

INIT_COMPLETION(dev->cmd_complete);
dev->cmd_err = 0;
dev->receiver = !!(msg->flags & I2C_M_RD);

w = OMAP_I2C_CON_EN | OMAP_I2C_CON_MST | OMAP_I2C_CON_STT;

Expand Down Expand Up @@ -837,6 +839,12 @@ omap_i2c_isr(int this_irq, void *dev_id)
stat = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG);
stat &= bits;

/* If we're in receiver mode, ignore XDR/XRDY */
if (dev->receiver)
stat &= ~(OMAP_I2C_STAT_XDR | OMAP_I2C_STAT_XRDY);
else
stat &= ~(OMAP_I2C_STAT_RDR | OMAP_I2C_STAT_RRDY);

if (!stat) {
/* my work here is done */
return IRQ_HANDLED;
Expand Down

0 comments on commit b544517

Please sign in to comment.