linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] dt-bindings: iio: afe: voltage-divider: Add io-channel-cells
@ 2024-01-30 11:18 Naresh Solanki
  2024-01-30 11:42 ` Peter Rosin
  2024-01-31  8:28 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 5+ messages in thread
From: Naresh Solanki @ 2024-01-30 11:18 UTC (permalink / raw)
  To: Peter Rosin, Jonathan Cameron, Lars-Peter Clausen, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: mazziesaccount, Naresh Solanki, linux-iio, devicetree, linux-kernel

voltage-divider is always an iio consumer at the same time it is
optionally an iio provider.
Hence add #io-channel-cells
Also update example.

Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
---
 .../bindings/iio/afe/voltage-divider.yaml          | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml b/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml
index dddf97b50549..09f10d7c4e02 100644
--- a/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml
+++ b/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml
@@ -39,6 +39,13 @@ properties:
     description: |
       Channel node of a voltage io-channel.
 
+  '#io-channel-cells':
+    description:
+      In addition to consuming the measurement services of an ADC,
+      the voltage divider can act as an provider of measurement
+      services to other devices.
+    const: 1
+
   output-ohms:
     description:
       Resistance Rout over which the output voltage is measured. See full-ohms.
@@ -75,12 +82,17 @@ examples:
             spi-max-frequency = <1000000>;
         };
     };
-    sysv {
+    p12v_vd: sysv {
         compatible = "voltage-divider";
         io-channels = <&maxadc 1>;
+        #io-channel-cells = <1>;
 
         /* Scale the system voltage by 22/222 to fit the ADC range. */
         output-ohms = <22>;
         full-ohms = <222>; /* 200 + 22 */
     };
+    iio-hwmon {
+        compatible = "iio-hwmon";
+        io-channels = <&p12v_vd 0>;
+    };
 ...

base-commit: 861c0981648f5b64c86fd028ee622096eb7af05a
-- 
2.42.0


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

* Re: [PATCH v2] dt-bindings: iio: afe: voltage-divider: Add io-channel-cells
  2024-01-30 11:18 [PATCH v2] dt-bindings: iio: afe: voltage-divider: Add io-channel-cells Naresh Solanki
@ 2024-01-30 11:42 ` Peter Rosin
  2024-01-30 11:48   ` Naresh Solanki
  2024-01-31  8:28 ` Krzysztof Kozlowski
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Rosin @ 2024-01-30 11:42 UTC (permalink / raw)
  To: Naresh Solanki, Jonathan Cameron, Lars-Peter Clausen,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: mazziesaccount, linux-iio, devicetree, linux-kernel

Hi!

2024-01-30 at 12:18, Naresh Solanki wrote:
> voltage-divider is always an iio consumer at the same time it is
> optionally an iio provider.
> Hence add #io-channel-cells
> Also update example.
> 
> Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
> ---
>  .../bindings/iio/afe/voltage-divider.yaml          | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml b/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml
> index dddf97b50549..09f10d7c4e02 100644
> --- a/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml
> +++ b/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml
> @@ -39,6 +39,13 @@ properties:
>      description: |
>        Channel node of a voltage io-channel.
>  
> +  '#io-channel-cells':
> +    description:
> +      In addition to consuming the measurement services of an ADC,

It doesn't really need to be an ADC. Anything with a voltage output
channel works (in theory). But sure, normally it would be an ADC...

> +      the voltage divider can act as an provider of measurement

a provider

Cheers,
Peter

> +      services to other devices.
> +    const: 1
> +
>    output-ohms:
...

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

* Re: [PATCH v2] dt-bindings: iio: afe: voltage-divider: Add io-channel-cells
  2024-01-30 11:42 ` Peter Rosin
@ 2024-01-30 11:48   ` Naresh Solanki
  2024-01-30 16:16     ` Jonathan Cameron
  0 siblings, 1 reply; 5+ messages in thread
From: Naresh Solanki @ 2024-01-30 11:48 UTC (permalink / raw)
  To: Peter Rosin
  Cc: Jonathan Cameron, Lars-Peter Clausen, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, mazziesaccount, linux-iio,
	devicetree, linux-kernel

Hi Peter,


On Tue, 30 Jan 2024 at 17:12, Peter Rosin <peda@axentia.se> wrote:
>
> Hi!
>
> 2024-01-30 at 12:18, Naresh Solanki wrote:
> > voltage-divider is always an iio consumer at the same time it is
> > optionally an iio provider.
> > Hence add #io-channel-cells
> > Also update example.
> >
> > Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
> > ---
> >  .../bindings/iio/afe/voltage-divider.yaml          | 14 +++++++++++++-
> >  1 file changed, 13 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml b/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml
> > index dddf97b50549..09f10d7c4e02 100644
> > --- a/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml
> > +++ b/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml
> > @@ -39,6 +39,13 @@ properties:
> >      description: |
> >        Channel node of a voltage io-channel.
> >
> > +  '#io-channel-cells':
> > +    description:
> > +      In addition to consuming the measurement services of an ADC,
>
> It doesn't really need to be an ADC. Anything with a voltage output
> channel works (in theory). But sure, normally it would be an ADC...
Ack
>
> > +      the voltage divider can act as an provider of measurement
>
> a provider
Ack

Will update as:
  '#io-channel-cells':
    description:
      In addition to consuming the measurement services of an a voltage output
      channel the voltage divider can act as a provider of measurement
      services to other devices.
    const: 1

Regards,
Naresh
>
> Cheers,
> Peter
>
> > +      services to other devices.
> > +    const: 1
> > +
> >    output-ohms:
> ...

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

* Re: [PATCH v2] dt-bindings: iio: afe: voltage-divider: Add io-channel-cells
  2024-01-30 11:48   ` Naresh Solanki
@ 2024-01-30 16:16     ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2024-01-30 16:16 UTC (permalink / raw)
  To: Naresh Solanki
  Cc: Peter Rosin, Jonathan Cameron, Lars-Peter Clausen, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, mazziesaccount, linux-iio,
	devicetree, linux-kernel

On Tue, 30 Jan 2024 17:18:53 +0530
Naresh Solanki <naresh.solanki@9elements.com> wrote:

> Hi Peter,
> 
> 
> On Tue, 30 Jan 2024 at 17:12, Peter Rosin <peda@axentia.se> wrote:
> >
> > Hi!
> >
> > 2024-01-30 at 12:18, Naresh Solanki wrote:  
> > > voltage-divider is always an iio consumer at the same time it is
> > > optionally an iio provider.
> > > Hence add #io-channel-cells
> > > Also update example.
> > >
> > > Signed-off-by: Naresh Solanki <naresh.solanki@9elements.com>
> > > ---
> > >  .../bindings/iio/afe/voltage-divider.yaml          | 14 +++++++++++++-
> > >  1 file changed, 13 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml b/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml
> > > index dddf97b50549..09f10d7c4e02 100644
> > > --- a/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml
> > > +++ b/Documentation/devicetree/bindings/iio/afe/voltage-divider.yaml
> > > @@ -39,6 +39,13 @@ properties:
> > >      description: |
> > >        Channel node of a voltage io-channel.
> > >
> > > +  '#io-channel-cells':
> > > +    description:
> > > +      In addition to consuming the measurement services of an ADC,  
> >
> > It doesn't really need to be an ADC. Anything with a voltage output
> > channel works (in theory). But sure, normally it would be an ADC...  
> Ack
> >  
> > > +      the voltage divider can act as an provider of measurement  
> >
> > a provider  
> Ack
> 
> Will update as:
>   '#io-channel-cells':
>     description:
>       In addition to consuming the measurement services of an a voltage output

That sounds like a DAC.  It's an input voltage to that device.
Just go with voltage channel and rely on measurement services to make it clear what
it is.

>       channel the voltage divider can act as a provider of measurement
>       services to other devices.
>     const: 1
> 
> Regards,
> Naresh
> >
> > Cheers,
> > Peter
> >  
> > > +      services to other devices.
> > > +    const: 1
> > > +
> > >    output-ohms:  
> > ...  
> 


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

* Re: [PATCH v2] dt-bindings: iio: afe: voltage-divider: Add io-channel-cells
  2024-01-30 11:18 [PATCH v2] dt-bindings: iio: afe: voltage-divider: Add io-channel-cells Naresh Solanki
  2024-01-30 11:42 ` Peter Rosin
@ 2024-01-31  8:28 ` Krzysztof Kozlowski
  1 sibling, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-31  8:28 UTC (permalink / raw)
  To: Naresh Solanki, Peter Rosin, Jonathan Cameron,
	Lars-Peter Clausen, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: mazziesaccount, linux-iio, devicetree, linux-kernel

On 30/01/2024 12:18, Naresh Solanki wrote:
> voltage-divider is always an iio consumer at the same time it is
> optionally an iio provider.
> Hence add #io-channel-cells
> Also update example.

>    output-ohms:
>      description:
>        Resistance Rout over which the output voltage is measured. See full-ohms.
> @@ -75,12 +82,17 @@ examples:
>              spi-max-frequency = <1000000>;
>          };
>      };
> -    sysv {
> +    p12v_vd: sysv {
>          compatible = "voltage-divider";
>          io-channels = <&maxadc 1>;
> +        #io-channel-cells = <1>;
>  
>          /* Scale the system voltage by 22/222 to fit the ADC range. */
>          output-ohms = <22>;
>          full-ohms = <222>; /* 200 + 22 */
>      };
> +    iio-hwmon {
> +        compatible = "iio-hwmon";
> +        io-channels = <&p12v_vd 0>;

Why do you add unrelated example?

Best regards,
Krzysztof


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

end of thread, other threads:[~2024-01-31  8:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-30 11:18 [PATCH v2] dt-bindings: iio: afe: voltage-divider: Add io-channel-cells Naresh Solanki
2024-01-30 11:42 ` Peter Rosin
2024-01-30 11:48   ` Naresh Solanki
2024-01-30 16:16     ` Jonathan Cameron
2024-01-31  8:28 ` Krzysztof Kozlowski

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