OSDN Git Service

dt-bindings: leds: irled: ir-spi-led: convert to DT schema
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Sun, 4 Dec 2022 10:43:23 +0000 (11:43 +0100)
committerRob Herring <robh@kernel.org>
Tue, 6 Dec 2022 20:50:36 +0000 (14:50 -0600)
Convert the SPI IR LED bindings to DT schema.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20221204104323.117974-3-krzysztof.kozlowski@linaro.org
Signed-off-by: Rob Herring <robh@kernel.org>
Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/leds/irled/spi-ir-led.txt [deleted file]

diff --git a/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml b/Documentation/devicetree/bindings/leds/irled/ir-spi-led.yaml
new file mode 100644 (file)
index 0000000..72cadeb
--- /dev/null
@@ -0,0 +1,61 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/irled/ir-spi-led.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: IR LED connected through SPI bus
+
+maintainers:
+  - Sean Young <sean@mess.org>
+
+description:
+  IR LED switch is connected to the MOSI line of the SPI device and the data
+  is delivered through that.
+
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+properties:
+  compatible:
+    const: ir-spi-led
+
+  reg:
+    maxItems: 1
+
+  duty-cycle:
+    $ref: /schemas/types.yaml#/definitions/uint8
+    enum: [50, 60, 70, 75, 80, 90]
+    description:
+      Percentage of one period in which the signal is active.
+
+  led-active-low:
+    type: boolean
+    description:
+      Output is negated with a NOT gate.
+
+  power-supply: true
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        irled@0 {
+            compatible = "ir-spi-led";
+            reg = <0x0>;
+
+            duty-cycle = /bits/ 8 <60>;
+            led-active-low;
+            power-supply = <&irda_regulator>;
+            spi-max-frequency = <5000000>;
+        };
+    };
+
diff --git a/Documentation/devicetree/bindings/leds/irled/spi-ir-led.txt b/Documentation/devicetree/bindings/leds/irled/spi-ir-led.txt
deleted file mode 100644 (file)
index 83ff1b4..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-Device tree bindings for IR LED connected through SPI bus which is used as
-remote controller.
-
-The IR LED switch is connected to the MOSI line of the SPI device and the data
-are delivered thourgh that.
-
-Required properties:
-       - compatible: should be "ir-spi-led".
-
-Optional properties:
-       - duty-cycle: 8 bit value that represents the percentage of one period
-         in which the signal is active.  It can be 50, 60, 70, 75, 80 or 90.
-       - led-active-low: boolean value that specifies whether the output is
-         negated with a NOT gate.
-       - power-supply: specifies the power source. It can either be a regulator
-         or a gpio which enables a regulator, i.e. a regulator-fixed as
-         described in
-         Documentation/devicetree/bindings/regulator/fixed-regulator.yaml
-
-Example:
-
-       irled@0 {
-               compatible = "ir-spi-led";
-               reg = <0x0>;
-               spi-max-frequency = <5000000>;
-               power-supply = <&vdd_led>;
-               led-active-low;
-               duty-cycle = /bits/ 8 <60>;
-       };