[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdWrb2je4tgEO_OmXhHtFiRb8JfUzBJdUp4KFf574GmoVA@mail.gmail.com>
Date: Tue, 19 Sep 2023 11:51:59 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Wolfram Sang <wsa+renesas@...g-engineering.com>
Cc: linux-renesas-soc@...r.kernel.org,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Andi Shyti <andi.shyti@...nel.org>, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] i2c: rcar: add FastMode+ support for Gen4
Hi Wolfram,
On Thu, Sep 14, 2023 at 1:16 AM Wolfram Sang
<wsa+renesas@...g-engineering.com> wrote:
> To support FM+, we mainly need to turn the SMD constant into a parameter
> and set it accordingly. Then, activating the enable bit for FM+ is all
> we need to do. Tested with a Renesas Falcon board using R-Car V3U.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@...g-engineering.com>
Thanks for your patch!
> --- a/drivers/i2c/busses/i2c-rcar.c
> +++ b/drivers/i2c/busses/i2c-rcar.c
> @@ -297,11 +307,18 @@ static int rcar_i2c_clock_calculate(struct rcar_i2c_priv *priv)
> * clkp : peripheral_clk
> * F[] : integer up-valuation
> */
> - rate = clk_get_rate(priv->clk);
> - cdf = rate / 20000000;
> - cdf_width = (priv->devtype == I2C_RCAR_GEN1) ? 2 : 3;
> - if (cdf >= 1U << cdf_width)
> - goto err_no_val;
> + if (t.bus_freq_hz > I2C_MAX_FAST_MODE_FREQ && priv->devtype >= I2C_RCAR_GEN4) {
> + priv->flags |= ID_P_FMPLUS;
> + /* FM+ needs lower SMD and no filters */
> + priv->smd /= 2;
> + cdf = 0;
Is this documented somewhere in the R-Car Gen4 docs?
Assumed this is true, the rest LGTM, modulo the few fixes that should be
moved to "[PATCH RFT 2/2] i2c: rcar: improve accuracy for R-Car Gen3+".
> + } else {
> + priv->flags &= ~ID_P_FMPLUS;
> + cdf = rate / 20000000;
> + cdf_width = (priv->devtype == I2C_RCAR_GEN1) ? 2 : 3;
> + if (cdf >= 1U << cdf_width)
> + goto err_no_val;
> + }
>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
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
Powered by blists - more mailing lists