Skip to contentSkip to conversation

media: dt-bindings: rc: Allow 'ir-receiver' node names

PATCH In review Rob Herring 1 participant 3 messages Jun 6, 2022 – Jun 29, 2022

Subsystems (2)
lore
Share & tools
lore

Rob Herring

author maintainer
#0 lore raw

PATCH 1/2 media: dt-bindings: rc: Allow 'ir-receiver' node names

Most existing 'gpio-ir-receiver' nodes use 'ir-receiver' for their node name, so add it as an allowed node name.

---
 Documentation/devicetree/bindings/media/rc.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/media/rc.yaml +1 -1
index d4c541c4b164..b11d14ab89c4 100644
@@ -12,7 +12,7 @@ maintainers:
 
 properties:
   $nodename:
-    pattern: "^ir(@[a-f0-9]+)?$"
+    pattern: "^ir(-receiver)?(@[a-f0-9]+)?$"
 
   linux,rc-map-name:
     description:
Signature · 1 line
2.34.1
author maintainer
#1 lore raw

PATCH 2/2 media: dt-bindings: Convert gpio-ir-receiver to DT schema

Convert the gpio-ir-receiver binding to DT schema format.

---
 .../bindings/media/gpio-ir-receiver.txt       | 20 ----------
 .../bindings/media/gpio-ir-receiver.yaml      | 40 +++++++++++++++++++
 2 files changed, 40 insertions(+), 20 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/media/gpio-ir-receiver.txt
 create mode 100644 Documentation/devicetree/bindings/media/gpio-ir-receiver.yaml
Documentation/devicetree/bindings/media/gpio-ir-receiver.txt deleted +0 -20
deleted file mode 100644
index 108bf435b933..000000000000
@@ -1,20 +0,0 @@
-Device-Tree bindings for GPIO IR receiver
-
-Required properties:
-	- compatible: should be "gpio-ir-receiver".
-	- gpios: specifies GPIO used for IR signal reception.
-
-Optional properties:
-	- linux,rc-map-name: see rc.txt file in the same
-	  directory.
-	- linux,autosuspend-period: autosuspend delay time,
-	  the unit is milisecond.
-
-Example node:
-
-	ir: ir-receiver {
-		compatible = "gpio-ir-receiver";
-		gpios = <&gpio0 19 1>;
-		linux,rc-map-name = "rc-rc6-mce";
-		linux,autosuspend-period = <125>;
-	};
Documentation/devicetree/bindings/media/gpio-ir-receiver.yaml new file +40 -0
new file mode 100644
index 000000000000..61072745b983
@@ -0,0 +1,40 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/media/gpio-ir-receiver.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: GPIO Based IR receiver
+
+maintainers:
+  - Sebastian Hesselbarth <[email protected]>
+
+allOf:
+  - $ref: rc.yaml#
+
+properties:
+  compatible:
+    const: gpio-ir-receiver
+
+  gpios:
+    maxItems: 1
+
+  linux,autosuspend-period:
+    description: autosuspend delay time in milliseconds
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+required:
+  - compatible
+  - gpios
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    ir-receiver {
+        compatible = "gpio-ir-receiver";
+        gpios = <&gpio0 19 1>;
+        linux,rc-map-name = "rc-rc6-mce";
+        linux,autosuspend-period = <125>;
+    };
+...
Signature · 1 line
2.34.1
author maintainer
#2 lore raw
In reply to Rob Herring
Quoted 7 lines · Rob Herring

Most existing 'gpio-ir-receiver' nodes use 'ir-receiver' for their node name, so add it as an allowed node name.

---
 Documentation/devicetree/bindings/media/rc.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

It's been 3 weeks and no replies, so I've applied these to the DT tree.

Rob