dt-bindings:iio:temperature:maxim,max31856 yaml conversion.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 31 Oct 2020 13:41:08 +0000 (13:41 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 16 Nov 2020 20:13:08 +0000 (20:13 +0000)
Simple txt to yaml conversion of this binding.
Paresh Chaudhary's email is bouncing so for now I've listed
myself as maintainer.

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

diff --git a/Documentation/devicetree/bindings/iio/temperature/max31856.txt b/Documentation/devicetree/bindings/iio/temperature/max31856.txt
deleted file mode 100644 (file)
index 06ab43b..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-Maxim MAX31856 thermocouple support
-
-https://datasheets.maximintegrated.com/en/ds/MAX31856.pdf
-
-Optional property:
-       - thermocouple-type: Type of thermocouple (THERMOCOUPLE_TYPE_K if
-               omitted). Supported types are B, E, J, K, N, R, S, T.
-
-Required properties:
-       - compatible: must be "maxim,max31856"
-       - reg: SPI chip select number for the device
-       - spi-max-frequency: As per datasheet max. supported freq is 5000000
-       - spi-cpha: must be defined for max31856 to enable SPI mode 1
-
-       Refer to spi/spi-bus.txt for generic SPI slave bindings.
-
- Example:
-       temp-sensor@0 {
-               compatible = "maxim,max31856";
-               reg = <0>;
-               spi-max-frequency = <5000000>;
-               spi-cpha;
-               thermocouple-type = <THERMOCOUPLE_TYPE_K>;
-       };
diff --git a/Documentation/devicetree/bindings/iio/temperature/maxim,max31856.yaml b/Documentation/devicetree/bindings/iio/temperature/maxim,max31856.yaml
new file mode 100644 (file)
index 0000000..873b347
--- /dev/null
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/temperature/maxim,max31856.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Maxim MAX31856 thermocouple support
+
+maintainers:
+  - Jonathan Cameron <jic23@kernel.org>
+
+description: |
+  https://datasheets.maximintegrated.com/en/ds/MAX31856.pdf
+
+properties:
+  compatible:
+    const: maxim,max31856
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency: true
+  spi-cpha: true
+
+  thermocouple-type:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Type of thermocouple (THERMOCOUPLE_TYPE_K if omitted).
+      Use defines in dt-bindings/iio/temperature/thermocouple.h.
+      Supported types are B, E, J, K, N, R, S, T.
+
+required:
+  - compatible
+  - reg
+  - spi-cpha
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/iio/temperature/thermocouple.h>
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        temp-sensor@0 {
+            compatible = "maxim,max31856";
+            reg = <0>;
+            spi-max-frequency = <5000000>;
+            spi-cpha;
+            thermocouple-type = <THERMOCOUPLE_TYPE_K>;
+        };
+    };
+...