[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVueS4Dhu0e5DJSEDD1Pt-3Ay3tmjs5Jm-5Z2xQXr4XVQ@mail.gmail.com>
Date: Thu, 12 Jun 2025 13:19:45 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Niklas Söderlund <niklas.soderlund+renesas@...natech.se>
Cc: Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>, Geert Uytterhoeven <geert+renesas@...der.be>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Tomi Valkeinen <tomi.valkeinen+renesas@...asonboard.com>, linux-media@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 4/4] media: rcar-csi2: Add D-PHY support for V4H
On Thu, 12 Jun 2025 at 12:01, Niklas Söderlund
<niklas.soderlund+renesas@...natech.se> wrote:
> On 2025-06-12 02:04:12 +0300, Laurent Pinchart wrote:
> > > --- a/drivers/media/platform/renesas/rcar-csi2.c
> > > +++ b/drivers/media/platform/renesas/rcar-csi2.c
> > > + if (mbps >= 80) {
> > > + if (mbps >= 2560)
> > > + val = 6;
> > > + else if (mbps >= 1280)
> > > + val = 5;
> > > + else if (mbps >= 640)
> > > + val = 4;
> > > + else if (mbps >= 320)
> > > + val = 3;
> > > + else if (mbps >= 160)
> > > + val = 2;
> > > + else if (mbps >= 80)
> > > + val = 1;
> >
> > You could possibly replace this with
> >
> > val = ilog2(mbps / 80) + 1;
> >
> > Up to you.
>
> I opted to keep it as is to make it easier to match with the datasheet.
> The ilog2() is clever but I will never remember why it was used ;-)
+1 for ilog2() ;-)
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