Re: [PATCH v2 2/2] i2c: rcar: improve accuracy for R-Car Gen3+

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wolfram,

On Tue, Sep 19, 2023 at 8:45 PM Wolfram Sang
<wsa+renesas@xxxxxxxxxxxxxxxxxxxx> wrote:
> With some new registers, SCL can be calculated to be closer to the
> desired rate. Apply the new formula for R-Car Gen3 device types.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
> ---
>
> Changes since v1:
> * fixed two whitespace issues
> * use dedicated variables for scld and schd
> * explicitly say "2 * smd" in the comment explaining the new formula
> * use correct division 'clkp/SCL' in the same comment
> * updated debug printout to use the new variables

Thanks for the update!

Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

But given you have to respin 1/2 anyway, what about...

> --- a/drivers/i2c/busses/i2c-rcar.c
> +++ b/drivers/i2c/busses/i2c-rcar.c

> @@ -128,6 +146,8 @@ struct rcar_i2c_priv {
>
>         int pos;
>         u32 icccr;
> +       u16 scld;
> +       u16 schd;

... changing the order, to match alphabetical and register offset order.

> +
> +               priv->icccr = cdf;
> +               priv->scld = RCAR_SCLD_RATIO * x;
> +               priv->schd = RCAR_SCHD_RATIO * x;

Likewise.

> +
> +               dev_dbg(dev, "clk %u/%u(%lu), round %u, CDF: %u SCLD %u SCHD %u\n",
> +                       scl, t.bus_freq_hz, rate, round, cdf, priv->scld, priv->schd);
> +       }
>
>         return 0;

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux