diff mbox series

[RFC,v1,2/2] dt-bindings: hwmon: add iio-hwmon bindings

Message ID 20210516044315.116290-3-liambeguin@gmail.com (mailing list archive)
State New, archived
Headers show
Series hwmon: (iio_hwmon) optionally force iio channel type | expand

Commit Message

Liam Beguin May 16, 2021, 4:43 a.m. UTC
Document devicetree bindings for the iio-hwmon driver.
Also add documentation for the channel-types option.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
---
 .../devicetree/bindings/hwmon/iio-hwmon.yaml  | 41 +++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml b/Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml
new file mode 100644
index 000000000000..fb8b437112a5
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/iio-hwmon.yaml
@@ -0,0 +1,41 @@ 
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/hwmon/iio-hwmon.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: bindings for the IIO hwmon bridge
+
+maintainers:
+  - Jean Delvare <jdelvare@suse.com>
+  - Guenter Roeck <linux@roeck-us.net>
+
+properties:
+  compatible:
+    enum:
+      - iio-hwmon
+
+  io-channels:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+
+  io-channel-names:
+    $ref: /schemas/types.yaml#/definitions/string-array
+
+  channel-types:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    description: |
+      an array of channel types used to override the IIO type of each channel.
+
+additionalProperties: false
+
+examples:
+  - |
+    #define IIO_VOLTAGE 0
+    #define IIO_CURRENT 1
+    iio_hwmon_adc0 {
+        compatible = "iio-hwmon";
+        io-channels = <&adc 0>, <&adc 1>;
+        io-channel-names = "input_current", "input_voltage" ;
+        channel-types = <IIO_CURRENT>, <IIO_VOLTAGE>;
+    };