Re: [PATCH 3/3] i2c: rcar: add FastMode+ support

From: Geert Uytterhoeven
Date: Thu Sep 07 2023 - 11:40:05 EST


Hi Wolfram,

On Thu, Sep 7, 2023 at 7:39 AM Wolfram Sang
<wsa+renesas@xxxxxxxxxxxxxxxxxxxx> wrote:
> > > @@ -217,7 +228,17 @@ static void rcar_i2c_init(struct rcar_i2c_priv *priv)
> > > rcar_i2c_write(priv, ICMCR, MDBS);
> > > rcar_i2c_write(priv, ICMSR, 0);
> > > /* start clock */
> > > - rcar_i2c_write(priv, ICCCR, priv->icccr);
> > > + if (priv->flags & ID_P_FMPLUS) {
> > > + rcar_i2c_write(priv, ICCCR, 0);
> > > + rcar_i2c_write(priv, ICMPR, priv->clock_val);
> > > + rcar_i2c_write(priv, ICHPR, 3 * priv->clock_val);
> > > + rcar_i2c_write(priv, ICLPR, 3 * priv->clock_val);
> > > + rcar_i2c_write(priv, ICCCR2, FMPE | CDFD | HLSE | SME);
> > > + } else {
> > > + rcar_i2c_write(priv, ICCCR, priv->clock_val);
> > > + if (priv->devtype >= I2C_RCAR_GEN3)
> > > + rcar_i2c_write(priv, ICCCR2, 0);
> >
> > is this last bit part of the FM+ enabling or is it part of the
> > GEN4 support?
>
> It is "disabling FM+" for lower speeds. Since we never used ICCCR2
> before FM+, we need to make sure it is cleared properly.

This may become clearer if you first introduce support for ICCCR2
on R-Car Gen3 and later, to improve i2c rate accuracy, and add
support for FM+ in a separate patch?

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