[v2,08/10] dt-bindings: sound: Add support for QMC audio

Message ID 20230106163746.439717-9-herve.codina@bootlin.com
State New
Headers
Series Add the PowerQUICC audio support using the QMC |

Commit Message

Herve Codina Jan. 6, 2023, 4:37 p.m. UTC
  The QMC (QUICC mutichannel controller) is a controller
present in some PowerQUICC SoC such as MPC885.
The QMC audio is an ASoC component that uses the QMC
controller to transfer the audio data.

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
 .../bindings/sound/fsl,qmc-audio.yaml         | 110 ++++++++++++++++++
 1 file changed, 110 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml
  

Comments

Krzysztof Kozlowski Jan. 8, 2023, 3:16 p.m. UTC | #1
On 06/01/2023 17:37, Herve Codina wrote:
> The QMC (QUICC mutichannel controller) is a controller
> present in some PowerQUICC SoC such as MPC885.
> The QMC audio is an ASoC component that uses the QMC
> controller to transfer the audio data.
> 
> Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> ---
>  .../bindings/sound/fsl,qmc-audio.yaml         | 110 ++++++++++++++++++
>  1 file changed, 110 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml
> 
> diff --git a/Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml b/Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml
> new file mode 100644
> index 000000000000..b3774be36c19
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml
> @@ -0,0 +1,110 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/fsl,qmc-audio.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: QMC audio
> +
> +maintainers:
> +  - Herve Codina <herve.codina@bootlin.com>
> +
> +description: |
> +  The QMC audio is an ASoC component which uses QMC (QUICC Multichannel
> +  Controller) channels to transfer the audio data.
> +  It provides as many DAI as the number of QMC channel used.
> +
> +properties:
> +  compatible:
> +    items:

Drop items.

> +      - const: fsl,qmc-audio
> +
> +  '#address-cells':
> +    const: 1
> +  '#size-cells':
> +    const: 0
> +  '#sound-dai-cells':
> +    const: 1
> +
> +patternProperties:
> +  "^dai@([0-9]|[1-5][0-9]|6[0-3])$":
> +    description:
> +      A DAI managed by this controller
> +    type: object
> +
> +    properties:
> +      reg:
> +        minimum: 0
> +        maximum: 63
> +        description:
> +          The DAI number
> +
> +      qmc-chan:

Missing vendor prefix.

> +        $ref: /schemas/types.yaml#/definitions/phandle-array

Why this is not a phandle?

> +        description: phandle to the QMC channel> +        maxItems: 1
> +
> +    required:
> +      - reg
> +      - qmc-chan
> +
> +required:
> +  - compatible
> +  - '#address-cells'
> +  - '#size-cells'
> +  - '#sound-dai-cells'
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    qmc_audio: qmc_audio {

Same problem as in previous patch.

> +        compatible = "fsl,qmc-audio";
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        #sound-dai-cells = <1>;
> +        dai@16 {
> +            reg = <16>;
> +            qmc-chan = <&scc_qmc 16>;
> +        };
> +        dai@17 {
> +            reg = <17>;
> +            qmc-chan = <&scc_qmc 17>;
> +        };
> +    };

Best regards,
Krzysztof
  
Herve Codina Jan. 10, 2023, 8:07 a.m. UTC | #2
Hi Krzysztof,

On Sun, 8 Jan 2023 16:16:24 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:

> On 06/01/2023 17:37, Herve Codina wrote:
> > The QMC (QUICC mutichannel controller) is a controller
> > present in some PowerQUICC SoC such as MPC885.
> > The QMC audio is an ASoC component that uses the QMC
> > controller to transfer the audio data.
> > 
> > Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> > ---
> >  .../bindings/sound/fsl,qmc-audio.yaml         | 110 ++++++++++++++++++
> >  1 file changed, 110 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml b/Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml
> > new file mode 100644
> > index 000000000000..b3774be36c19
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml
> > @@ -0,0 +1,110 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/sound/fsl,qmc-audio.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: QMC audio
> > +
> > +maintainers:
> > +  - Herve Codina <herve.codina@bootlin.com>
> > +
> > +description: |
> > +  The QMC audio is an ASoC component which uses QMC (QUICC Multichannel
> > +  Controller) channels to transfer the audio data.
> > +  It provides as many DAI as the number of QMC channel used.
> > +
> > +properties:
> > +  compatible:
> > +    items:  
> 
> Drop items.

Will be dropped.

> 
> > +      - const: fsl,qmc-audio
> > +
> > +  '#address-cells':
> > +    const: 1
> > +  '#size-cells':
> > +    const: 0
> > +  '#sound-dai-cells':
> > +    const: 1
> > +
> > +patternProperties:
> > +  "^dai@([0-9]|[1-5][0-9]|6[0-3])$":
> > +    description:
> > +      A DAI managed by this controller
> > +    type: object
> > +
> > +    properties:
> > +      reg:
> > +        minimum: 0
> > +        maximum: 63
> > +        description:
> > +          The DAI number
> > +
> > +      qmc-chan:  
> 
> Missing vendor prefix.

Will be changed to 'fsl,qmc-chan'

> 
> > +        $ref: /schemas/types.yaml#/definitions/phandle-array  
> 
> Why this is not a phandle?

I have try '$ref: /schemas/types.yaml#/definitions/phandle'

I have an error from make dt_binding_check: 
  dai@16:fsl,qmc-chan:0: [4294967295, 16] is too long

I need a phandle with an argument ie <&qmc 16>.
Is there an alternative to phandle-array to handle this case ?

> 
> > +        description: phandle to the QMC channel> +        maxItems: 1
> > +
> > +    required:
> > +      - reg
> > +      - qmc-chan
> > +
> > +required:
> > +  - compatible
> > +  - '#address-cells'
> > +  - '#size-cells'
> > +  - '#sound-dai-cells'
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    qmc_audio: qmc_audio {  
> 
> Same problem as in previous patch.

Changed to 'audio-controller'.

> 
> > +        compatible = "fsl,qmc-audio";
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +        #sound-dai-cells = <1>;
> > +        dai@16 {
> > +            reg = <16>;
> > +            qmc-chan = <&scc_qmc 16>;
> > +        };
> > +        dai@17 {
> > +            reg = <17>;
> > +            qmc-chan = <&scc_qmc 17>;
> > +        };
> > +    };  
> 
> Best regards,
> Krzysztof
> 

Thanks for the review.

Best regards,
Hervé
  
Krzysztof Kozlowski Jan. 11, 2023, 9:58 a.m. UTC | #3
On 10/01/2023 09:07, Herve Codina wrote:
>>> +      qmc-chan:  
>>
>> Missing vendor prefix.
> 
> Will be changed to 'fsl,qmc-chan'
> 
>>
>>> +        $ref: /schemas/types.yaml#/definitions/phandle-array  
>>
>> Why this is not a phandle?
> 
> I have try '$ref: /schemas/types.yaml#/definitions/phandle'
> 
> I have an error from make dt_binding_check: 
>   dai@16:fsl,qmc-chan:0: [4294967295, 16] is too long
> 
> I need a phandle with an argument ie <&qmc 16>.
> Is there an alternative to phandle-array to handle this case ?

OK, then you need items like here:
https://elixir.bootlin.com/linux/v5.18-rc1/source/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml#L42


Best regards,
Krzysztof
  

Patch

diff --git a/Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml b/Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml
new file mode 100644
index 000000000000..b3774be36c19
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/fsl,qmc-audio.yaml
@@ -0,0 +1,110 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/fsl,qmc-audio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: QMC audio
+
+maintainers:
+  - Herve Codina <herve.codina@bootlin.com>
+
+description: |
+  The QMC audio is an ASoC component which uses QMC (QUICC Multichannel
+  Controller) channels to transfer the audio data.
+  It provides as many DAI as the number of QMC channel used.
+
+properties:
+  compatible:
+    items:
+      - const: fsl,qmc-audio
+
+  '#address-cells':
+    const: 1
+  '#size-cells':
+    const: 0
+  '#sound-dai-cells':
+    const: 1
+
+patternProperties:
+  "^dai@([0-9]|[1-5][0-9]|6[0-3])$":
+    description:
+      A DAI managed by this controller
+    type: object
+
+    properties:
+      reg:
+        minimum: 0
+        maximum: 63
+        description:
+          The DAI number
+
+      qmc-chan:
+        $ref: /schemas/types.yaml#/definitions/phandle-array
+        description: phandle to the QMC channel
+        maxItems: 1
+
+    required:
+      - reg
+      - qmc-chan
+
+required:
+  - compatible
+  - '#address-cells'
+  - '#size-cells'
+  - '#sound-dai-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    qmc_audio: qmc_audio {
+        compatible = "fsl,qmc-audio";
+        #address-cells = <1>;
+        #size-cells = <0>;
+        #sound-dai-cells = <1>;
+        dai@16 {
+            reg = <16>;
+            qmc-chan = <&scc_qmc 16>;
+        };
+        dai@17 {
+            reg = <17>;
+            qmc-chan = <&scc_qmc 17>;
+        };
+    };
+
+    sound {
+        compatible = "simple-audio-card";
+        #address-cells = <1>;
+        #size-cells = <0>;
+        simple-audio-card,dai-link@0 {
+            reg = <0>;
+            format = "dsp_b";
+            cpu {
+                sound-dai = <&qmc_audio 16>;
+            };
+            codec {
+                sound-dai = <&codec1>;
+                dai-tdm-slot-num = <4>;
+                dai-tdm-slot-width = <8>;
+                /* TS 3, 5, 7, 9 */
+                dai-tdm-slot-tx-mask = <0 0 0 1 0 1 0 1 0 1>;
+                dai-tdm-slot-rx-mask = <0 0 0 1 0 1 0 1 0 1>;
+            };
+        };
+        simple-audio-card,dai-link@1 {
+            reg = <1>;
+            format = "dsp_b";
+            cpu {
+                sound-dai = <&qmc_audio 17>;
+            };
+            codec {
+                sound-dai = <&codec2>;
+                dai-tdm-slot-num = <4>;
+                dai-tdm-slot-width = <8>;
+                /* TS 2, 4, 6, 8 */
+                dai-tdm-slot-tx-mask = <0 0 1 0 1 0 1 0 1>;
+                dai-tdm-slot-rx-mask = <0 0 1 0 1 0 1 0 1>;
+            };
+        };
+    };