Addy,
On Fri, Sep 5, 2014 at 3:17 AM, addy ke <[email protected]> wrote:
> The following modifications is reasonable?
>
> static void rk3x_i2c_set_scl_rate(struct rk3x_i2c *i2c, unsigned long
> scl_rate)
> {
> unsigned long i2c_rate = clk_get_rate(i2c->clk);
> unsigned int div;
>
> /* set DIV = DIVH = DIVL
> * SCL rate = (clk rate) / (8 * (DIVH + 1 + DIVL + 1))
> * = (clk rate) / (16 * (DIV + 1))
> */
> div = DIV_ROUND_UP(i2c_rate, scl_rate * 16) - 1;
>
> i2c_writel(i2c, (div << 16) | (div & 0xffff), REG_CLKDIV);
> }
Yes, that looks much cleaner and is a nice solution, thanks! Can you
send up a new patch version?
-Doug
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/