Skip to contentSkip to conversation

ASoC: dt-bindings: rockchip,rk3036-codec: convert to yaml

PATCH Superseded Heiko Stuebner 2 participants 3 messages Oct 7, 2024

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Heiko Stuebner

author maintainer
#0 lore raw

PATCH 1/1 ASoC: dt-bindings: rockchip,rk3036-codec: convert to yaml

Convert the binding to yaml.

The codec seems to be from Innosilicon, but the compatible has ever only been rockchip-based, as they sythesized the codec for the rk3036.

So the yaml file gets a name matching that compatible.
The only other notable change is the addition of the #sound-dai-cells property, that is always required.

---
 .../devicetree/bindings/sound/inno-rk3036.txt | 20 -------
 .../bindings/sound/rockchip,rk3036-codec.yaml | 57 +++++++++++++++++++
 2 files changed, 57 insertions(+), 20 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/inno-rk3036.txt
 create mode 100644 Documentation/devicetree/bindings/sound/rockchip,rk3036-codec.yaml
Documentation/devicetree/bindings/sound/inno-rk3036.txt deleted +0 -20
deleted file mode 100644
index 758de8e27561..000000000000
@@ -1,20 +0,0 @@
-Inno audio codec for RK3036
-
-Inno audio codec is integrated inside RK3036 SoC.
-
-Required properties:
-- compatible : Should be "rockchip,rk3036-codec".
-- reg : The registers of codec.
-- clock-names : Should be "acodec_pclk".
-- clocks : The clock of codec.
-- rockchip,grf : The phandle of grf device node.
-
-Example:
-
-	acodec: acodec-ana@20030000 {
-		compatible = "rk3036-codec";
-		reg = <0x20030000 0x4000>;
-		rockchip,grf = <&grf>;
-		clock-names = "acodec_pclk";
-		clocks = <&cru ACLK_VCODEC>;
-	};
Documentation/devicetree/bindings/sound/rockchip,rk3036-codec.yaml new file +57 -0

57 lines not on this page · raw message

Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 49 lines · Heiko Stuebner

Convert the binding to yaml.

The codec seems to be from Innosilicon, but the compatible has ever only been rockchip-based, as they sythesized the codec for the rk3036.

So the yaml file gets a name matching that compatible.
The only other notable change is the addition of the #sound-dai-cells property, that is always required.

---
 .../devicetree/bindings/sound/inno-rk3036.txt | 20 -------
 .../bindings/sound/rockchip,rk3036-codec.yaml | 57 +++++++++++++++++++
 2 files changed, 57 insertions(+), 20 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/inno-rk3036.txt
 create mode 100644 Documentation/devicetree/bindings/sound/rockchip,rk3036-codec.yaml
Documentation/devicetree/bindings/sound/inno-rk3036.txt deleted +0 -20
deleted file mode 100644
index 758de8e27561..000000000000
@@ -1,20 +0,0 @@
-Inno audio codec for RK3036
-
-Inno audio codec is integrated inside RK3036 SoC.
-
-Required properties:
-- compatible : Should be "rockchip,rk3036-codec".
-- reg : The registers of codec.
-- clock-names : Should be "acodec_pclk".
-- clocks : The clock of codec.
-- rockchip,grf : The phandle of grf device node.
-
-Example:
-
-	acodec: acodec-ana@20030000 {
-		compatible = "rk3036-codec";
-		reg = <0x20030000 0x4000>;
-		rockchip,grf = <&grf>;
-		clock-names = "acodec_pclk";
-		clocks = <&cru ACLK_VCODEC>;
-	};
Documentation/devicetree/bindings/sound/rockchip,rk3036-codec.yaml new file +0 -0
new file mode 100644
index 000000000000..786b1ec41999

Documentation/devicetree/bindings/sound/rockchip,rk3036-codec.yaml line 10

Quoted 10 lines
Documentation/devicetree/bindings/sound/rockchip,rk3036-codec.yaml new file +10 -0
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/rockchip,rk3036-codec.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Rockchip RK3036 internal codec
+
+maintainers:
+  - Heiko Stuebner <[email protected]>

Blank line

Quoted 50 lines
Documentation/devicetree/bindings/sound/rockchip,rk3036-codec.yaml new file +47 -0
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: rockchip,rk3036-codec
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: clock for audio codec
+
+  clock-names:
+    items:
+      - const: acodec_pclk
+
+  rockchip,grf:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      The phandle of the syscon node for the GRF register.
+
+  "#sound-dai-cells":
+    const: 0
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - rockchip,grf
+  - "#sound-dai-cells"
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/rk3036-cru.h>
+    acodec: audio-codec@20030000 {
+      compatible = "rockchip,rk3036-codec";
+      reg = <0x20030000 0x4000>;
+      rockchip,grf = <&grf>;
+      clock-names = "acodec_pclk";
+      clocks = <&cru ACLK_VCODEC>;
+      #sound-dai-cells = <0>;
+    };
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Heiko Stuebner
Quoted 9 lines · Heiko Stuebner

Convert the binding to yaml.

The codec seems to be from Innosilicon, but the compatible has ever only been rockchip-based, as they sythesized the codec for the rk3036.

So the yaml file gets a name matching that compatible.
The only other notable change is the addition of the #sound-dai-cells property, that is always required.

Quoted 8 lines
---
 .../devicetree/bindings/sound/inno-rk3036.txt | 20 -------
 .../bindings/sound/rockchip,rk3036-codec.yaml | 57 +++++++++++++++++++
 2 files changed, 57 insertions(+), 20 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/inno-rk3036.txt
 create mode 100644 Documentation/devicetree/bindings/sound/rockchip,rk3036-codec.yaml