linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 14/54] dt-bindings: hwmon: Add IIO HWMON binding
       [not found] <20210721140424.725744-1-maxime@cerno.tech>
@ 2021-07-21 14:03 ` Maxime Ripard
  2021-07-22  9:20   ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Maxime Ripard @ 2021-07-21 14:03 UTC (permalink / raw)
  To: Chen-Yu Tsai, Maxime Ripard, Jernej Skrabec, devicetree,
	Rob Herring, Frank Rowand
  Cc: linux-arm-kernel, linux-sunxi, Guenter Roeck, Jean Delvare,
	Jonathan Cameron, linux-hwmon

Even though we had the iio-hwmon driver for some time and a number of
boards using it already, we never had a binding for it. Let's add it
based on what the driver expects and the boards are providing.

Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Jean Delvare <jdelvare@suse.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: linux-hwmon@vger.kernel.org
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 .../devicetree/bindings/hwmon/iio-hwmon.yaml  | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml

diff --git a/Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml b/Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml
new file mode 100644
index 000000000000..49dd40f663a6
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml
@@ -0,0 +1,37 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/hwmon/iio-hwmon.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: ADC-attached Hardware Sensor Device Tree Bindings
+
+maintainers:
+  - Jonathan Cameron <jic23@kernel.org>
+
+description: >
+  Bindings for hardware monitoring devices connected to ADC controllers
+  supporting the Industrial I/O bindings.
+
+properties:
+  compatible:
+    const: iio-hwmon
+
+  io-channels:
+    minItems: 1
+    maxItems: 1024
+    description: >
+      List of phandles to ADC channels to read the monitoring values
+
+required:
+  - compatible
+  - io-channels
+
+additionalProperties: false
+
+examples:
+  - |
+      iio-hwmon {
+          compatible = "iio-hwmon";
+          io-channels = <&adc 1>, <&adc 2>;
+      };
-- 
2.31.1


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

* Re: [PATCH 14/54] dt-bindings: hwmon: Add IIO HWMON binding
  2021-07-21 14:03 ` [PATCH 14/54] dt-bindings: hwmon: Add IIO HWMON binding Maxime Ripard
@ 2021-07-22  9:20   ` Jonathan Cameron
  2021-07-22  9:34     ` Maxime Ripard
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2021-07-22  9:20 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Chen-Yu Tsai, Jernej Skrabec, devicetree, Rob Herring,
	Frank Rowand, linux-arm-kernel, linux-sunxi, Guenter Roeck,
	Jean Delvare, Jonathan Cameron, linux-hwmon

On Wed, 21 Jul 2021 16:03:44 +0200
Maxime Ripard <maxime@cerno.tech> wrote:

> Even though we had the iio-hwmon driver for some time and a number of
> boards using it already, we never had a binding for it. Let's add it
> based on what the driver expects and the boards are providing.
> 
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Jean Delvare <jdelvare@suse.com>
> Cc: Jonathan Cameron <jic23@kernel.org>
> Cc: linux-hwmon@vger.kernel.org
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> ---
>  .../devicetree/bindings/hwmon/iio-hwmon.yaml  | 37 +++++++++++++++++++
>  1 file changed, 37 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml b/Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml
> new file mode 100644
> index 000000000000..49dd40f663a6
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml
> @@ -0,0 +1,37 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/hwmon/iio-hwmon.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> +
> +title: ADC-attached Hardware Sensor Device Tree Bindings
> +
> +maintainers:
> +  - Jonathan Cameron <jic23@kernel.org>

I'd like to share the blame for this one.  Binding was originally added
by Guenter.

https://lore.kernel.org/linux-iio/1359668588-13678-4-git-send-email-linux@roeck-us.net/
https://lore.kernel.org/linux-iio/1359668588-13678-11-git-send-email-linux@roeck-us.net/
:)

As bindings go this one has always been controversial because
it's mapping between linux subsystems rather than really describing
hardware.  We've had various discussions over the years on how to do
this differently, but perhaps just documenting the current state is the
way to go.  That doesn't stop us moving to something better in the
future.

> +
> +description: >
> +  Bindings for hardware monitoring devices connected to ADC controllers
> +  supporting the Industrial I/O bindings.
> +
> +properties:
> +  compatible:
> +    const: iio-hwmon
> +
> +  io-channels:
> +    minItems: 1
> +    maxItems: 1024

Why 1024?

> +    description: >
> +      List of phandles to ADC channels to read the monitoring values
> +
> +required:
> +  - compatible
> +  - io-channels
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +      iio-hwmon {
> +          compatible = "iio-hwmon";
> +          io-channels = <&adc 1>, <&adc 2>;
> +      };


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

* Re: [PATCH 14/54] dt-bindings: hwmon: Add IIO HWMON binding
  2021-07-22  9:20   ` Jonathan Cameron
@ 2021-07-22  9:34     ` Maxime Ripard
  2021-07-23 21:44       ` Rob Herring
  0 siblings, 1 reply; 4+ messages in thread
From: Maxime Ripard @ 2021-07-22  9:34 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Chen-Yu Tsai, Jernej Skrabec, devicetree, Rob Herring,
	Frank Rowand, linux-arm-kernel, linux-sunxi, Guenter Roeck,
	Jean Delvare, Jonathan Cameron, linux-hwmon

Hi Jonathan,

On Thu, Jul 22, 2021 at 10:20:27AM +0100, Jonathan Cameron wrote:
> On Wed, 21 Jul 2021 16:03:44 +0200
> Maxime Ripard <maxime@cerno.tech> wrote:
> 
> > Even though we had the iio-hwmon driver for some time and a number of
> > boards using it already, we never had a binding for it. Let's add it
> > based on what the driver expects and the boards are providing.
> > 
> > Cc: Guenter Roeck <linux@roeck-us.net>
> > Cc: Jean Delvare <jdelvare@suse.com>
> > Cc: Jonathan Cameron <jic23@kernel.org>
> > Cc: linux-hwmon@vger.kernel.org
> > Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> > ---
> >  .../devicetree/bindings/hwmon/iio-hwmon.yaml  | 37 +++++++++++++++++++
> >  1 file changed, 37 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml b/Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml
> > new file mode 100644
> > index 000000000000..49dd40f663a6
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml
> > @@ -0,0 +1,37 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: "http://devicetree.org/schemas/hwmon/iio-hwmon.yaml#"
> > +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> > +
> > +title: ADC-attached Hardware Sensor Device Tree Bindings
> > +
> > +maintainers:
> > +  - Jonathan Cameron <jic23@kernel.org>
> 
> I'd like to share the blame for this one.  Binding was originally added
> by Guenter.
> 
> https://lore.kernel.org/linux-iio/1359668588-13678-4-git-send-email-linux@roeck-us.net/
> https://lore.kernel.org/linux-iio/1359668588-13678-11-git-send-email-linux@roeck-us.net/
> :)
> 
> As bindings go this one has always been controversial because
> it's mapping between linux subsystems rather than really describing
> hardware.  We've had various discussions over the years on how to do
> this differently, but perhaps just documenting the current state is the
> way to go.  That doesn't stop us moving to something better in the
> future.

There's DT using it already, so I guess it's a bit too late to have that
discussion indeed :)

> > +
> > +description: >
> > +  Bindings for hardware monitoring devices connected to ADC controllers
> > +  supporting the Industrial I/O bindings.
> > +
> > +properties:
> > +  compatible:
> > +    const: iio-hwmon
> > +
> > +  io-channels:
> > +    minItems: 1
> > +    maxItems: 1024
> 
> Why 1024?

Ought to be enough for anyone :)

We have to set a maximum and I couldn't find any actual maximum
documented, if you prefer another value let me know

Maxime

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

* Re: [PATCH 14/54] dt-bindings: hwmon: Add IIO HWMON binding
  2021-07-22  9:34     ` Maxime Ripard
@ 2021-07-23 21:44       ` Rob Herring
  0 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2021-07-23 21:44 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Jonathan Cameron, Chen-Yu Tsai, Jernej Skrabec, devicetree,
	Frank Rowand, linux-arm-kernel, linux-sunxi, Guenter Roeck,
	Jean Delvare, Jonathan Cameron, linux-hwmon

On Thu, Jul 22, 2021 at 11:34:53AM +0200, Maxime Ripard wrote:
> Hi Jonathan,
> 
> On Thu, Jul 22, 2021 at 10:20:27AM +0100, Jonathan Cameron wrote:
> > On Wed, 21 Jul 2021 16:03:44 +0200
> > Maxime Ripard <maxime@cerno.tech> wrote:
> > 
> > > Even though we had the iio-hwmon driver for some time and a number of
> > > boards using it already, we never had a binding for it. Let's add it
> > > based on what the driver expects and the boards are providing.
> > > 
> > > Cc: Guenter Roeck <linux@roeck-us.net>
> > > Cc: Jean Delvare <jdelvare@suse.com>
> > > Cc: Jonathan Cameron <jic23@kernel.org>
> > > Cc: linux-hwmon@vger.kernel.org
> > > Signed-off-by: Maxime Ripard <maxime@cerno.tech>
> > > ---
> > >  .../devicetree/bindings/hwmon/iio-hwmon.yaml  | 37 +++++++++++++++++++
> > >  1 file changed, 37 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml
> > > 
> > > diff --git a/Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml b/Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml
> > > new file mode 100644
> > > index 000000000000..49dd40f663a6
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml
> > > @@ -0,0 +1,37 @@
> > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: "http://devicetree.org/schemas/hwmon/iio-hwmon.yaml#"
> > > +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> > > +
> > > +title: ADC-attached Hardware Sensor Device Tree Bindings
> > > +
> > > +maintainers:
> > > +  - Jonathan Cameron <jic23@kernel.org>
> > 
> > I'd like to share the blame for this one.  Binding was originally added
> > by Guenter.
> > 
> > https://lore.kernel.org/linux-iio/1359668588-13678-4-git-send-email-linux@roeck-us.net/
> > https://lore.kernel.org/linux-iio/1359668588-13678-11-git-send-email-linux@roeck-us.net/
> > :)
> > 
> > As bindings go this one has always been controversial because
> > it's mapping between linux subsystems rather than really describing
> > hardware.  We've had various discussions over the years on how to do
> > this differently, but perhaps just documenting the current state is the
> > way to go.  That doesn't stop us moving to something better in the
> > future.
> 
> There's DT using it already, so I guess it's a bit too late to have that
> discussion indeed :)
> 
> > > +
> > > +description: >
> > > +  Bindings for hardware monitoring devices connected to ADC controllers
> > > +  supporting the Industrial I/O bindings.
> > > +
> > > +properties:
> > > +  compatible:
> > > +    const: iio-hwmon
> > > +
> > > +  io-channels:
> > > +    minItems: 1
> > > +    maxItems: 1024
> > 
> > Why 1024?
> 
> Ought to be enough for anyone :)
> 
> We have to set a maximum and I couldn't find any actual maximum
> documented, if you prefer another value let me know

Just add a comment: '# Should be enough'

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

end of thread, other threads:[~2021-07-23 21:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210721140424.725744-1-maxime@cerno.tech>
2021-07-21 14:03 ` [PATCH 14/54] dt-bindings: hwmon: Add IIO HWMON binding Maxime Ripard
2021-07-22  9:20   ` Jonathan Cameron
2021-07-22  9:34     ` Maxime Ripard
2021-07-23 21:44       ` Rob Herring

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