dt-bindings:iio:light:st,uvis25: txt to yaml conversion for this UV sensor
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 31 Oct 2020 18:48:28 +0000 (18:48 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 22 Nov 2020 17:50:02 +0000 (17:50 +0000)
For the example, node name is uv-sensor because the standard option
of light-sensor seemed a little too generic for this.

This one could have just been moved to trivial-devices.yaml but for now
I have kept it as a separate doc.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Link: https://lore.kernel.org/r/20201031184854.745828-21-jic23@kernel.org
Documentation/devicetree/bindings/iio/light/st,uvis25.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/iio/light/uvis25.txt [deleted file]

diff --git a/Documentation/devicetree/bindings/iio/light/st,uvis25.yaml b/Documentation/devicetree/bindings/iio/light/st,uvis25.yaml
new file mode 100644 (file)
index 0000000..c86e5e1
--- /dev/null
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/light/st,uvis25.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ST UVIS25 uv sensor
+
+maintainers:
+  - Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
+
+properties:
+  compatible:
+    const: st,uvis25
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        uv-sensor@47 {
+            compatible = "st,uvis25";
+            reg = <0x47>;
+            interrupt-parent = <&gpio0>;
+            interrupts = <0 IRQ_TYPE_EDGE_RISING>;
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/iio/light/uvis25.txt b/Documentation/devicetree/bindings/iio/light/uvis25.txt
deleted file mode 100644 (file)
index 043c139..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-* ST UVIS25 uv sensor
-
-Required properties:
-- compatible: should be "st,uvis25"
-- reg: i2c address of the sensor / spi cs line
-
-Optional properties:
-- interrupts: interrupt mapping for IRQ. It should be configured with
-  flags IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_EDGE_RISING, IRQ_TYPE_LEVEL_LOW or
-  IRQ_TYPE_EDGE_FALLING.
-
-  Refer to interrupt-controller/interrupts.txt for generic interrupt
-  client node bindings.
-
-Example:
-
-uvis25@47 {
-       compatible = "st,uvis25";
-       reg = <0x47>;
-       interrupt-parent = <&gpio0>;
-       interrupts = <0 IRQ_TYPE_EDGE_RISING>;
-};