mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 01:41:39 +00:00
I2C: JZ4780: Fix bug for Ingenic X1000.
Only send "X1000_I2C_DC_STOP" when last byte, or it will cause
error when I2C write operation which should look like this:
device_addr + w, reg_addr, data;
But without this patch, it looks like this:
device_addr + w, reg_addr, device_addr + w, data;
Fixes: 21575a7a8d
("I2C: JZ4780: Add support for the X1000.")
Reported-by: 杨文龙 (Yang Wenlong) <ywltyut@sina.cn>
Tested-by: 杨文龙 (Yang Wenlong) <ywltyut@sina.cn>
Signed-off-by: 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
This commit is contained in:
parent
e409a6a3e0
commit
942bfbecc0
1 changed files with 2 additions and 2 deletions
|
@ -525,8 +525,8 @@ static irqreturn_t jz4780_i2c_irq(int irqno, void *dev_id)
|
|||
i2c_sta = jz4780_i2c_readw(i2c, JZ4780_I2C_STA);
|
||||
data = *i2c->wbuf;
|
||||
data &= ~JZ4780_I2C_DC_READ;
|
||||
if ((!i2c->stop_hold) && (i2c->cdata->version >=
|
||||
ID_X1000))
|
||||
if ((i2c->wt_len == 1) && (!i2c->stop_hold) &&
|
||||
(i2c->cdata->version >= ID_X1000))
|
||||
data |= X1000_I2C_DC_STOP;
|
||||
jz4780_i2c_writew(i2c, JZ4780_I2C_DC, data);
|
||||
i2c->wbuf++;
|
||||
|
|
Loading…
Reference in a new issue