[PATCH v2] ASoC: dt-bindings: sound: asahi-kasei,ak4118: Convert DT schema

Manish Baing posted 1 patch an hour ago
.../devicetree/bindings/sound/ak4118.txt      | 22 -------
.../bindings/sound/asahi-kasei,ak4118.yaml    | 58 +++++++++++++++++++
2 files changed, 58 insertions(+), 22 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/sound/ak4118.txt
create mode 100644 Documentation/devicetree/bindings/sound/asahi-kasei,ak4118.yaml
[PATCH v2] ASoC: dt-bindings: sound: asahi-kasei,ak4118: Convert DT schema
Posted by Manish Baing an hour ago
Convert the Asahi Kasei AK4118 S/PDIF transceiver bindings from
text format to YAML schema.

Signed-off-by: Manish Baing <manishbaing2789@gmail.com>
---
Changes in v2:
- Restored legacy 'irq-gpios' property to prevent C driver probe failure.
- Added 'reset-gpios' and 'irq-gpios' to the required properties list.

 .../devicetree/bindings/sound/ak4118.txt      | 22 -------
 .../bindings/sound/asahi-kasei,ak4118.yaml    | 58 +++++++++++++++++++
 2 files changed, 58 insertions(+), 22 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/ak4118.txt
 create mode 100644 Documentation/devicetree/bindings/sound/asahi-kasei,ak4118.yaml

diff --git a/Documentation/devicetree/bindings/sound/ak4118.txt b/Documentation/devicetree/bindings/sound/ak4118.txt
deleted file mode 100644
index 6e11a2f7404c..000000000000
--- a/Documentation/devicetree/bindings/sound/ak4118.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-AK4118 S/PDIF transceiver
-
-This device supports I2C mode.
-
-Required properties:
-
-- compatible : "asahi-kasei,ak4118"
-- reg : The I2C address of the device for I2C
-- reset-gpios: A GPIO specifier for the reset pin
-- irq-gpios: A GPIO specifier for the IRQ pin
-
-Example:
-
-&i2c {
-	ak4118: ak4118@13 {
-		#sound-dai-cells = <0>;
-		compatible = "asahi-kasei,ak4118";
-		reg = <0x13>;
-		reset-gpios = <&gpio 0 GPIO_ACTIVE_LOW>
-		irq-gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
-	};
-};
diff --git a/Documentation/devicetree/bindings/sound/asahi-kasei,ak4118.yaml b/Documentation/devicetree/bindings/sound/asahi-kasei,ak4118.yaml
new file mode 100644
index 000000000000..c8aa61643ca0
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/asahi-kasei,ak4118.yaml
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/asahi-kasei,ak4118.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Asahi Kasei AK4118 Digital Audio Transceiver
+
+maintainers:
+  - Clément Péron <peron.clem@gmail.com>
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: asahi-kasei,ak4118
+
+  reg:
+    maxItems: 1
+    description: I2C address of the device
+
+  "#sound-dai-cells":
+    const: 0
+
+  irq-gpios:
+    maxItems: 1
+    description: GPIO used for IRQ pin
+
+  reset-gpios:
+    maxItems: 1
+    description: GPIO used for the Reset pin
+
+required:
+  - compatible
+  - reg
+  - "#sound-dai-cells"
+  - irq-gpios
+  - reset-gpios
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        audio-codec@13 {
+            compatible = "asahi-kasei,ak4118";
+            reg = <0x13>;
+            #sound-dai-cells = <0>;
+            reset-gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
+            irq-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
+        };
+    };
-- 
2.43.0