i2c: rk3x: Give the tuning value 0 during rk3x_i2c_v0_calc_timings
authorDavid Wu <david.wu@rock-chips.com>
Sat, 22 Oct 2016 08:43:42 +0000 (16:43 +0800)
committerDavid Wu <david.wu@rock-chips.com>
Tue, 25 Oct 2016 13:35:33 +0000 (21:35 +0800)
We found a bug that i2c transfer sometimes failed on 3066a board with
stabel-4.8, the con register would be updated by uninitialized tuning
value, it made the i2c transfer failed.

So give the tuning value to be zero during rk3x_i2c_v0_calc_timings.

Change-Id: I8686b8525e7fc8adc896f60dec4ae74d6c2a173c
Signed-off-by: David Wu <david.wu@rock-chips.com>
Tested-by: Andy Yan <andy.yan@rock-chips.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
drivers/i2c/busses/i2c-rk3x.c

index 7b65a2218685d11b9442a1afe447f007d27b7a2b..df8a4b20d56660cbe1572fd0bfa1c36b05b2ff11 100644 (file)
@@ -694,6 +694,8 @@ static int rk3x_i2c_v0_calc_timings(unsigned long clk_rate,
        t_calc->div_low--;
        t_calc->div_high--;
 
+       /* Give the tuning value 0, that would not update con register */
+       t_calc->tuning = 0;
        /* Maximum divider supported by hw is 0xffff */
        if (t_calc->div_low > 0xffff) {
                t_calc->div_low = 0xffff;