OSDN Git Service

ASoC: dt-bindings: adi,adau17x1: Convert to DT schema
authorVijaya Anand <sunrockers8@gmail.com>
Wed, 15 Mar 2023 23:10:55 +0000 (04:40 +0530)
committerMark Brown <broonie@kernel.org>
Thu, 16 Mar 2023 11:51:11 +0000 (11:51 +0000)
Convert the binding document for adi,adau17x1 from txt to yaml
so one could validate dt-entries correctly and any future additions
can go into yaml format. Add address and size cells to example to
prevent errors regarding reg format.

Signed-off-by: Vijaya Anand <sunrockers8@gmail.com>
Cc: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230315231055.3067-1-sunrockers8@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Documentation/devicetree/bindings/sound/adi,adau17x1.txt [deleted file]
Documentation/devicetree/bindings/sound/adi,adau17x1.yaml [new file with mode: 0644]

diff --git a/Documentation/devicetree/bindings/sound/adi,adau17x1.txt b/Documentation/devicetree/bindings/sound/adi,adau17x1.txt
deleted file mode 100644 (file)
index 1447dec..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-Analog Devices ADAU1361/ADAU1461/ADAU1761/ADAU1961/ADAU1381/ADAU1781
-
-Required properties:
-
- - compatible:         Should contain one of the following:
-                       "adi,adau1361"
-                       "adi,adau1461"
-                       "adi,adau1761"
-                       "adi,adau1961"
-                       "adi,adau1381"
-                       "adi,adau1781"
-
- - reg:                        The i2c address. Value depends on the state of ADDR0
-                       and ADDR1, as wired in hardware.
-
-Optional properties:
- - clock-names:                If provided must be "mclk".
- - clocks:             phandle + clock-specifiers for the clock that provides
-                       the audio master clock for the device.
-
-Examples:
-#include <dt-bindings/sound/adau17x1.h>
-
-       i2c_bus {
-               adau1361@38 {
-                       compatible = "adi,adau1761";
-                       reg = <0x38>;
-
-                       clock-names = "mclk";
-                       clocks = <&audio_clock>;
-               };
-       };
diff --git a/Documentation/devicetree/bindings/sound/adi,adau17x1.yaml b/Documentation/devicetree/bindings/sound/adi,adau17x1.yaml
new file mode 100644 (file)
index 0000000..45955f3
--- /dev/null
@@ -0,0 +1,52 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/adi,adau17x1.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title:
+ Analog Devices ADAU1361/ADAU1461/ADAU1761/ADAU1961/ADAU1381/ADAU1781 Codec
+
+maintainers:
+  - Lars-Peter Clausen <lars@metafoo.de>
+
+properties:
+  compatible:
+    enum:
+      - adi,adau1361
+      - adi,adau1381
+      - adi,adau1461
+      - adi,adau1761
+      - adi,adau1781
+      - adi,adau1961
+
+  reg:
+    maxItems: 1
+    description:
+      The i2c address. Value depends on the state of ADDR0 and ADDR1,
+      as wired in hardware.
+
+  clock-names:
+    const: mclk
+
+  clocks:
+    items:
+      - description: provides the audio master clock for the device.
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      audio-codec@38 {
+        compatible = "adi,adau1761";
+        reg = <0x38>;
+        clock-names = "mclk";
+        clocks = <&audio_clock>;
+      };