summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Wu <david.wu@rock-chips.com>2016-10-22 16:43:42 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-10 16:38:44 +0100
commit9c619c2a8d4d14c7e9fe741239b7b42f610f09d9 (patch)
tree6e65f1c9696bbf23df0acd6775b3345432b37bab
parent5d506f2133aa81e4a65130c148409512c8f51d7c (diff)
i2c: rk3x: Give the tuning value 0 during rk3x_i2c_v0_calc_timings
commit 399c168ab5ab5e12ed55b6c91d61c24eb84c9164 upstream. 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. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/i2c/busses/i2c-rk3x.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
index 5c5b7cada8be..dfae43523d34 100644
--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -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;