devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andreas Kemnade <andreas@kemnade.info>
Cc: lee.jones@linaro.org, robh+dt@kernel.org, lars@metafoo.de,
	sre@kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	linux-pm@vger.kernel.org, leonard.crestez@nxp.com,
	letux-kernel@openphoenux.org
Subject: Re: [PATCH 2/4] mfd: rn5t618: Add of compatibles for ADC and power
Date: Sun, 4 Jul 2021 17:17:26 +0100	[thread overview]
Message-ID: <20210704171726.299ed620@jic23-huawei> (raw)
In-Reply-To: <20210703183111.2b2b9b4f@aktux>

On Sat, 3 Jul 2021 18:31:11 +0200
Andreas Kemnade <andreas@kemnade.info> wrote:

> Hi,
> 
> On Sat, 3 Jul 2021 17:04:05 +0100
> Jonathan Cameron <jic23@kernel.org> wrote:
> 
> > On Sat,  3 Jul 2021 10:42:22 +0200
> > Andreas Kemnade <andreas@kemnade.info> wrote:
> >   
> > > This allows having devicetree nodes for the subdevices.
> > > 
> > > Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> > > ---
> > >  drivers/mfd/rn5t618.c | 6 ++++--
> > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/mfd/rn5t618.c b/drivers/mfd/rn5t618.c
> > > index 384acb459427..b916c7471ca3 100644
> > > --- a/drivers/mfd/rn5t618.c
> > > +++ b/drivers/mfd/rn5t618.c
> > > @@ -24,8 +24,10 @@ static const struct mfd_cell rn5t618_cells[] = {
> > >  };
> > >  
> > >  static const struct mfd_cell rc5t619_cells[] = {
> > > -	{ .name = "rn5t618-adc" },
> > > -	{ .name = "rn5t618-power" },
> > > +	{ .name = "rn5t618-adc",
> > > +	  .of_compatible = "ricoh,rc5t619-adc" },    
> > 
> > Odd to have a name of 618 and a compatible of 619.  Why?
> > Definitely deserves a comment if this is necessary for some reason!
> >   
> Background of this whole thing:
> Both RN5T618 and RC5T619 have an ADC. I would expect the driver to work
> for both but I cannot prove that. No RN5T618 here to test. Maybe it
> requires some quirks, probably not. The only hint I have is that
> a) I use register definitions added to the kernel for RN5T618 support
> b) public datasheets looks same regarding the ADC.
> c) out-of-tree code for the RN5T618 does not give a clear picture, it
> shows no differences but is not complete enough to judge.
> 
> To avoid introducing untested things, I am only adding it to the
> rc5t619_cell list. I would really hope that someone does some rn5t618
> tests... Because everything else which is both for the RN5T618 and
> RC5T619 uses rn5t618 as a name, I continued that practise.
> 
> The subdevice driver also gets the information whether it is a rn5t618
> or rc5t619 via rn5t618->variant, so it can handle things.
> 
> > > +	{ .name = "rn5t618-power",
> > > +	  .of_compatible = "ricoh,rc5t619-power" },  
> 
> Similar situation here.
> 
> > >  	{ .name = "rn5t618-regulator" },
> > >  	{ .name = "rc5t619-rtc" },  
> and this one definitively only exists in the rc5t619.

All sounds reasonable to me.
Dt binding wise we'd normally handle this with a double compatible,
with the more part specific one first.  That way we can diverge later
if we need to, but don't need to care about it until an identified need
has occurred.

compatible = "ricoh,rc5t619-adc", "ricoh,rc5t618-adc";  (or something like that) 

Anyhow, for now perhaps a comment to express briefly what you state above.

> 
> > >  	{ .name = "rn5t618-wdt" },    
> > 
> >   
> 
> Regards,
> Andreas


  reply	other threads:[~2021-07-04 16:15 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-03  8:42 [PATCH 0/4] mfd: rn5t618: Extend ADC support Andreas Kemnade
2021-07-03  8:42 ` [PATCH 1/4] dt-bindings: mfd: ricoh,rn5t618: ADC related nodes and properties Andreas Kemnade
2021-07-03 16:02   ` Jonathan Cameron
2021-07-03 16:43     ` Andreas Kemnade
2021-07-12 14:41     ` Rob Herring
2021-07-03  8:42 ` [PATCH 2/4] mfd: rn5t618: Add of compatibles for ADC and power Andreas Kemnade
2021-07-03 16:04   ` Jonathan Cameron
2021-07-03 16:31     ` Andreas Kemnade
2021-07-04 16:17       ` Jonathan Cameron [this message]
2021-07-05  7:36     ` Lee Jones
2021-07-05  8:31       ` Jonathan Cameron
2021-07-05 10:03         ` Andreas Kemnade
2021-07-05  7:37   ` Lee Jones
2021-07-03  8:42 ` [PATCH 3/4] iio: rn5t618: Add devicetree support Andreas Kemnade
2021-07-03 16:12   ` Jonathan Cameron
2021-07-03  8:42 ` [PATCH 4/4] power: supply: rn5t618: Add voltage_now property Andreas Kemnade
2021-07-03 11:41   ` kernel test robot
2021-07-03 14:35   ` kernel test robot
2021-07-03 15:29     ` Andreas Kemnade
2021-07-03 16:12   ` Jonathan Cameron
2021-07-03 15:59 ` [PATCH 0/4] mfd: rn5t618: Extend ADC support Jonathan Cameron
2021-07-03 16:39   ` Andreas Kemnade
2021-07-03 16:55     ` [Letux-kernel] " Andreas Kemnade
2021-07-04 16:10       ` Jonathan Cameron
2021-07-05 11:18         ` Andreas Kemnade

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=20210704171726.299ed620@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andreas@kemnade.info \
    --cc=devicetree@vger.kernel.org \
    --cc=lars@metafoo.de \
    --cc=lee.jones@linaro.org \
    --cc=leonard.crestez@nxp.com \
    --cc=letux-kernel@openphoenux.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sre@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;
as well as URLs for NNTP newsgroup(s).