]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: dt-bindings: dlg,da7213: Convert to json-schema
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 22 Jul 2024 12:04:00 +0000 (14:04 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 29 Jul 2024 00:18:43 +0000 (01:18 +0100)
Convert the Dialog Semiconductor DA7212/DA7213 Audio Codec Device Tree
binding documentation to json-schema.

Add missing properties.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/7645c9024a1762d281f4067504bc32a7a3d27caa.1721649741.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
Documentation/devicetree/bindings/sound/da7213.txt [deleted file]
Documentation/devicetree/bindings/sound/dlg,da7213.yaml [new file with mode: 0644]
MAINTAINERS

diff --git a/Documentation/devicetree/bindings/sound/da7213.txt b/Documentation/devicetree/bindings/sound/da7213.txt
deleted file mode 100644 (file)
index 94584c9..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-Dialog Semiconductor DA7212/DA7213 Audio Codec bindings
-
-======
-
-Required properties:
-- compatible : Should be "dlg,da7212" or "dlg,da7213"
-- reg: Specifies the I2C slave address
-
-Optional properties:
-- clocks : phandle and clock specifier for codec MCLK.
-- clock-names : Clock name string for 'clocks' attribute, should be "mclk".
-
-- dlg,micbias1-lvl : Voltage (mV) for Mic Bias 1
-       [<1600>, <2200>, <2500>, <3000>]
-- dlg,micbias2-lvl : Voltage (mV) for Mic Bias 2
-       [<1600>, <2200>, <2500>, <3000>]
-- dlg,dmic-data-sel : DMIC channel select based on clock edge.
-       ["lrise_rfall", "lfall_rrise"]
-- dlg,dmic-samplephase : When to sample audio from DMIC.
-       ["on_clkedge", "between_clkedge"]
-- dlg,dmic-clkrate : DMIC clock frequency (Hz).
-       [<1500000>, <3000000>]
-
- - VDDA-supply : Regulator phandle for Analogue power supply
- - VDDMIC-supply : Regulator phandle for Mic Bias
- - VDDIO-supply : Regulator phandle for I/O power supply
-
-======
-
-Example:
-
-       codec_i2c: da7213@1a {
-               compatible = "dlg,da7213";
-               reg = <0x1a>;
-
-               clocks = <&clks 201>;
-               clock-names = "mclk";
-
-               dlg,micbias1-lvl = <2500>;
-               dlg,micbias2-lvl = <2500>;
-
-               dlg,dmic-data-sel = "lrise_rfall";
-               dlg,dmic-samplephase = "between_clkedge";
-               dlg,dmic-clkrate = <3000000>;
-       };
diff --git a/Documentation/devicetree/bindings/sound/dlg,da7213.yaml b/Documentation/devicetree/bindings/sound/dlg,da7213.yaml
new file mode 100644 (file)
index 0000000..c2dede1
--- /dev/null
@@ -0,0 +1,103 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/dlg,da7213.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Dialog Semiconductor DA7212/DA7213 Audio Codec
+
+maintainers:
+  - Support Opensource <support.opensource@diasemi.com>
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    enum:
+      - dlg,da7212
+      - dlg,da7213
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: mclk
+
+  "#sound-dai-cells":
+    const: 0
+
+  dlg,micbias1-lvl:
+    description: Voltage (mV) for Mic Bias 1
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [ 1600, 2200, 2500, 3000 ]
+
+  dlg,micbias2-lvl:
+    description: Voltage (mV) for Mic Bias 2
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [ 1600, 2200, 2500, 3000 ]
+
+  dlg,dmic-data-sel:
+    description: DMIC channel select based on clock edge
+    enum: [ lrise_rfall, lfall_rrise ]
+
+  dlg,dmic-samplephase:
+    description: When to sample audio from DMIC
+    enum: [ on_clkedge, between_clkedge ]
+
+  dlg,dmic-clkrate:
+    description: DMIC clock frequency (Hz)
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [ 1500000, 3000000 ]
+
+  VDDA-supply:
+    description: Analogue power supply
+
+  VDDIO-supply:
+    description: I/O power supply
+
+  VDDMIC-supply:
+    description: Mic Bias
+
+  VDDSP-supply:
+    description: Speaker supply
+
+  ports:
+    $ref: audio-graph-port.yaml#/definitions/ports
+
+  port:
+    $ref: audio-graph-port.yaml#
+    unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        codec@1a {
+            compatible = "dlg,da7213";
+            reg = <0x1a>;
+
+            clocks = <&clks 201>;
+            clock-names = "mclk";
+
+            #sound-dai-cells = <0>;
+
+            dlg,micbias1-lvl = <2500>;
+            dlg,micbias2-lvl = <2500>;
+
+            dlg,dmic-data-sel = "lrise_rfall";
+            dlg,dmic-samplephase = "between_clkedge";
+            dlg,dmic-clkrate = <3000000>;
+        };
+    };
index 42decde3832066e43a460a83b0634e4d9af0c797..88a40557db32d475ab051da753b49d716405391c 100644 (file)
@@ -6500,6 +6500,7 @@ F:        Documentation/devicetree/bindings/regulator/da92*.txt
 F:     Documentation/devicetree/bindings/regulator/dlg,da9*.yaml
 F:     Documentation/devicetree/bindings/regulator/dlg,slg51000.yaml
 F:     Documentation/devicetree/bindings/sound/da[79]*.txt
+F:     Documentation/devicetree/bindings/sound/dlg,da7213.yaml
 F:     Documentation/devicetree/bindings/thermal/dlg,da9062-thermal.yaml
 F:     Documentation/devicetree/bindings/watchdog/dlg,da9062-watchdog.yaml
 F:     Documentation/hwmon/da90??.rst