lkml.org 
[lkml]   [2014]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.16 08/26] i2c: rk3x: fix 0 length write transfers
    Date
    3.16-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Alexandru M Stan <amstan@chromium.org>

    commit cf27020d2f253bac6457d6833b97141030f0122a upstream.

    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>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/i2c/busses/i2c-rk3x.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- 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(s
    for (i = 0; i < 8; ++i) {
    val = 0;
    for (j = 0; j < 4; ++j) {
    - if (i2c->processed == i2c->msg->len)
    + if ((i2c->processed == i2c->msg->len) && (cnt != 0))
    break;

    if (i2c->processed == 0 && cnt == 0)



    \
     
     \ /
      Last update: 2014-10-08 02:21    [W:7.863 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site