From: Geert Uytterhoeven <geert@linux-m68k.org>
To: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>,
linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 4/4] media: rcar-csi2: Add D-PHY support for V4H
Date: Thu, 12 Jun 2025 13:19:45 +0200 [thread overview]
Message-ID: <CAMuHMdVueS4Dhu0e5DJSEDD1Pt-3Ay3tmjs5Jm-5Z2xQXr4XVQ@mail.gmail.com> (raw)
In-Reply-To: <20250612100112.GH330732@ragnatech.se>
On Thu, 12 Jun 2025 at 12:01, Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.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@linux-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
next prev parent reply other threads:[~2025-06-12 11:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-11 15:44 [PATCH v3 0/4] media: rcar-csi2: Add D-PHY support for V4H` Niklas Söderlund
2025-06-11 15:44 ` [PATCH v3 1/4] media: rcar-csi2: Clarify usage of mbps and msps Niklas Söderlund
2025-06-11 15:44 ` [PATCH v3 2/4] media: rcar-csi2: Rework macros to access AFE lanes Niklas Söderlund
2025-06-11 15:44 ` [PATCH v3 3/4] media: rcar-csi2: Update start procedure for V4H Niklas Söderlund
2025-06-11 15:44 ` [PATCH v3 4/4] media: rcar-csi2: Add D-PHY support " Niklas Söderlund
2025-06-11 23:04 ` Laurent Pinchart
2025-06-12 10:01 ` Niklas Söderlund
2025-06-12 11:19 ` Geert Uytterhoeven [this message]
2025-06-12 12:27 ` Niklas Söderlund
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMuHMdVueS4Dhu0e5DJSEDD1Pt-3Ay3tmjs5Jm-5Z2xQXr4XVQ@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=geert+renesas@glider.be \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=niklas.soderlund+renesas@ragnatech.se \
--cc=sakari.ailus@linux.intel.com \
--cc=tomi.valkeinen+renesas@ideasonboard.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).