Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Alexandru M Stan and committed by
Wolfram Sang
cf27020d fe82dcec

+1 -1
+1 -1
drivers/i2c/busses/i2c-rk3x.c
··· 238 for (i = 0; i < 8; ++i) { 239 val = 0; 240 for (j = 0; j < 4; ++j) { 241 - if (i2c->processed == i2c->msg->len) 242 break; 243 244 if (i2c->processed == 0 && cnt == 0)
··· 238 for (i = 0; i < 8; ++i) { 239 val = 0; 240 for (j = 0; j < 4; ++j) { 241 + if ((i2c->processed == i2c->msg->len) && (cnt != 0)) 242 break; 243 244 if (i2c->processed == 0 && cnt == 0)