Re: [PATCH v8 7/8] i2c: rk3x: add i2c support for rk3399 soc

2016-05-12 Thread Doug Anderson
David, On Thu, May 12, 2016 at 8:07 AM, David.Wu wrote: > I also found a subtle bug, it would clean the con register by use > "i2c_writel(i2c, 0, REG_CON)" in rk3x_i2c_stop(). So i think it would be > fixed by using read-modify-write way here in next version. Good

Re: [PATCH v8 7/8] i2c: rk3x: add i2c support for rk3399 soc

2016-05-12 Thread Doug Anderson
David, On Thu, May 12, 2016 at 8:07 AM, David.Wu wrote: > I also found a subtle bug, it would clean the con register by use > "i2c_writel(i2c, 0, REG_CON)" in rk3x_i2c_stop(). So i think it would be > fixed by using read-modify-write way here in next version. Good catch. I look forward to the

Re: [PATCH v8 7/8] i2c: rk3x: add i2c support for rk3399 soc

2016-05-12 Thread David.Wu
Hi Doug, 在 2016/5/12 9:08, David.Wu 写道: Hi Doug, 在 2016/5/12 1:37, Doug Anderson 写道: Hi, On Tue, May 10, 2016 at 12:31 PM, David Wu wrote: static void rk3x_i2c_adapt_div(struct rk3x_i2c *i2c, unsigned long clk_rate) { struct i2c_timings *t = >t;

Re: [PATCH v8 7/8] i2c: rk3x: add i2c support for rk3399 soc

2016-05-12 Thread David.Wu
Hi Doug, 在 2016/5/12 9:08, David.Wu 写道: Hi Doug, 在 2016/5/12 1:37, Doug Anderson 写道: Hi, On Tue, May 10, 2016 at 12:31 PM, David Wu wrote: static void rk3x_i2c_adapt_div(struct rk3x_i2c *i2c, unsigned long clk_rate) { struct i2c_timings *t = >t; struct

Re: [PATCH v8 7/8] i2c: rk3x: add i2c support for rk3399 soc

2016-05-11 Thread David.Wu
Hi Doug, 在 2016/5/12 1:37, Doug Anderson 写道: Hi, On Tue, May 10, 2016 at 12:31 PM, David Wu wrote: static void rk3x_i2c_adapt_div(struct rk3x_i2c *i2c, unsigned long clk_rate) { struct i2c_timings *t = >t; struct rk3x_i2c_calced_timings calc;

Re: [PATCH v8 7/8] i2c: rk3x: add i2c support for rk3399 soc

2016-05-11 Thread David.Wu
Hi Doug, 在 2016/5/12 1:37, Doug Anderson 写道: Hi, On Tue, May 10, 2016 at 12:31 PM, David Wu wrote: static void rk3x_i2c_adapt_div(struct rk3x_i2c *i2c, unsigned long clk_rate) { struct i2c_timings *t = >t; struct rk3x_i2c_calced_timings calc; u64 t_low_ns,

Re: [PATCH v8 7/8] i2c: rk3x: add i2c support for rk3399 soc

2016-05-11 Thread Doug Anderson
Hi, On Tue, May 10, 2016 at 12:31 PM, David Wu wrote: > static void rk3x_i2c_adapt_div(struct rk3x_i2c *i2c, unsigned long clk_rate) > { > struct i2c_timings *t = >t; > struct rk3x_i2c_calced_timings calc; > u64 t_low_ns, t_high_ns; > +

Re: [PATCH v8 7/8] i2c: rk3x: add i2c support for rk3399 soc

2016-05-11 Thread Doug Anderson
Hi, On Tue, May 10, 2016 at 12:31 PM, David Wu wrote: > static void rk3x_i2c_adapt_div(struct rk3x_i2c *i2c, unsigned long clk_rate) > { > struct i2c_timings *t = >t; > struct rk3x_i2c_calced_timings calc; > u64 t_low_ns, t_high_ns; > + u32 val; > int ret;

Re: [PATCH v8 7/8] i2c: rk3x: add i2c support for rk3399 soc

2016-05-11 Thread Caesar Wang
在 2016年05月11日 03:31, David Wu 写道: - new method to caculate i2c timings for rk3399: There was an timing issue about "repeated start" time at the I2C controller of version0, controller appears to drop SDA at .875x (7/8) programmed clk high. On version 1 of the controller, the

Re: [PATCH v8 7/8] i2c: rk3x: add i2c support for rk3399 soc

2016-05-11 Thread Caesar Wang
在 2016年05月11日 03:31, David Wu 写道: - new method to caculate i2c timings for rk3399: There was an timing issue about "repeated start" time at the I2C controller of version0, controller appears to drop SDA at .875x (7/8) programmed clk high. On version 1 of the controller, the

[PATCH v8 7/8] i2c: rk3x: add i2c support for rk3399 soc

2016-05-10 Thread David Wu
- new method to caculate i2c timings for rk3399: There was an timing issue about "repeated start" time at the I2C controller of version0, controller appears to drop SDA at .875x (7/8) programmed clk high. On version 1 of the controller, the rule(.875x) isn't enough to meet tSU;STA

[PATCH v8 7/8] i2c: rk3x: add i2c support for rk3399 soc

2016-05-10 Thread David Wu
- new method to caculate i2c timings for rk3399: There was an timing issue about "repeated start" time at the I2C controller of version0, controller appears to drop SDA at .875x (7/8) programmed clk high. On version 1 of the controller, the rule(.875x) isn't enough to meet tSU;STA