[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <OS0PR01MB59220606B18F59EAEA7BDECA862E9@OS0PR01MB5922.jpnprd01.prod.outlook.com>
Date: Mon, 24 Oct 2022 17:25:39 +0000
From: Biju Das <biju.das.jz@...renesas.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
CC: Wolfgang Grandegger <wg@...ndegger.com>,
Marc Kleine-Budde <mkl@...gutronix.de>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Vincent Mailhol <mailhol.vincent@...adoo.fr>,
Stefan Mätje <stefan.maetje@....eu>,
Ulrich Hecht <uli+renesas@...nd.eu>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@...renesas.com>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
"linux-can@...r.kernel.org" <linux-can@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Chris Paterson <Chris.Paterson2@...esas.com>,
Biju Das <biju.das@...renesas.com>,
"linux-renesas-soc@...r.kernel.org"
<linux-renesas-soc@...r.kernel.org>
Subject: RE: [PATCH 4/6] can: rcar_canfd: Add clk_postdiv to struct
rcar_canfd_hw_info
Hi Geert,
Thanks for the feedback.
> Subject: Re: [PATCH 4/6] can: rcar_canfd: Add clk_postdiv to struct
> rcar_canfd_hw_info
>
> Hi Biju,
>
> On Sat, Oct 22, 2022 at 1:03 PM Biju Das <biju.das.jz@...renesas.com>
> wrote:
> > R-Car has a clock divider for CAN FD clock within the IP, whereas it
> > is not available on RZ/G2L.
> >
> > Add clk_postdiv to struct rcar_canfd_hw_info to take care of this
> > difference.
> >
> > Signed-off-by: Biju Das <biju.das.jz@...renesas.com>
>
> Thanks for your patch!
>
> > --- a/drivers/net/can/rcar/rcar_canfd.c
> > +++ b/drivers/net/can/rcar/rcar_canfd.c
> > @@ -528,6 +528,7 @@ struct rcar_canfd_hw_info {
> > u32 max_channels;
> > /* hardware features */
> > unsigned multi_global_irqs:1; /* Has multiple global irqs
> */
> > + unsigned clk_postdiv:1; /* Has CAN clk post divider
> */
>
> As this is not the actual post divider, I think this should be called
> has_clk_postdiv. But see below...
OK will use driver data " postdiv" instead as mentioned below.
>
> > };
> >
> > /* Channel priv data */
>
> > @@ -1948,7 +1951,7 @@ static int rcar_canfd_probe(struct
> platform_device *pdev)
> > }
> > fcan_freq = clk_get_rate(gpriv->can_clk);
> >
> > - if (gpriv->fcan == RCANFD_CANFDCLK && info->chip_id !=
> RENESAS_RZG2L)
> > + if (gpriv->fcan == RCANFD_CANFDCLK && info->clk_postdiv)
> > /* CANFD clock is further divided by (1/2) within
> the IP */
> > fcan_freq /= 2;
>
> If info->clk_postdiv would be the actual post divider, you could
> simplify to:
>
> if (gpriv->fcan == RCANFD_CANFDCLK)
> fcan_freq /= info->postdiv;
Agreed.
Thanks and regards,
Biju
Powered by blists - more mailing lists