提交 cf27020d 编写于 作者: A Alexandru M Stan 提交者: Wolfram Sang

i2c: rk3x: fix 0 length write transfers

i2cdetect -q was broken (everything was a false positive, and no transfers were
actually being sent over i2c). The way it works is by sending a 0 length write
request and checking for NACK. This patch fixes the 0 length writes and actually
sends them.
Reported-by: NDoug Anderson <dianders@chromium.org>
Signed-off-by: NAlexandru M Stan <amstan@chromium.org>
Tested-by: NDoug Anderson <dianders@chromium.org>
Tested-by: NMax Schwarz <max.schwarz@online.de>
Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
上级 fe82dcec
...@@ -238,7 +238,7 @@ static void rk3x_i2c_fill_transmit_buf(struct rk3x_i2c *i2c) ...@@ -238,7 +238,7 @@ static void rk3x_i2c_fill_transmit_buf(struct rk3x_i2c *i2c)
for (i = 0; i < 8; ++i) { for (i = 0; i < 8; ++i) {
val = 0; val = 0;
for (j = 0; j < 4; ++j) { for (j = 0; j < 4; ++j) {
if (i2c->processed == i2c->msg->len) if ((i2c->processed == i2c->msg->len) && (cnt != 0))
break; break;
if (i2c->processed == 0 && cnt == 0) if (i2c->processed == 0 && cnt == 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册