Skip to content

Commit

Permalink
i2c-bfin-twi: return completion in interrupt for smbus quick transfers
Browse files Browse the repository at this point in the history
A smbus quick transfer has no data after the address byte.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
  • Loading branch information
Sonic Zhang authored and Ben Dooks committed May 19, 2010
1 parent be2f80f commit f0ac131
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions drivers/i2c/busses/i2c-bfin-twi.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,14 @@ static void bfin_twi_handle_interrupt(struct bfin_twi_iface *iface,
if (mast_stat & BUFWRERR)
dev_dbg(&iface->adap.dev, "Buffer Write Error\n");

/* if both err and complete int stats are set, return proper
* results.
/* If it is a quick transfer, only address without data,
* not an err, return 1.
*/
if (twi_int_status & MCOMP) {
/* If it is a quick transfer, only address without data,
* not an err, return 1.
* If address is acknowledged return 1.
*/
if ((iface->writeNum == 0 && (mast_stat & BUFRDERR))
|| !(mast_stat & ANAK))
iface->result = 1;
}
if (iface->cur_mode == TWI_I2C_MODE_STANDARD &&
iface->transPtr == NULL &&
(twi_int_status & MCOMP) && (mast_stat & DNAK))
iface->result = 1;

complete(&iface->complete);
return;
}
Expand Down

0 comments on commit f0ac131

Please sign in to comment.