public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Biju Das" <biju.das.jz@bp.renesas.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Wolfram Sang" <wsa@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Andrzej Hajda" <andrzej.hajda@intel.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Robert Foss" <rfoss@kernel.org>,
	"David Airlie" <airlied@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Kieran Bingham" <kieran.bingham@ideasonboard.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Hans Verkuil" <hverkuil-cisco@xs4all.nl>,
	"Alessandro Zummo" <a.zummo@towertech.it>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Corey Minyard" <cminyard@mvista.com>,
	"Marek Behún" <kabel@kernel.org>,
	"Jiasheng Jiang" <jiasheng@iscas.ac.cn>,
	"Antonio Borneo" <antonio.borneo@foss.st.com>,
	"Abhinav Kumar" <quic_abhinavk@quicinc.com>,
	"Ahmad Fatoum" <a.fatoum@pengutronix.de>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"Fabrizio Castro" <fabrizio.castro.jz@renesas.com>,
	"linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>,
	"Mark Brown" <broonie@kernel.org>,
	"Trent Piepho" <tpiepho@gmail.com>
Subject: Re: [PATCH v5 01/11] i2c: Enhance i2c_new_ancillary_device API
Date: Mon, 12 Jun 2023 16:19:17 +0300	[thread overview]
Message-ID: <20230612131917.GD23921@pendragon.ideasonboard.com> (raw)
In-Reply-To: <CAMuHMdV_xw-+_MakVeLVgv1nCW_GqKQ2hiEfb5J-p2WiSvWV_g@mail.gmail.com>

Hi Geert,

On Mon, Jun 12, 2023 at 03:08:46PM +0200, Geert Uytterhoeven wrote:
> On Mon, Jun 12, 2023 at 2:54 PM Laurent Pinchart wrote:
> > On Mon, Jun 12, 2023 at 12:42:33PM +0000, Biju Das wrote:
> > > > Subject: Re: [PATCH v5 01/11] i2c: Enhance i2c_new_ancillary_device API
> > > > On Mon, Jun 12, 2023 at 09:53:02AM +0000, Biju Das wrote:
> > > > > How do we proceed here between [1] and [2]?
> > > > >
> > > > > DT-Maintainers suggestion:
> > > > > [1]
> > > > > raa215300: pmic@12 {
> > > > >   compatible = "renesas,raa215300";
> > > > >   reg = <0x12>, <0x6f>;
> > > > >   reg-names = "main", "rtc";
> > > > >
> > > > >   clocks = <&x2>;
> > > > >   clock-names = "xin";
> > > > >   /* Add Optional shared IRQ resource and share it to child and handle
> > > > > it both in parent and child */ };
> > > > >
> > > > > Laurent/Wolfram suggestion to split it into two nodes and get rid of this patch:
> > > > > [2]
> > > > >   raa215300: pmic @12 {
> > > > >           compatible = "renesas,raa215300";
> > > > >           reg = <0x12>;
> > > > >
> > > > >           /* Add Optional shared IRQ */
> > > > >           renesas,raa215300-rtc = <&rtc_raa215300>; /* Parse the handle and Enable RTC , if present.*/
> > > > >   };
> > > > >
> > > > >   rtc_raa215300: rtc@6f {
> > > > >           compatible = "renesas,raa215300-isl1208";
> > > >
> > > > Make this
> > > >
> > > >             compatible = "renesas,raa215300-isl1208", "isil,isl1208";
> > > >
> > > > >           reg = <0x6f>;
> > > > >
> > > > >           /* Add Optional shared IRQ */
> > > > >           clocks = <&x2>;
> > > > >           clock-names = "xin";
> > > > >           renesas,raa215300-pmic = <&pmic>; /* Parse the handle to get PMIC
> > > > > version to check Oscillator bit is inverted or not */
> > > >
> > > > This isn't nice. I would instead add a renesas,invert-xtoscb boolean
> > > > property. If you don't want different DT sources for different revisions
> > > > of the PMIC,
> > >
> > > I need to support all PMIC versions with same image, as PMIC is just a component on the
> > > SoM module. So SoM's have different PMIC versions.
> >
> > I understand it's not convenient, so let's try to find a good solution.
> >
> > > > one option is to perform the auto-detection in the boot
> > > > loader and update the DT dynamically there.
> > >
> > > Yes, this is an option. Bootloader updates "renesas,invert-xtoscb" property based
> > > on PMIC version.
> > >
> > > Not sure, From binding perspective, Documenting "renesas,invert-xtoscb" is OK for
> > > the relevant maintainers??
> >
> > It's fine with me at least :-) I think a property makes sense, as it
> > describes the device. Updating the device tree in the boot loader based
> > on auto-detection of features is also fairly common (to set the amount
> > of DRAM for instance).
> >
> > What I'm not entirely sure about in this case is if a property would be
> > the best option, or two different compatible strings. I'll let the
> > appropriate maintainer recommend one of those two options. In either
> > case, the boot loader would be responsible for updating the DT.
> 
> Indeed. DT binding best practices 101: do not use properties to
> distinguish, use compatible values instead.
> 
> And don't use different compatible values if you can distinguish using
> a version register.  Unfortunately the version register is part of the
> main/first device (the PMIC), so the RTC cannot find out easily...

That's not very different from having IP cores whose integration is
different between different SoC versions. We could easily add SoC match
code in drivers and map the SoC version to integration data, but it's
not a good practice. DT helps decoupling integration (and quirks) from
drivers and allows getting rid of lots of cross-driver communication
(which used to be handled through board files).

> So basically you have an i2c mfd.  The Linux mfd subsystem is tailored
> for platform devices, so it's not a good match.  The closest we have
> in i2c is the ancillary device...

I think an MFD-type solution that's way too much trouble to handle the
issue at hand. I recommend a DT property here.

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2023-06-12 13:19 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230522101849.297499-1-biju.das.jz@bp.renesas.com>
2023-05-22 10:18 ` [PATCH v5 01/11] i2c: Enhance i2c_new_ancillary_device API Biju Das
2023-05-23  9:50   ` Hans Verkuil
2023-05-25 16:49   ` Geert Uytterhoeven
2023-05-29  8:05   ` Laurent Pinchart
2023-05-29  9:00     ` Biju Das
2023-05-31  8:59       ` Laurent Pinchart
2023-05-31  9:34         ` Biju Das
2023-05-31 11:41           ` Laurent Pinchart
2023-05-31 12:53             ` Biju Das
2023-05-31 13:35               ` Laurent Pinchart
2023-05-31 13:44                 ` Biju Das
2023-06-02  7:40                   ` Biju Das
2023-05-31 13:37               ` Geert Uytterhoeven
2023-05-31 13:47                 ` Biju Das
2023-05-31 12:51         ` Geert Uytterhoeven
2023-05-31 13:37           ` Laurent Pinchart
2023-05-31 13:39             ` Geert Uytterhoeven
2023-06-05  9:30           ` Wolfram Sang
2023-06-07  8:53           ` Wolfram Sang
2023-06-07 10:58             ` Biju Das
2023-06-08  6:41               ` Biju Das
2023-06-08 10:39                 ` Laurent Pinchart
2023-06-08 11:00                   ` Biju Das
2023-06-08 12:50                     ` Laurent Pinchart
2023-06-08 12:57                       ` Biju Das
2023-06-12  9:53                         ` Biju Das
2023-06-12 12:23                           ` Laurent Pinchart
2023-06-12 12:42                             ` Biju Das
2023-06-12 12:54                               ` Laurent Pinchart
2023-06-12 13:08                                 ` Geert Uytterhoeven
2023-06-12 13:19                                   ` Laurent Pinchart [this message]
2023-06-12 12:44                             ` Geert Uytterhoeven
2023-06-12 13:02                               ` Laurent Pinchart
2023-06-12 12:35                           ` Wolfram Sang
2023-06-12 12:42                             ` Geert Uytterhoeven
2023-06-12 12:48                               ` Wolfram Sang
2023-06-12 13:00                                 ` Geert Uytterhoeven
2023-06-12 20:43                                   ` Wolfram Sang
2023-06-13  7:24                                     ` Biju Das
2023-06-13 17:57                                       ` Biju Das
2023-06-13 19:31                                         ` Biju Das
2023-06-14  8:13                                           ` Laurent Pinchart
2023-06-14  8:21                                             ` Biju Das
2023-06-14  9:18                                               ` Geert Uytterhoeven
2023-06-14 11:04                                                 ` Biju Das
2023-06-15  9:00                                                   ` Geert Uytterhoeven
2023-06-14  9:54                                               ` Laurent Pinchart
2023-06-14 11:30                                                 ` Biju Das
2023-06-15  9:26                                                   ` Laurent Pinchart
2023-06-20  8:06                                                     ` Biju Das
2023-06-13  7:25                                     ` Geert Uytterhoeven
2023-06-13 10:45                                       ` Biju Das
2023-06-13 14:51                                         ` Geert Uytterhoeven
2023-06-13 16:11                                           ` Biju Das
2023-06-14  7:53                                             ` Geert Uytterhoeven
2023-06-14  8:02                                               ` Biju Das
2023-06-15  8:07                                               ` Geert Uytterhoeven
2023-06-15  9:23                                                 ` Laurent Pinchart
2023-06-16  6:32                                                   ` Wolfram Sang
2023-06-19  8:17                                                     ` Biju Das
2023-06-12 13:00                             ` Biju Das

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=20230612131917.GD23921@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=a.fatoum@pengutronix.de \
    --cc=a.zummo@towertech.it \
    --cc=airlied@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrzej.hajda@intel.com \
    --cc=antonio.borneo@foss.st.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=broonie@kernel.org \
    --cc=cminyard@mvista.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fabrizio.castro.jz@renesas.com \
    --cc=geert@linux-m68k.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jernej.skrabec@gmail.com \
    --cc=jiasheng@iscas.ac.cn \
    --cc=jonas@kwiboo.se \
    --cc=kabel@kernel.org \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=rfoss@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=tpiepho@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wsa@kernel.org \
    /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