linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Tilki, Ibrahim" <Ibrahim.Tilki@analog.com>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"Sa, Nuno" <Nuno.Sa@analog.com>,
	"Bolucu, Nurettin" <Nurettin.Bolucu@analog.com>
Subject: Re: [PATCH v4 2/3] dt-bindings: iio: adc: add adi,max11410.yaml
Date: Sat, 24 Sep 2022 14:58:28 +0100	[thread overview]
Message-ID: <20220924145828.27659029@jic23-huawei> (raw)
In-Reply-To: <DM8PR03MB62477EAB8BCF6862032B30C5964C9@DM8PR03MB6247.namprd03.prod.outlook.com>

On Tue, 20 Sep 2022 15:27:23 +0000
"Tilki, Ibrahim" <Ibrahim.Tilki@analog.com> wrote:

> > On Thu, 8 Sep 2022 17:49:23 +0300
> > Ibrahim Tilki <Ibrahim.Tilki@analog.com> wrote:
> >   
> > > Adding devicetree binding documentation for max11410 adc.
> > > 
> > > Signed-off-by: Ibrahim Tilki <Ibrahim.Tilki@analog.com>
> > > ---
> > >  .../bindings/iio/adc/adi,max11410.yaml        | 174 ++++++++++++++++++
> > >  1 file changed, 174 insertions(+)
> > >  create mode 100644 
> > > Documentation/devicetree/bindings/iio/adc/adi,max11410.yaml
> > > 
> > > diff --git 
> > > a/Documentation/devicetree/bindings/iio/adc/adi,max11410.yaml 
> > > b/Documentation/devicetree/bindings/iio/adc/adi,max11410.yaml
...

> > > +
> > > +  interrupt-names:
> > > +    description: Name of the gpio pin of max11410 used for IRQ
> > > +    maxItems: 1
> > > +    items:
> > > +      enum:
> > > +        - gpio0
> > > +        - gpio1
> > > +
> > > +  '#address-cells':
> > > +    const: 1
> > > +
> > > +  '#size-cells':
> > > +    const: 0
> > > +
> > > +  avdd-supply:
> > > +    description: Necessarry avdd supply. Used as reference when no explicit reference supplied.
> > > +
> > > +  vref0p-supply:
> > > +    description: vref0p supply can be used as reference for conversion.
> > > +
> > > +  vref1p-supply:
> > > +    description: vref1p supply can be used as reference for conversion.
> > > +
> > > +  vref2p-supply:
> > > +    description: vref2p supply can be used as reference for conversion.
> > > +
> > > +  vref0n-supply:
> > > +    description: vref0n supply can be used as reference for conversion.
> > > +
> > > +  vref1n-supply:
> > > +    description: vref1n supply can be used as reference for conversion.
> > > +
> > > +  vref2n-supply:
> > > +    description: vref2n supply can be used as reference for conversion.
> > > +
> > > +  spi-max-frequency:
> > > +    maximum: 8000000
> > > +
> > > +required:
> > > +  - compatible
> > > +  - reg
> > > +  - avdd-supply  
> > hmm.
> > 
> > If explicit references are supplied and used, then will we query the voltage of the avdd supply?  If not, it doesn't need to be supplied. Power is needed but it might be coming from a fixed regulator no one bothered to put in the device tree.  Perhaps we just don't care about that corner case?
> >   
> 
> That is correct. If all of the channels use external vref, then avdd-supply
> is no longer required. It is fine by me if we ignore this corner case.
> 
> Current driver checks for avdd-supply unconditionally. Maybe we can change the
> driver so that it results in error only if one of the channels use avdd as reference
> in the absence of avdd-supply?

Does it query the voltage in this corner case?  I don't think it does.
If that's the case, you are fine getting it and if not supplied (and various
other conditions are met) the regulator core will provide a stub regulator
that will work fine here.  All we might want to do is remove the required
line from the binding.

> 
> 
> > > +
> > > +patternProperties:
> > > +  "^channel(@[0-9a-f]+)?$":  
> > 
> > name isn't that flexible as we only allow reg 0-9
> >   
> 
> I changed it to "^channel(@[0-9])?$" in v5 but will this allow us to define
> more than 10 channels? Sharing analog inputs accross multiple channels is
> supported by driver. But I don't know how to correctly specify it here.
> For example following configuration is valid:

Ah. I'd not understood this correctly.
The adc.yaml binding requires the @X number to match with reg.
It doesn't provide a way to not have an @reg.

Interesting corner case if you have overlap of single ended and differential
channels.  I guess we could specify reg as have no meaning for differential
channels other than as an index.  Not sure what the DT maintainers would think
of that though.  It isn't obvious what we should set reg to for differential
channels.

Ah. That meant I just checked if this had gone to the right people.
For all dt-bindings you need to +CC the list and maintainers listed
in MAINTAINERS.  They aren't going to see the binding otherwise and
I won't take a new binding without their review.

> 
>   channel@0 {
>     reg = <0>;
>   };
>   channel@1 {
>     reg = <1>;
>   };
>   channel@2 {
>     reg = <2>;
>   };
>   channel@3 {
>     reg = <3>;
>   };
>   channel@4 {
>     reg = <4>;
>   };
>   channel@5 {
>     reg = <5>;
>   };
>   channel@6 {
>     reg = <6>;
>   };
>   channel@7 {
>     reg = <7>;
>   };
>   channel@8 {
>     reg = <8>;
>   };
>   channel@9 {
>     reg = <9>;
>   };
>   channel@a {
>     diff-channels = <1 2>;
>   };
>   channel@b {
>     diff-channels = <7 9>;
>   };
> 

Thanks,

Joanthan


  reply	other threads:[~2022-09-24 13:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08 14:49 [PATCH v4 0/3] iio: adc: add max11410 adc driver Ibrahim Tilki
2022-09-08 14:49 ` [PATCH v4 1/3] " Ibrahim Tilki
2022-09-18 15:17   ` Jonathan Cameron
2022-09-08 14:49 ` [PATCH v4 2/3] dt-bindings: iio: adc: add adi,max11410.yaml Ibrahim Tilki
2022-09-18 15:22   ` Jonathan Cameron
2022-09-20 15:27     ` Tilki, Ibrahim
2022-09-24 13:58       ` Jonathan Cameron [this message]
2022-09-08 14:49 ` [PATCH v4 3/3] Documentation: ABI: testing: add max11410 doc Ibrahim Tilki
2022-09-18 15:26   ` Jonathan Cameron

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=20220924145828.27659029@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Ibrahim.Tilki@analog.com \
    --cc=Nuno.Sa@analog.com \
    --cc=Nurettin.Bolucu@analog.com \
    --cc=linux-iio@vger.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).