linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fix bug for Ingenic X1000 v2.
@ 2021-03-19 10:12 周琰杰 (Zhou Yanjie)
  2021-03-19 10:12 ` [PATCH v2] I2C: JZ4780: Fix bug for Ingenic X1000 周琰杰 (Zhou Yanjie)
  0 siblings, 1 reply; 3+ messages in thread
From: 周琰杰 (Zhou Yanjie) @ 2021-03-19 10:12 UTC (permalink / raw)
  To: wsa, paul
  Cc: linux-mips, linux-i2c, linux-kernel, dongsheng.qiu, aric.pzqi,
	ywltyut, sernia.zhou

For SoCs after X1000, only send "X1000_I2C_DC_STOP" when last byte,
or it will cause error when I2C write operation.

v1->v2:
1.Add missing Reported-by and Tested-by.
2.Remove change which not related to the bugfix.

周琰杰 (Zhou Yanjie) (1):
  I2C: JZ4780: Fix bug for Ingenic X1000.

 drivers/i2c/busses/i2c-jz4780.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] I2C: JZ4780: Fix bug for Ingenic X1000.
  2021-03-19 10:12 Fix bug for Ingenic X1000 v2 周琰杰 (Zhou Yanjie)
@ 2021-03-19 10:12 ` 周琰杰 (Zhou Yanjie)
  2021-03-31  7:18   ` Wolfram Sang
  0 siblings, 1 reply; 3+ messages in thread
From: 周琰杰 (Zhou Yanjie) @ 2021-03-19 10:12 UTC (permalink / raw)
  To: wsa, paul
  Cc: linux-mips, linux-i2c, linux-kernel, dongsheng.qiu, aric.pzqi,
	ywltyut, sernia.zhou

Only send "X1000_I2C_DC_STOP" when last byte, or it will cause
error when I2C write operation.

Fixes: 21575a7a8d4c ("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>
---

Notes:
    v1->v2:
    1.Add missing Reported-by and Tested-by.
    2.Remove change which not related to the bugfix.

 drivers/i2c/busses/i2c-jz4780.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-jz4780.c b/drivers/i2c/busses/i2c-jz4780.c
index 8509c5f..55177eb 100644
--- a/drivers/i2c/busses/i2c-jz4780.c
+++ b/drivers/i2c/busses/i2c-jz4780.c
@@ -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++;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] I2C: JZ4780: Fix bug for Ingenic X1000.
  2021-03-19 10:12 ` [PATCH v2] I2C: JZ4780: Fix bug for Ingenic X1000 周琰杰 (Zhou Yanjie)
@ 2021-03-31  7:18   ` Wolfram Sang
  0 siblings, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2021-03-31  7:18 UTC (permalink / raw)
  To: 周琰杰 (Zhou Yanjie)
  Cc: paul, linux-mips, linux-i2c, linux-kernel, dongsheng.qiu,
	aric.pzqi, ywltyut, sernia.zhou

[-- Attachment #1: Type: text/plain, Size: 501 bytes --]

On Fri, Mar 19, 2021 at 06:12:13PM +0800, 周琰杰 (Zhou Yanjie) wrote:
> Only send "X1000_I2C_DC_STOP" when last byte, or it will cause
> error when I2C write operation.
> 
> Fixes: 21575a7a8d4c ("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>

Applied to for-current with updated commit message, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-31  7:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-19 10:12 Fix bug for Ingenic X1000 v2 周琰杰 (Zhou Yanjie)
2021-03-19 10:12 ` [PATCH v2] I2C: JZ4780: Fix bug for Ingenic X1000 周琰杰 (Zhou Yanjie)
2021-03-31  7:18   ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).