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

From: Doug Anderson
Date: Mon Sep 08 2014 - 00:15:38 EST


Addy,

On Sun, Sep 7, 2014 at 8:38 PM, Addy Ke <addy.ke@xxxxxxxxxxxxxx> 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) = 8 * ((CLKDIVL + 1) + (CLKDIVH + 1))
> - SCL = PCLK / (CLK Divsor)
>
> It will be updated to the latest version of chip manual.
>
> Signed-off-by: Addy Ke <addy.ke@xxxxxxxxxxxxxx>
> ---
> changes since v1:
> - make it more cleaner, suggested by Doug Anderson
>
> drivers/i2c/busses/i2c-rk3x.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)

Reviewed-by: Doug Anderson <dianders@xxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/