Re: [PATCH v4 2/3] dt-bindings: iio: adc: add adi,max11410.yaml

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

> > On Thu, 8 Sep 2022 17:49:23 +0300
> > Ibrahim Tilki <Ibrahim.Tilki@xxxxxxxxxx> wrote:
> >   
> > > Adding devicetree binding documentation for max11410 adc.
> > > 
> > > Signed-off-by: Ibrahim Tilki <Ibrahim.Tilki@xxxxxxxxxx>
> > > ---
> > >  .../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




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux