linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: iio: afe: current-sense-shunt: add io-channel-cells
@ 2021-05-06 15:06 Krzysztof Kozlowski
  2021-05-07 22:16 ` Rob Herring
  2021-05-07 22:44 ` Peter Rosin
  0 siblings, 2 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2021-05-06 15:06 UTC (permalink / raw)
  To: Peter Rosin, Jonathan Cameron, Lars-Peter Clausen, Rob Herring,
	linux-iio, devicetree, linux-kernel
  Cc: Krzysztof Kozlowski

The current-sense-shunt is an IIO provider thus can be referenced by IIO
consumers (via "io-channels" property in consumer device node).
Such provider is required to describe number of cells used in phandle
lookup with "io-channel-cells" property.  This also fixes dtbs_check
warnings like:

  arch/arm/boot/dts/s5pv210-fascinate4g.dt.yaml: current-sense-shunt:
    '#io-channel-cells' does not match any of the regexes: 'pinctrl-[0-9]+'

Fixes: ce66e52b6c16 ("dt-bindings:iio:afe:current-sense-shunt: txt to yaml conversion.")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
 .../devicetree/bindings/iio/afe/current-sense-shunt.yaml     | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml b/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml
index 90439a8dc785..05166d8a3124 100644
--- a/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml
+++ b/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml
@@ -24,12 +24,16 @@ properties:
     description: |
       Channel node of a voltage io-channel.
 
+  "#io-channel-cells":
+    const: 0
+
   shunt-resistor-micro-ohms:
     description: The shunt resistance.
 
 required:
   - compatible
   - io-channels
+  - "#io-channel-cells"
   - shunt-resistor-micro-ohms
 
 additionalProperties: false
@@ -57,6 +61,7 @@ examples:
     sysi {
         compatible = "current-sense-shunt";
         io-channels = <&tiadc 0>;
+        #io-channel-cells = <0>;
 
         /* Divide the voltage by 3300000/1000000 (or 3.3) for the current. */
         shunt-resistor-micro-ohms = <3300000>;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: iio: afe: current-sense-shunt: add io-channel-cells
  2021-05-06 15:06 [PATCH] dt-bindings: iio: afe: current-sense-shunt: add io-channel-cells Krzysztof Kozlowski
@ 2021-05-07 22:16 ` Rob Herring
  2021-05-07 22:44 ` Peter Rosin
  1 sibling, 0 replies; 6+ messages in thread
From: Rob Herring @ 2021-05-07 22:16 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Lars-Peter Clausen, linux-iio, linux-kernel, Peter Rosin,
	Rob Herring, devicetree, Jonathan Cameron

On Thu, 06 May 2021 11:06:37 -0400, Krzysztof Kozlowski wrote:
> The current-sense-shunt is an IIO provider thus can be referenced by IIO
> consumers (via "io-channels" property in consumer device node).
> Such provider is required to describe number of cells used in phandle
> lookup with "io-channel-cells" property.  This also fixes dtbs_check
> warnings like:
> 
>   arch/arm/boot/dts/s5pv210-fascinate4g.dt.yaml: current-sense-shunt:
>     '#io-channel-cells' does not match any of the regexes: 'pinctrl-[0-9]+'
> 
> Fixes: ce66e52b6c16 ("dt-bindings:iio:afe:current-sense-shunt: txt to yaml conversion.")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> ---
>  .../devicetree/bindings/iio/afe/current-sense-shunt.yaml     | 5 +++++
>  1 file changed, 5 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: iio: afe: current-sense-shunt: add io-channel-cells
  2021-05-06 15:06 [PATCH] dt-bindings: iio: afe: current-sense-shunt: add io-channel-cells Krzysztof Kozlowski
  2021-05-07 22:16 ` Rob Herring
@ 2021-05-07 22:44 ` Peter Rosin
  2021-05-08 15:59   ` Jonathan Cameron
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Rosin @ 2021-05-07 22:44 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Jonathan Cameron, Lars-Peter Clausen,
	Rob Herring, linux-iio, devicetree, linux-kernel

Hi!

On 2021-05-06 17:06, Krzysztof Kozlowski wrote:
> The current-sense-shunt is an IIO provider thus can be referenced by IIO
> consumers (via "io-channels" property in consumer device node).
> Such provider is required to describe number of cells used in phandle
> lookup with "io-channel-cells" property.  This also fixes dtbs_check
> warnings like:
> 
>   arch/arm/boot/dts/s5pv210-fascinate4g.dt.yaml: current-sense-shunt:
>     '#io-channel-cells' does not match any of the regexes: 'pinctrl-[0-9]+'
> 
> Fixes: ce66e52b6c16 ("dt-bindings:iio:afe:current-sense-shunt: txt to yaml conversion.")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> ---
>  .../devicetree/bindings/iio/afe/current-sense-shunt.yaml     | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml b/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml
> index 90439a8dc785..05166d8a3124 100644
> --- a/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml
> +++ b/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml
> @@ -24,12 +24,16 @@ properties:
>      description: |
>        Channel node of a voltage io-channel.
>  
> +  "#io-channel-cells":
> +    const: 0
> +
>    shunt-resistor-micro-ohms:
>      description: The shunt resistance.
>  
>  required:
>    - compatible
>    - io-channels
> +  - "#io-channel-cells"
>    - shunt-resistor-micro-ohms

I know I'm listed as maintainer and all, but I have not kept up with the yaml
conversion. Sorry. So, given that I might very well fundamentally misunderstand
something, it does not sound correct that #io-channel-cells is now "required".
I regard it as optional, and only needed if some other in-kernel driver is
consuming the sensed current. What am I missing?

Also, whatever is done in this binding should preferably also be done in the
two "sister" afe bindings, i.e. current-sense-amplifier and voltage-divider.

Cheers,
Peter

>  additionalProperties: false
> @@ -57,6 +61,7 @@ examples:
>      sysi {
>          compatible = "current-sense-shunt";
>          io-channels = <&tiadc 0>;
> +        #io-channel-cells = <0>;
>  
>          /* Divide the voltage by 3300000/1000000 (or 3.3) for the current. */
>          shunt-resistor-micro-ohms = <3300000>;
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: iio: afe: current-sense-shunt: add io-channel-cells
  2021-05-07 22:44 ` Peter Rosin
@ 2021-05-08 15:59   ` Jonathan Cameron
  2021-05-10 12:17     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Cameron @ 2021-05-08 15:59 UTC (permalink / raw)
  To: Peter Rosin
  Cc: Krzysztof Kozlowski, Lars-Peter Clausen, Rob Herring, linux-iio,
	devicetree, linux-kernel

On Sat, 8 May 2021 00:44:58 +0200
Peter Rosin <peda@axentia.se> wrote:

> Hi!
> 
> On 2021-05-06 17:06, Krzysztof Kozlowski wrote:
> > The current-sense-shunt is an IIO provider thus can be referenced by IIO
> > consumers (via "io-channels" property in consumer device node).
> > Such provider is required to describe number of cells used in phandle
> > lookup with "io-channel-cells" property.  This also fixes dtbs_check
> > warnings like:
> > 
> >   arch/arm/boot/dts/s5pv210-fascinate4g.dt.yaml: current-sense-shunt:
> >     '#io-channel-cells' does not match any of the regexes: 'pinctrl-[0-9]+'
> > 
> > Fixes: ce66e52b6c16 ("dt-bindings:iio:afe:current-sense-shunt: txt to yaml conversion.")
> > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> > ---
> >  .../devicetree/bindings/iio/afe/current-sense-shunt.yaml     | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml b/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml
> > index 90439a8dc785..05166d8a3124 100644
> > --- a/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml
> > +++ b/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml
> > @@ -24,12 +24,16 @@ properties:
> >      description: |
> >        Channel node of a voltage io-channel.
> >  
> > +  "#io-channel-cells":
> > +    const: 0
> > +
> >    shunt-resistor-micro-ohms:
> >      description: The shunt resistance.
> >  
> >  required:
> >    - compatible
> >    - io-channels
> > +  - "#io-channel-cells"
> >    - shunt-resistor-micro-ohms  
> 
> I know I'm listed as maintainer and all, but I have not kept up with the yaml
> conversion. Sorry. So, given that I might very well fundamentally misunderstand
> something, it does not sound correct that #io-channel-cells is now "required".
> I regard it as optional, and only needed if some other in-kernel driver is
> consuming the sensed current. What am I missing?
> 

Agreed. This should be optional and I have deliberately not introduced it
into all the bindings that could in theory support being used as providers.

So far I've not pushed it out in a blanket fashion into existing bindings
even as optional.

> Also, whatever is done in this binding should preferably also be done in the
> two "sister" afe bindings, i.e. current-sense-amplifier and voltage-divider.

This particular case is squashing an error, so whilst I'm happy to have those
gain the binding addition, I would like to see them in a separate patch as
less likely they'd get back ported.

If Kryysztof is fine with me just dropping the required I can pick up this patch.

Thanks,

Jonathan

> 
> Cheers,
> Peter
> 
> >  additionalProperties: false
> > @@ -57,6 +61,7 @@ examples:
> >      sysi {
> >          compatible = "current-sense-shunt";
> >          io-channels = <&tiadc 0>;
> > +        #io-channel-cells = <0>;
> >  
> >          /* Divide the voltage by 3300000/1000000 (or 3.3) for the current. */
> >          shunt-resistor-micro-ohms = <3300000>;
> >   


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: iio: afe: current-sense-shunt: add io-channel-cells
  2021-05-08 15:59   ` Jonathan Cameron
@ 2021-05-10 12:17     ` Krzysztof Kozlowski
  2021-05-11 14:19       ` Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2021-05-10 12:17 UTC (permalink / raw)
  To: Jonathan Cameron, Peter Rosin
  Cc: Lars-Peter Clausen, Rob Herring, linux-iio, devicetree, linux-kernel

On 08/05/2021 11:59, Jonathan Cameron wrote:
> On Sat, 8 May 2021 00:44:58 +0200
> Peter Rosin <peda@axentia.se> wrote:
> 
>> Hi!
>>
>> On 2021-05-06 17:06, Krzysztof Kozlowski wrote:
>>> The current-sense-shunt is an IIO provider thus can be referenced by IIO
>>> consumers (via "io-channels" property in consumer device node).
>>> Such provider is required to describe number of cells used in phandle
>>> lookup with "io-channel-cells" property.  This also fixes dtbs_check
>>> warnings like:
>>>
>>>   arch/arm/boot/dts/s5pv210-fascinate4g.dt.yaml: current-sense-shunt:
>>>     '#io-channel-cells' does not match any of the regexes: 'pinctrl-[0-9]+'
>>>
>>> Fixes: ce66e52b6c16 ("dt-bindings:iio:afe:current-sense-shunt: txt to yaml conversion.")
>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
>>> ---
>>>  .../devicetree/bindings/iio/afe/current-sense-shunt.yaml     | 5 +++++
>>>  1 file changed, 5 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml b/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml
>>> index 90439a8dc785..05166d8a3124 100644
>>> --- a/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml
>>> +++ b/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml
>>> @@ -24,12 +24,16 @@ properties:
>>>      description: |
>>>        Channel node of a voltage io-channel.
>>>  
>>> +  "#io-channel-cells":
>>> +    const: 0
>>> +
>>>    shunt-resistor-micro-ohms:
>>>      description: The shunt resistance.
>>>  
>>>  required:
>>>    - compatible
>>>    - io-channels
>>> +  - "#io-channel-cells"
>>>    - shunt-resistor-micro-ohms  
>>
>> I know I'm listed as maintainer and all, but I have not kept up with the yaml
>> conversion. Sorry. So, given that I might very well fundamentally misunderstand
>> something, it does not sound correct that #io-channel-cells is now "required".
>> I regard it as optional, and only needed if some other in-kernel driver is
>> consuming the sensed current. What am I missing?
>>
> 
> Agreed. This should be optional and I have deliberately not introduced it
> into all the bindings that could in theory support being used as providers.
> 
> So far I've not pushed it out in a blanket fashion into existing bindings
> even as optional.
> 
>> Also, whatever is done in this binding should preferably also be done in the
>> two "sister" afe bindings, i.e. current-sense-amplifier and voltage-divider.
> 
> This particular case is squashing an error, so whilst I'm happy to have those
> gain the binding addition, I would like to see them in a separate patch as
> less likely they'd get back ported.
> 
> If Kryysztof is fine with me just dropping the required I can pick up this patch.

Having here required number of cells helps any DT-user to seamlessly
integrate with it (e.g. with his in-tree or out-of-tree DTS, with
overlays). However it also can be added with such DTS or overlay, so in
general I don't mind dropping the required piece. Thanks!

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: iio: afe: current-sense-shunt: add io-channel-cells
  2021-05-10 12:17     ` Krzysztof Kozlowski
@ 2021-05-11 14:19       ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2021-05-11 14:19 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Peter Rosin, Lars-Peter Clausen, Rob Herring, linux-iio,
	devicetree, linux-kernel

On Mon, 10 May 2021 08:17:17 -0400
Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> wrote:

> On 08/05/2021 11:59, Jonathan Cameron wrote:
> > On Sat, 8 May 2021 00:44:58 +0200
> > Peter Rosin <peda@axentia.se> wrote:
> >   
> >> Hi!
> >>
> >> On 2021-05-06 17:06, Krzysztof Kozlowski wrote:  
> >>> The current-sense-shunt is an IIO provider thus can be referenced by IIO
> >>> consumers (via "io-channels" property in consumer device node).
> >>> Such provider is required to describe number of cells used in phandle
> >>> lookup with "io-channel-cells" property.  This also fixes dtbs_check
> >>> warnings like:
> >>>
> >>>   arch/arm/boot/dts/s5pv210-fascinate4g.dt.yaml: current-sense-shunt:
> >>>     '#io-channel-cells' does not match any of the regexes: 'pinctrl-[0-9]+'
> >>>
> >>> Fixes: ce66e52b6c16 ("dt-bindings:iio:afe:current-sense-shunt: txt to yaml conversion.")
> >>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> >>> ---
> >>>  .../devicetree/bindings/iio/afe/current-sense-shunt.yaml     | 5 +++++
> >>>  1 file changed, 5 insertions(+)
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml b/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml
> >>> index 90439a8dc785..05166d8a3124 100644
> >>> --- a/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml
> >>> +++ b/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.yaml
> >>> @@ -24,12 +24,16 @@ properties:
> >>>      description: |
> >>>        Channel node of a voltage io-channel.
> >>>  
> >>> +  "#io-channel-cells":
> >>> +    const: 0
> >>> +
> >>>    shunt-resistor-micro-ohms:
> >>>      description: The shunt resistance.
> >>>  
> >>>  required:
> >>>    - compatible
> >>>    - io-channels
> >>> +  - "#io-channel-cells"
> >>>    - shunt-resistor-micro-ohms    
> >>
> >> I know I'm listed as maintainer and all, but I have not kept up with the yaml
> >> conversion. Sorry. So, given that I might very well fundamentally misunderstand
> >> something, it does not sound correct that #io-channel-cells is now "required".
> >> I regard it as optional, and only needed if some other in-kernel driver is
> >> consuming the sensed current. What am I missing?
> >>  
> > 
> > Agreed. This should be optional and I have deliberately not introduced it
> > into all the bindings that could in theory support being used as providers.
> > 
> > So far I've not pushed it out in a blanket fashion into existing bindings
> > even as optional.
> >   
> >> Also, whatever is done in this binding should preferably also be done in the
> >> two "sister" afe bindings, i.e. current-sense-amplifier and voltage-divider.  
> > 
> > This particular case is squashing an error, so whilst I'm happy to have those
> > gain the binding addition, I would like to see them in a separate patch as
> > less likely they'd get back ported.
> > 
> > If Kryysztof is fine with me just dropping the required I can pick up this patch.  
> 
> Having here required number of cells helps any DT-user to seamlessly
> integrate with it (e.g. with his in-tree or out-of-tree DTS, with
> overlays). However it also can be added with such DTS or overlay, so in
> general I don't mind dropping the required piece. Thanks!
I dropped the required and applied to the togreg branch of iio.git.

Thanks,

Jonathan

> 
> Best regards,
> Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-11 14:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06 15:06 [PATCH] dt-bindings: iio: afe: current-sense-shunt: add io-channel-cells Krzysztof Kozlowski
2021-05-07 22:16 ` Rob Herring
2021-05-07 22:44 ` Peter Rosin
2021-05-08 15:59   ` Jonathan Cameron
2021-05-10 12:17     ` Krzysztof Kozlowski
2021-05-11 14:19       ` Jonathan Cameron

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).