Skip to contentSkip to conversation

ASoC: dt-bindings: fsl,imx-audio-sgtl5000: Convert to dtschema

PATCH In review Animesh Agarwal 3 participants 3 messages Jun 22, 2024 – Jul 5, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: dt-bindings: fsl,imx-audio-sgtl5000: Convert to dtschema

Convert the imx-audio-sgtl bindings to DT schema. Make bindings complete by adding audio-cpu property.

---
 .../sound/fsl,imx-audio-sgtl5000.yaml         | 108 ++++++++++++++++++
 .../bindings/sound/imx-audio-sgtl5000.txt     |  56 ---------
 2 files changed, 108 insertions(+), 56 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt
Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml new file +108 -0
new file mode 100644
index 000000000000..906dcecb73b7
@@ -0,0 +1,108 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/fsl,imx-audio-sgtl5000.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale i.MX audio complex with SGTL5000 codec
+
+maintainers:
+  - Animesh Agarwal <[email protected]>
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - fsl,imx25-pdk-sgtl5000
+              - fsl,imx51-babbage-sgtl5000
+              - fsl,imx53-m53evk-sgtl5000
+              - tq,imx53-mba53-sgtl5000
+              - fsl,imx53-cpuvo-sgtl5000
+              - fsl,imx53-qsb-sgtl5000
+              - karo,tx53-audio-sgtl5000
+              - fsl,imx53-voipac-sgtl5000
+              - fsl,imx6q-ba16-sgtl5000
+              - fsl,imx6q-ventana-sgtl5000
+              - fsl,imx-sgtl5000
+              - fsl,imx6-armadeus-sgtl5000
+              - fsl,imx6dl-nit6xlite-sgtl5000
+              - fsl,imx6q-nitrogen6_max-sgtl5000
+              - fsl,imx6q-nitrogen6_som2-sgtl5000
+              - fsl,imx6q-nitrogen6x-sgtl5000
+              - fsl,imx6-rex-sgtl5000
+              - fsl,imx6q-sabrelite-sgtl5000
+              - fsl,imx6-wandboard-sgtl5000
+          - const: fsl,imx-audio-sgtl5000
+      - const: fsl,imx-audio-sgtl5000
+
+  model:
+    $ref: /schemas/types.yaml#/definitions/string
+    description: The user-visible name of this sound complex.
+
+  audio-cpu:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle of an CPU DAI controller
+
+  ssi-controller:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle of the i.MX SSI controller.
+
+  audio-codec:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle of the SGTL5000 audio codec.
+
+  audio-routing:
+    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
+    description: |
+      A list of the connections between audio components. Each entry is a pair
+      of strings, the first being the connection's sink, the second being the
+      connection's source. Valid names could be:
+
+      Power supplies:
+        * Mic Bias
+
+      SGTL5000 pins:
+        * MIC_IN
+        * LINE_IN
+        * HP_OUT
+        * LINE_OUT
+
+      Board connectors:
+        * Mic Jack
+        * Line In Jack
+        * Headphone Jack
+        * Line Out Jack
+        * Ext Spk
+
+  mux-int-port:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: The internal port of the i.MX audio muxer (AUDMUX).
+    enum: [1, 2]
+
+  mux-ext-port:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: The external port of the i.MX audio muxer.
+    enum: [3, 4, 5, 6]
+
+required:
+  - compatible
+  - model
+
+additionalProperties: false
+
+examples:
+  - |
+    sound {
+        compatible = "fsl,imx51-babbage-sgtl5000",
+            "fsl,imx-audio-sgtl5000";
+        model = "imx51-babbage-sgtl5000";
+        ssi-controller = <&ssi1>;
+        audio-codec = <&sgtl5000>;
+        audio-routing =
+            "MIC_IN", "Mic Jack",
+            "Mic Jack", "Mic Bias",
+            "Headphone Jack", "HP_OUT";
+        mux-int-port = <1>;
+        mux-ext-port = <3>;
+    };
Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt deleted +0 -56

56 lines not on this page · raw message

Signature · 1 line
2.45.2
#1 lore raw
Quoted 2 lines · Animesh Agarwal

Convert the imx-audio-sgtl bindings to DT schema. Make bindings complete by adding audio-cpu property.

On what basis? Who needs or uses audio-cpu? Driver? DTS? Both? If only DTS, then is it needed? Maybe not?

Quoted 29 lines
---
 .../sound/fsl,imx-audio-sgtl5000.yaml         | 108 ++++++++++++++++++
 .../bindings/sound/imx-audio-sgtl5000.txt     |  56 ---------
 2 files changed, 108 insertions(+), 56 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt
Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml new file +13 -0
new file mode 100644
index 000000000000..906dcecb73b7
@@ -0,0 +1,108 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/fsl,imx-audio-sgtl5000.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale i.MX audio complex with SGTL5000 codec
+
+maintainers:
+  - Animesh Agarwal <[email protected]>
+
+properties:
+  compatible:

Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml line 23

Quoted 10 lines
Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml new file +10 -0
+    oneOf:
+      - items:
+          - enum:
+              - fsl,imx25-pdk-sgtl5000
+              - fsl,imx51-babbage-sgtl5000
+              - fsl,imx53-m53evk-sgtl5000
+              - tq,imx53-mba53-sgtl5000
+              - fsl,imx53-cpuvo-sgtl5000
+              - fsl,imx53-qsb-sgtl5000
+              - karo,tx53-audio-sgtl5000

Keep list ordered alphabetically.

Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml line 35

Quoted 12 lines
Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml new file +12 -0
+              - fsl,imx53-voipac-sgtl5000
+              - fsl,imx6q-ba16-sgtl5000
+              - fsl,imx6q-ventana-sgtl5000
+              - fsl,imx-sgtl5000
+              - fsl,imx6-armadeus-sgtl5000
+              - fsl,imx6dl-nit6xlite-sgtl5000
+              - fsl,imx6q-nitrogen6_max-sgtl5000
+              - fsl,imx6q-nitrogen6_som2-sgtl5000
+              - fsl,imx6q-nitrogen6x-sgtl5000
+              - fsl,imx6-rex-sgtl5000
+              - fsl,imx6q-sabrelite-sgtl5000
+              - fsl,imx6-wandboard-sgtl5000

None of these were in the old binding and commit msg mentions only audio-cpu. From where do you get these?

Quoted 36 lines
Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml new file +36 -0
+          - const: fsl,imx-audio-sgtl5000
+      - const: fsl,imx-audio-sgtl5000
+
+  model:
+    $ref: /schemas/types.yaml#/definitions/string
+    description: The user-visible name of this sound complex.
+
+  audio-cpu:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle of an CPU DAI controller
+
+  ssi-controller:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle of the i.MX SSI controller.
+
+  audio-codec:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle of the SGTL5000 audio codec.
+
+  audio-routing:
+    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
+    description: |
+      A list of the connections between audio components. Each entry is a pair
+      of strings, the first being the connection's sink, the second being the
+      connection's source. Valid names could be:
+
+      Power supplies:
+        * Mic Bias
+
+      SGTL5000 pins:
+        * MIC_IN
+        * LINE_IN
+        * HP_OUT
+        * LINE_OUT
+
+      Board connectors:

Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml line 81

Quoted 10 lines
Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml new file +10 -0
+        * Mic Jack
+        * Line In Jack
+        * Headphone Jack
+        * Line Out Jack
+        * Ext Spk
+
+  mux-int-port:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: The internal port of the i.MX audio muxer (AUDMUX).
+    enum: [1, 2]

default:

Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml line 86

Quoted 5 lines
Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml new file +5 -0
+
+  mux-ext-port:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: The external port of the i.MX audio muxer.
+    enum: [3, 4, 5, 6]

defaukt:

Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml line 90

Quoted 4 lines
Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml new file +4 -0
+
+required:
+  - compatible
+  - model

Several other properties were required. Why changing this? Please explain in commit msg all changes done to the binding comparing to pure conversion.

Best regards,
Krzysztof

#2 lore raw
Quoted 124 lines · Krzysztof Kozlowski
Quoted 2 lines · Animesh Agarwal

Convert the imx-audio-sgtl bindings to DT schema. Make bindings complete by adding audio-cpu property.

On what basis? Who needs or uses audio-cpu? Driver? DTS? Both? If only DTS, then is it needed? Maybe not?

Quoted 29 lines
---
 .../sound/fsl,imx-audio-sgtl5000.yaml         | 108 ++++++++++++++++++
 .../bindings/sound/imx-audio-sgtl5000.txt     |  56 ---------
 2 files changed, 108 insertions(+), 56 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/imx-audio-sgtl5000.txt
Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml new file +13 -0
new file mode 100644
index 000000000000..906dcecb73b7
@@ -0,0 +1,108 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/fsl,imx-audio-sgtl5000.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale i.MX audio complex with SGTL5000 codec
+
+maintainers:
+  - Animesh Agarwal <[email protected]>
+
+properties:
+  compatible:

Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml line 23

Quoted 10 lines
Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml new file +10 -0
+    oneOf:
+      - items:
+          - enum:
+              - fsl,imx25-pdk-sgtl5000
+              - fsl,imx51-babbage-sgtl5000
+              - fsl,imx53-m53evk-sgtl5000
+              - tq,imx53-mba53-sgtl5000
+              - fsl,imx53-cpuvo-sgtl5000
+              - fsl,imx53-qsb-sgtl5000
+              - karo,tx53-audio-sgtl5000

Keep list ordered alphabetically.

Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml line 35

Quoted 12 lines
Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml new file +12 -0
+              - fsl,imx53-voipac-sgtl5000
+              - fsl,imx6q-ba16-sgtl5000
+              - fsl,imx6q-ventana-sgtl5000
+              - fsl,imx-sgtl5000
+              - fsl,imx6-armadeus-sgtl5000
+              - fsl,imx6dl-nit6xlite-sgtl5000
+              - fsl,imx6q-nitrogen6_max-sgtl5000
+              - fsl,imx6q-nitrogen6_som2-sgtl5000
+              - fsl,imx6q-nitrogen6x-sgtl5000
+              - fsl,imx6-rex-sgtl5000
+              - fsl,imx6q-sabrelite-sgtl5000
+              - fsl,imx6-wandboard-sgtl5000

None of these were in the old binding and commit msg mentions only audio-cpu. From where do you get these?

Quoted 36 lines
Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml new file +36 -0
+          - const: fsl,imx-audio-sgtl5000
+      - const: fsl,imx-audio-sgtl5000
+
+  model:
+    $ref: /schemas/types.yaml#/definitions/string
+    description: The user-visible name of this sound complex.
+
+  audio-cpu:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle of an CPU DAI controller
+
+  ssi-controller:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle of the i.MX SSI controller.
+
+  audio-codec:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: The phandle of the SGTL5000 audio codec.
+
+  audio-routing:
+    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
+    description: |
+      A list of the connections between audio components. Each entry is a pair
+      of strings, the first being the connection's sink, the second being the
+      connection's source. Valid names could be:
+
+      Power supplies:
+        * Mic Bias
+
+      SGTL5000 pins:
+        * MIC_IN
+        * LINE_IN
+        * HP_OUT
+        * LINE_OUT
+
+      Board connectors:

Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml line 81

Quoted 10 lines
Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml new file +10 -0
+        * Mic Jack
+        * Line In Jack
+        * Headphone Jack
+        * Line Out Jack
+        * Ext Spk
+
+  mux-int-port:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: The internal port of the i.MX audio muxer (AUDMUX).
+    enum: [1, 2]

default:

Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml line 86

Quoted 5 lines
Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml new file +5 -0
+
+  mux-ext-port:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: The external port of the i.MX audio muxer.
+    enum: [3, 4, 5, 6]

defaukt:

Quoted 8 lines

Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml line 90

Quoted 4 lines
Documentation/devicetree/bindings/sound/fsl,imx-audio-sgtl5000.yaml new file +4 -0
+
+required:
+  - compatible
+  - model

Several other properties were required. Why changing this? Please explain in commit msg all changes done to the binding comparing to pure conversion.

I wonder how should we handle the case where 1 compatible string is found in 2 drivers.

e.g

soc/fsl/fsl-asoc-card.c: { .compatible = "fsl,imx-audio-sgtl5000", },
soc/fsl/imx-sgtl5000.c: { .compatible = "fsl,imx-audio-sgtl5000", },

Take for example audio-cpu propertyssi-controller which was only added in the newer soc/fsl/fsl-asoc-card.c driver. So this is required in the new driver unless
the old binding "ssi-controller" is not present.

Given the fact that there are already 10 years since this commit:

commit 708b4351f08c08ea93f773fb9197bdd3f3b08273

Author: Nicolin Chen <[email protected]>
Date:   Wed Jul 30 19:27:38 2014 +0800

ASoC: fsl: Add Freescale Generic ASoC Sound Card with ASRC support

The driver is also compatible with the old Device Tree bindings of WM8962 and
SGTL5000. So we may consider to remove those two drivers after
this driver is
totally enabled. (It needs to be added into defconfig)

I think we should send a patch to remove soc/fsl/imx-sgtl5000.c because I assume that by this point it's functionality was fully implemented in soc/fsl/fsl-asoc-card.c

Thanks,
Daniel.