diff options
author | Alexandru M Stan <amstan@chromium.org> | 2014-10-01 13:40:41 -0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2014-10-02 21:18:53 -0400 |
commit | cf27020d2f253bac6457d6833b97141030f0122a (patch) | |
tree | c31e71866926e58330752eb3d11763c588db5414 | |
parent | fe82dcec644244676d55a1384c958d5f67979adb (diff) |
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: Doug Anderson <dianders@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
Tested-by: Max Schwarz <max.schwarz@online.de>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
-rw-r--r-- | drivers/i2c/busses/i2c-rk3x.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c index 93cfc837200b..b38b0529946a 100644 --- a/drivers/i2c/busses/i2c-rk3x.c +++ b/drivers/i2c/busses/i2c-rk3x.c | |||
@@ -238,7 +238,7 @@ static void rk3x_i2c_fill_transmit_buf(struct rk3x_i2c *i2c) | |||
238 | for (i = 0; i < 8; ++i) { | 238 | for (i = 0; i < 8; ++i) { |
239 | val = 0; | 239 | val = 0; |
240 | for (j = 0; j < 4; ++j) { | 240 | for (j = 0; j < 4; ++j) { |
241 | if (i2c->processed == i2c->msg->len) | 241 | if ((i2c->processed == i2c->msg->len) && (cnt != 0)) |
242 | break; | 242 | break; |
243 | 243 | ||
244 | if (i2c->processed == 0 && cnt == 0) | 244 | if (i2c->processed == 0 && cnt == 0) |