Skip to contentSkip to conversation

ASoC: dt-bindings: fsl-sai: Simplify the VFxxx dmas binding

PATCH Applied Marek Vasut 5 participants 7 messages Jan 5, 2023 – Jan 30, 2023

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

PATCH 1/2 ASoC: dt-bindings: fsl-sai: Simplify the VFxxx dmas binding

Get rid of the vf610 sai special case, instead update the vfxxx.dtsi DT to use the same DMA channel ordering as all the other devices. The sai DMA channel ordering has not been aligned with other IP DMA channel ordering in the vfxxx.dtsi anyway.

---
Cc: Adam Ford <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Joakim Zhang <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Liam Girdwood <[email protected]>
Cc: Lucas Stach <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Markus Niebel <[email protected]>
Cc: NXP Linux Team <[email protected]>
Cc: Paul Elder <[email protected]>
Cc: Peng Fan <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Richard Cochran <[email protected]>
Cc: Richard Zhu <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Shengjiu Wang <[email protected]>
Cc: Stefan Agner <[email protected]>
Cc: Tim Harvey <[email protected]>
Cc: [email protected]
Cc: [email protected]
To: [email protected]

---
 .../devicetree/bindings/sound/fsl,sai.yaml    | 38 ++++---------------
 1 file changed, 8 insertions(+), 30 deletions(-)
Documentation/devicetree/bindings/sound/fsl,sai.yaml +8 -30
index 7e56337d8edc1..088c26b001cc0 100644
@@ -76,10 +76,14 @@ properties:
         minItems: 4
 
   dmas:
-    maxItems: 2
+    items:
+      - description: DMA controller phandle and request line for RX
+      - description: DMA controller phandle and request line for TX
 
   dma-names:
-    maxItems: 2
+    items:
+      - const: rx
+      - const: tx
 
   interrupts:
     items:
@@ -142,31 +146,6 @@ properties:
 
 allOf:
   - $ref: dai-common.yaml#
-  - if:
-      properties:
-        compatible:
-          contains:
-            const: fsl,vf610-sai
-    then:
-      properties:
-        dmas:
-          items:
-            - description: DMA controller phandle and request line for TX
-            - description: DMA controller phandle and request line for RX
-        dma-names:
-          items:
-            - const: tx
-            - const: rx
-    else:
-      properties:
-        dmas:
-          items:
-            - description: DMA controller phandle and request line for RX
-            - description: DMA controller phandle and request line for TX
-        dma-names:
-          items:
-            - const: rx
-            - const: tx
   - if:
       required:
         - fsl,sai-asynchronous
@@ -199,9 +178,8 @@ examples:
                  <&clks VF610_CLK_SAI2>,
                  <&clks 0>, <&clks 0>;
         clock-names = "bus", "mclk1", "mclk2", "mclk3";
-        dma-names = "tx", "rx";
-        dmas = <&edma0 0 21>,
-               <&edma0 0 20>;
+        dma-names = "rx", "tx";
+        dmas = <&edma0 0 20>, <&edma0 0 21>;
         big-endian;
         lsb-first;
     };
Signature · 1 line
2.39.0
#1 lore raw

PATCH 2/2 ARM: dts: vfxxx: Swap SAI DMA order

Swap the SAI dmas and dma-names to match the order documented in Documentation/devicetree/bindings/sound/fsl,sai.yaml No functional change.

---
Cc: Adam Ford <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Joakim Zhang <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Liam Girdwood <[email protected]>
Cc: Lucas Stach <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Markus Niebel <[email protected]>
Cc: NXP Linux Team <[email protected]>
Cc: Paul Elder <[email protected]>
Cc: Peng Fan <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Richard Cochran <[email protected]>
Cc: Richard Zhu <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Shengjiu Wang <[email protected]>
Cc: Stefan Agner <[email protected]>
Cc: Tim Harvey <[email protected]>
Cc: [email protected]
Cc: [email protected]
To: [email protected]

---
 arch/arm/boot/dts/vfxxx.dtsi | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)
arch/arm/boot/dts/vfxxx.dtsi +8 -12
index d53f9c9db8bfd..ff4479994b600 100644
@@ -191,9 +191,8 @@ sai0: sai@4002f000 {
 					<&clks VF610_CLK_SAI0_DIV>,
 					<&clks 0>, <&clks 0>;
 				clock-names = "bus", "mclk1", "mclk2", "mclk3";
-				dma-names = "tx", "rx";
-				dmas = <&edma0 0 17>,
-					<&edma0 0 16>;
+				dma-names = "rx", "tx";
+				dmas = <&edma0 0 16>, <&edma0 0 17>;
 				status = "disabled";
 			};
 
@@ -205,9 +204,8 @@ sai1: sai@40030000 {
 					<&clks VF610_CLK_SAI1_DIV>,
 					<&clks 0>, <&clks 0>;
 				clock-names = "bus", "mclk1", "mclk2", "mclk3";
-				dma-names = "tx", "rx";
-				dmas = <&edma0 0 19>,
-					<&edma0 0 18>;
+				dma-names = "rx", "tx";
+				dmas = <&edma0 0 18>, <&edma0 0 19>;
 				status = "disabled";
 			};
 
@@ -219,9 +217,8 @@ sai2: sai@40031000 {
 					<&clks VF610_CLK_SAI2_DIV>,
 					<&clks 0>, <&clks 0>;
 				clock-names = "bus", "mclk1", "mclk2", "mclk3";
-				dma-names = "tx", "rx";
-				dmas = <&edma0 0 21>,
-					<&edma0 0 20>;
+				dma-names = "rx", "tx";
+				dmas = <&edma0 0 20>, <&edma0 0 21>;
 				status = "disabled";
 			};
 
@@ -233,9 +230,8 @@ sai3: sai@40032000 {
 					<&clks VF610_CLK_SAI3_DIV>,
 					<&clks 0>, <&clks 0>;
 				clock-names = "bus", "mclk1", "mclk2", "mclk3";
-				dma-names = "tx", "rx";
-				dmas = <&edma0 1 9>,
-					<&edma0 1 8>;
+				dma-names = "rx", "tx";
+				dmas = <&edma0 1 8>, <&edma0 1 9>;
 				status = "disabled";
 			};
 
Signature · 1 line
2.39.0
#2 lore raw

Re: [PATCH 2/2] ARM: dts: vfxxx: Swap SAI DMA order

Am Donnerstag, dem 05.01.2023 um 15:41 +0100 schrieb Marek Vasut:

Quoted 4 lines

Swap the SAI dmas and dma-names to match the order documented in Documentation/devicetree/bindings/sound/fsl,sai.yaml No functional change.

While I'm not opposing this patch, I find this class of changes a bit odd. The *-names properties are there so the properties they are naming can be in any order in the DT without impacting the lookup. Enforcing a fixed order for named properties just feels odd.

Not sure if the schema validation could take this into account or if there is any policy in place already by the DT maintainer that we still want to enforce the same order in the DTs as in the bindings.

Regards,
Lucas

Quoted 84 lines

---
Cc: Adam Ford <[email protected]>
Cc: Alexander Stein <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Joakim Zhang <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Liam Girdwood <[email protected]>
Cc: Lucas Stach <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Markus Niebel <[email protected]>
Cc: NXP Linux Team <[email protected]>
Cc: Paul Elder <[email protected]>
Cc: Peng Fan <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Richard Cochran <[email protected]>
Cc: Richard Zhu <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Shengjiu Wang <[email protected]>
Cc: Stefan Agner <[email protected]>
Cc: Tim Harvey <[email protected]>
Cc: [email protected]
Cc: [email protected]
To: [email protected]

---
 arch/arm/boot/dts/vfxxx.dtsi | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)
arch/arm/boot/dts/vfxxx.dtsi +8 -12
index d53f9c9db8bfd..ff4479994b600 100644
@@ -191,9 +191,8 @@ sai0: sai@4002f000 {
 					<&clks VF610_CLK_SAI0_DIV>,
 					<&clks 0>, <&clks 0>;
 				clock-names = "bus", "mclk1", "mclk2", "mclk3";
-				dma-names = "tx", "rx";
-				dmas = <&edma0 0 17>,
-					<&edma0 0 16>;
+				dma-names = "rx", "tx";
+				dmas = <&edma0 0 16>, <&edma0 0 17>;
 				status = "disabled";
 			};
 
@@ -205,9 +204,8 @@ sai1: sai@40030000 {
 					<&clks VF610_CLK_SAI1_DIV>,
 					<&clks 0>, <&clks 0>;
 				clock-names = "bus", "mclk1", "mclk2", "mclk3";
-				dma-names = "tx", "rx";
-				dmas = <&edma0 0 19>,
-					<&edma0 0 18>;
+				dma-names = "rx", "tx";
+				dmas = <&edma0 0 18>, <&edma0 0 19>;
 				status = "disabled";
 			};
 
@@ -219,9 +217,8 @@ sai2: sai@40031000 {
 					<&clks VF610_CLK_SAI2_DIV>,
 					<&clks 0>, <&clks 0>;
 				clock-names = "bus", "mclk1", "mclk2", "mclk3";
-				dma-names = "tx", "rx";
-				dmas = <&edma0 0 21>,
-					<&edma0 0 20>;
+				dma-names = "rx", "tx";
+				dmas = <&edma0 0 20>, <&edma0 0 21>;
 				status = "disabled";
 			};
 
@@ -233,9 +230,8 @@ sai3: sai@40032000 {
 					<&clks VF610_CLK_SAI3_DIV>,
 					<&clks 0>, <&clks 0>;
 				clock-names = "bus", "mclk1", "mclk2", "mclk3";
-				dma-names = "tx", "rx";
-				dmas = <&edma0 1 9>,
-					<&edma0 1 8>;
+				dma-names = "rx", "tx";
+				dmas = <&edma0 1 8>, <&edma0 1 9>;
 				status = "disabled";
 			};
 
#3 lore raw

Re: [PATCH 2/2] ARM: dts: vfxxx: Swap SAI DMA order

Quoted 9 lines · Lucas Stach

Am Donnerstag, dem 05.01.2023 um 15:41 +0100 schrieb Marek Vasut:

Quoted 4 lines

Swap the SAI dmas and dma-names to match the order documented in Documentation/devicetree/bindings/sound/fsl,sai.yaml No functional change.

While I'm not opposing this patch, I find this class of changes a bit odd. The *-names properties are there so the properties they are naming can be in any order in the DT without impacting the lookup. Enforcing a fixed order for named properties just feels odd.

DT requires fixed order regardless of '-names' property. '-names' are not there to fulfill "can be in any order", but merely a helper.

Quoted 4 lines

Not sure if the schema validation could take this into account or if there is any policy in place already by the DT maintainer that we still want to enforce the same order in the DTs as in the bindings.

The order in DTS must obviously match bindings, however here both are changed, so what is exactly your concern?

Best regards,
Krzysztof

Reviewed-by on v1 1/2
#5 lore raw
In reply to Marek Vasut
Quoted 7 lines · Marek Vasut

Get rid of the vf610 sai special case, instead update the vfxxx.dtsi DT to use the same DMA channel ordering as all the other devices. The sai DMA channel ordering has not been aligned with other IP DMA channel ordering in the vfxxx.dtsi anyway.

---

Assuming that Linux implementation does not care about the order of these (and takes by name):

Although other users might not be happy about change of order...

Best regards,
Krzysztof

maintainer
#6 lore raw

Re: (subset) [PATCH 1/2] ASoC: dt-bindings: fsl-sai: Simplify the VFxxx dmas binding

In reply to Marek Vasut
Quoted 6 lines · Marek Vasut

Get rid of the vf610 sai special case, instead update the vfxxx.dtsi DT to use the same DMA channel ordering as all the other devices. The sai DMA channel ordering has not been aligned with other IP DMA channel ordering in the vfxxx.dtsi anyway.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: dt-bindings: fsl-sai: Simplify the VFxxx dmas binding

      commit: 21d64f6f63eeca9f136ac514ca801a5a6485cd78

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark