Skip to contentSkip to conversation

ASoC: dt-bindings: tegra20-ac97: convert to dt schema

PATCH Superseded Mohammad Shehar Yaar Tausif 2 participants 2 messages Apr 21, 2024

Subsystems (4)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: dt-bindings: tegra20-ac97: convert to dt schema

Convert NVIDIA Tegra20 AC97 binding to DT schema.

---
 .../bindings/sound/nvidia,tegra20-ac97.txt    | 36 ---------
 .../bindings/sound/nvidia,tegra20-ac97.yaml   | 80 +++++++++++++++++++
 2 files changed, 80 insertions(+), 36 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.txt
 create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml
Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.txt deleted +0 -36
deleted file mode 100644
index eaf00102d92c..000000000000
@@ -1,36 +0,0 @@
-NVIDIA Tegra 20 AC97 controller
-
-Required properties:
-- compatible : "nvidia,tegra20-ac97"
-- reg : Should contain AC97 controller registers location and length
-- interrupts : Should contain AC97 interrupt
-- resets : Must contain an entry for each entry in reset-names.
-  See ../reset/reset.txt for details.
-- reset-names : Must include the following entries:
-  - ac97
-- dmas : Must contain an entry for each entry in clock-names.
-  See ../dma/dma.txt for details.
-- dma-names : Must include the following entries:
-  - rx
-  - tx
-- clocks : Must contain one entry, for the module clock.
-  See ../clocks/clock-bindings.txt for details.
-- nvidia,codec-reset-gpio : The Tegra GPIO controller's phandle and the number
-  of the GPIO used to reset the external AC97 codec
-- nvidia,codec-sync-gpio : The Tegra GPIO controller's phandle and the number
-  of the GPIO corresponding with the AC97 DAP _FS line
-
-Example:
-
-ac97@70002000 {
-	compatible = "nvidia,tegra20-ac97";
-	reg = <0x70002000 0x200>;
-	interrupts = <0 81 0x04>;
-	nvidia,codec-reset-gpio = <&gpio 170 0>;
-	nvidia,codec-sync-gpio = <&gpio 120 0>;
-	clocks = <&tegra_car 3>;
-	resets = <&tegra_car 3>;
-	reset-names = "ac97";
-	dmas = <&apbdma 12>, <&apbdma 12>;
-	dma-names = "rx", "tx";
-};
Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml new file +80 -0

80 lines not on this page · raw message

Signature · 1 line
2.44.0
#1 lore raw
Quoted 3 lines · Mohammad Shehar Yaar Tausif

Convert NVIDIA Tegra20 AC97 binding to DT schema.

Thank you for your patch. There is something to discuss/improve.

Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml line 5

Quoted 12 lines
Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.txt deleted +0 -1
-};
Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml new file +5 -0
new file mode 100644
index 000000000000..e7ffa93eec30
@@ -0,0 +1,80 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/nvidia,tegra20-ac97.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#

All my other comments apply. Please confirm that you tested DTS.

Quoted 15 lines
Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml new file +15 -0
+
+title: NVIDIA Tegra20 AC97 controller
+
+maintainers:
+  - Thierry Reding <[email protected]>
+  - Jon Hunter <[email protected]>
+
+properties:
+  compatible:
+    const: nvidia,tegra20-ac97
+
+  reg:
+    maxItems: 1
+
+  resets:

Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml line 30

Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml new file +10 -0
+    maxItems: 1
+
+  reset-names:
+    const: ac97
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    minItems: 1

Nope, this must be maxItems instead.

Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml line 33

Quoted 3 lines
Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml new file +3 -0
+
+  dmas:
+    minItems: 2

No, maxItems instead.

Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml line 40

Quoted 7 lines
Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml new file +7 -0
+
+  dma-names:
+    items:
+      - const: rx
+      - const: tx
+
+  nvidia,codec-reset-gpio:

-gpios instead and mention this in commit msg.

Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml line 41

Quoted 1 line
Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml new file +1 -0
+    description: |

Do not need '|' unless you need to preserve formatting.

Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml line 47

Quoted 6 lines
Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml new file +6 -0
+      The Tegra GPIO controller's phandle and the number
+      of the GPIO used to reset the external AC97 codec
+    maxItems: 1
+
+  nvidia,codec-sync-gpio:
+    description: |

Ditto

Quoted 14 lines
Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml new file +14 -0
+      The Tegra GPIO controller's phandle and the number
+      of the GPIO corresponding with the AC97 DAP _FS line
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - resets
+  - reset-names
+  - interrupts
+  - clocks
+  - dmas
+  - dma-names
+  - nvidia,codec-reset-gpio

Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml line 71

Quoted 10 lines
Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml new file +10 -0
+  - nvidia,codec-sync-gpio
+
+additionalProperties: false
+
+examples:
+  - |
+    ac97@70002000 {
+            compatible = "nvidia,tegra20-ac97";
+            reg = <0x70002000 0x200>;
+            resets = <&tegra_car 3>;

All previous comments apply...

Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml line 73

Quoted 2 lines
Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml new file +2 -0
+            reset-names = "ac97";
+            interrupts = <0 81 0x04>;

Use proper defines.

Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml line 77

Quoted 4 lines
Documentation/devicetree/bindings/sound/nvidia,tegra20-ac97.yaml new file +4 -0
+            clocks = <&tegra_car 3>;
+            dmas = <&apbdma 12>, <&apbdma 12>;
+            dma-names = "rx", "tx";
+            nvidia,codec-reset-gpio = <&gpio 170 0>;

Include gpio header and use proper defines.

Best regards,
Krzysztof