Re: [PATCH v2] i2c: rk3x: fix divisor calculation for SCL frequency

2014-09-20 Thread Wolfram Sang
On Mon, Sep 08, 2014 at 11:38:25AM +0800, Addy Ke wrote: > I2C_CLKDIV register descripted in the previous version of > RK3x chip manual is incorrect. Plus 1 is required. > > The correct formula: > - T(SCL_HIGH) = T(PCLK) * (CLKDIVH + 1) * 8 > - T(SCL_LOW) = T(PCLK) * (CLKDIVL + 1) * 8 > - (SCL

Re: [PATCH v2] i2c: rk3x: fix divisor calculation for SCL frequency

2014-09-20 Thread Wolfram Sang
On Mon, Sep 08, 2014 at 11:38:25AM +0800, Addy Ke wrote: I2C_CLKDIV register descripted in the previous version of RK3x chip manual is incorrect. Plus 1 is required. The correct formula: - T(SCL_HIGH) = T(PCLK) * (CLKDIVH + 1) * 8 - T(SCL_LOW) = T(PCLK) * (CLKDIVL + 1) * 8 - (SCL Divsor) =

Re: [PATCH v2] i2c: rk3x: fix divisor calculation for SCL frequency

2014-09-07 Thread Doug Anderson
Addy, On Sun, Sep 7, 2014 at 8:38 PM, Addy Ke wrote: > I2C_CLKDIV register descripted in the previous version of > RK3x chip manual is incorrect. Plus 1 is required. > > The correct formula: > - T(SCL_HIGH) = T(PCLK) * (CLKDIVH + 1) * 8 > - T(SCL_LOW) = T(PCLK) * (CLKDIVL + 1) * 8 > - (SCL

[PATCH v2] i2c: rk3x: fix divisor calculation for SCL frequency

2014-09-07 Thread Addy Ke
I2C_CLKDIV register descripted in the previous version of RK3x chip manual is incorrect. Plus 1 is required. The correct formula: - T(SCL_HIGH) = T(PCLK) * (CLKDIVH + 1) * 8 - T(SCL_LOW) = T(PCLK) * (CLKDIVL + 1) * 8 - (SCL Divsor) = 8 * ((CLKDIVL + 1) + (CLKDIVH + 1)) - SCL = PCLK / (CLK Divsor)

[PATCH v2] i2c: rk3x: fix divisor calculation for SCL frequency

2014-09-07 Thread Addy Ke
I2C_CLKDIV register descripted in the previous version of RK3x chip manual is incorrect. Plus 1 is required. The correct formula: - T(SCL_HIGH) = T(PCLK) * (CLKDIVH + 1) * 8 - T(SCL_LOW) = T(PCLK) * (CLKDIVL + 1) * 8 - (SCL Divsor) = 8 * ((CLKDIVL + 1) + (CLKDIVH + 1)) - SCL = PCLK / (CLK Divsor)

Re: [PATCH v2] i2c: rk3x: fix divisor calculation for SCL frequency

2014-09-07 Thread Doug Anderson
Addy, On Sun, Sep 7, 2014 at 8:38 PM, Addy Ke addy...@rock-chips.com wrote: I2C_CLKDIV register descripted in the previous version of RK3x chip manual is incorrect. Plus 1 is required. The correct formula: - T(SCL_HIGH) = T(PCLK) * (CLKDIVH + 1) * 8 - T(SCL_LOW) = T(PCLK) * (CLKDIVL + 1) *