提交 f0ac131a 编写于 作者: S Sonic Zhang 提交者: Ben Dooks

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: NSonic Zhang <sonic.zhang@analog.com>
Signed-off-by: NMike Frysinger <vapier@gentoo.org>
Signed-off-by: NBen Dooks <ben-linux@fluff.org>
上级 be2f80f0
...@@ -159,18 +159,14 @@ static void bfin_twi_handle_interrupt(struct bfin_twi_iface *iface, ...@@ -159,18 +159,14 @@ static void bfin_twi_handle_interrupt(struct bfin_twi_iface *iface,
if (mast_stat & BUFWRERR) if (mast_stat & BUFWRERR)
dev_dbg(&iface->adap.dev, "Buffer Write Error\n"); dev_dbg(&iface->adap.dev, "Buffer Write Error\n");
/* if both err and complete int stats are set, return proper /* If it is a quick transfer, only address without data,
* results. * not an err, return 1.
*/ */
if (twi_int_status & MCOMP) { if (iface->cur_mode == TWI_I2C_MODE_STANDARD &&
/* If it is a quick transfer, only address without data, iface->transPtr == NULL &&
* not an err, return 1. (twi_int_status & MCOMP) && (mast_stat & DNAK))
* If address is acknowledged return 1. iface->result = 1;
*/
if ((iface->writeNum == 0 && (mast_stat & BUFRDERR))
|| !(mast_stat & ANAK))
iface->result = 1;
}
complete(&iface->complete); complete(&iface->complete);
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册