dt-bindings:iio:accel:bosch,bma180: txt to yaml format conversion.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 31 Oct 2020 18:48:48 +0000 (18:48 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 25 Nov 2020 14:36:04 +0000 (14:36 +0000)
One question in here is whether we want to constrain the number of
interrupts.  Some parts definitely only have 1 such pin, and others
2 pins but I can not find information on the bma254.

Oleksandr's email address is bouncing so I've listed myself as
maintainer for this binding until someone else steps up.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031184854.745828-41-jic23@kernel.org
Documentation/devicetree/bindings/iio/accel/bma180.txt [deleted file]
Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml [new file with mode: 0644]

diff --git a/Documentation/devicetree/bindings/iio/accel/bma180.txt b/Documentation/devicetree/bindings/iio/accel/bma180.txt
deleted file mode 100644 (file)
index 33da4a6..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-* Bosch BMA023 / BMA150/ BMA180 / BMA25x / SMB380 triaxial acceleration sensor
-
-https://media.digikey.com/pdf/Data%20Sheets/Bosch/BMA150.pdf
-http://omapworld.com/BMA180_111_1002839.pdf
-http://ae-bst.resource.bosch.com/media/products/dokumente/bma250/bst-bma250-ds002-05.pdf
-
-Required properties:
-
-  - compatible : should be one of:
-    "bosch,bma023"
-    "bosch,bma150"
-    "bosch,bma180"
-    "bosch,bma250"
-    "bosch,bma254"
-    "bosch,smb380"
-  - reg : the I2C address of the sensor
-  - vdd-supply : regulator phandle connected to the VDD pin
-  - vddio-supply : regulator phandle connected to the VDDIO pin
-
-Optional properties:
-
-  - interrupts : interrupt mapping for GPIO IRQ, it should by configured with
-               flags IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING
-               For the bma250 the first interrupt listed must be the one
-               connected to the INT1 pin, the second (optional) interrupt
-               listed must be the one connected to the INT2 pin.
-
-Example:
-
-bma180@40 {
-       compatible = "bosch,bma180";
-       reg = <0x40>;
-       interrupt-parent = <&gpio6>;
-       interrupts = <18 (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING)>;
-};
diff --git a/Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml b/Documentation/devicetree/bindings/iio/accel/bosch,bma180.yaml
new file mode 100644 (file)
index 0000000..45b3abd
--- /dev/null
@@ -0,0 +1,62 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/accel/bosch,bma180.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Bosch BMA023 / BMA150/ BMA180 / BMA25x / SMB380 triaxial accelerometers
+
+maintainers:
+  - Jonathan Cameron <jic23@kernel.org>
+
+description: |
+  https://media.digikey.com/pdf/Data%20Sheets/Bosch/BMA150.pdf
+  http://omapworld.com/BMA180_111_1002839.pdf
+  http://ae-bst.resource.bosch.com/media/products/dokumente/bma250/bst-bma250-ds002-05.pdf
+
+properties:
+  compatible:
+    enum:
+      - bosch,bma023
+      - bosch,bma150
+      - bosch,bma180
+      - bosch,bma250
+      - bosch,bma254
+      - bosch,smb380
+
+  reg:
+    maxItems: 1
+
+  vdd-supply: true
+
+  vddio-supply: true
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+    description: |
+      Type should be either IRQ_TYPE_LEVEL_HIGH or IRQ_TYPE_EDGE_RISING.
+      For the bma250 the first interrupt listed must be the one
+      connected to the INT1 pin, the second (optional) interrupt
+      listed must be the one connected to the INT2 pin.
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        accel@40 {
+            compatible = "bosch,bma180";
+            reg = <0x40>;
+            interrupt-parent = <&gpio6>;
+            interrupts = <18 (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING)>;
+        };
+    };
+...