diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2010-03-22 03:23:20 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-05-20 00:18:58 +0100 |
commit | f0ac131a21ed13e8baaa9df6f0420f2c4b45e807 (patch) | |
tree | d346a5d0c38c9886d9803e7cf2760d76933fb053 /drivers | |
parent | be2f80f0a3a333c0c00b2c8a7c2d74fcd66b75a2 (diff) | |
download | op-kernel-dev-f0ac131a21ed13e8baaa9df6f0420f2c4b45e807.zip op-kernel-dev-f0ac131a21ed13e8baaa9df6f0420f2c4b45e807.tar.gz |
i2c-bfin-twi: return completion in interrupt for smbus quick transfers
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/busses/i2c-bfin-twi.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c index dabfa80..fb26e5c 100644 --- a/drivers/i2c/busses/i2c-bfin-twi.c +++ b/drivers/i2c/busses/i2c-bfin-twi.c @@ -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; } |