* [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX
@ 2025-10-20 17:10 Chen-Yu Tsai
  2025-10-20 17:10 ` [PATCH 01/11] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatibles for A523 Chen-Yu Tsai
                   ` (11 more replies)
  0 siblings, 12 replies; 28+ messages in thread
From: Chen-Yu Tsai @ 2025-10-20 17:10 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul
  Cc: linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
Hi folks,
This series enables the SPDIF and I2S hardware found on the Allwinner
A523/A527/T527 family SoCs. These SoCs have one SPDIF interface and
four I2S interfaces. All of them are capable of both playback and
capture, however the SPDIF driver only supports playback.
The series is organized by subsystem, so each maintainer can find the
patches they need to take.
Patch 1 adds SoC/hardware specific compatibles for the two DMA
controllers in the A523 SoC.
Patch 2 adds an SoC specific compatible for the I2S interface
controllers in the A523 SoC.
Patch 3 adds an SoC specific compatible for the SPDIF interface
controller in the A523 SoC.
Patch 4 adds driver support for the SPDIF interface.
Patch 5 marks a clock related to the DMA controller as critical. The
docs are quite vague on how this particular clock gate ties in with
the other memory bus gate that the DMA controller needs.
Patch 6 tweaks the software lower limit of the audio PLL.
Patch 7 adds devices nodes for the DMA controllers.
Patch 8 adds a devices node for the SPDIF interface controller.
Patch 9 adds device nodes for the I2S interface controllers.
Patch 10 adds one set of pinmux settings for I2S2.
Patch 11 is what I used to test the changes, and serves as an example
for how to use these new interfaces.
Patch 1 can go through the dmaengine tree, or I can take it through the
sunxi tree.
Patches 2 through 4 should go through the ASoC tree.
The rest, except the example, will go through the sunxi tree.
Please take a look.
Thanks
ChenYu
Chen-Yu Tsai (11):
  dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatibles for A523
  ASoC: dt-bindings: allwinner,sun4i-a10-i2s: Add compatible for A523
  ASoC: dt-bindings: allwinner,sun4i-a10-spdif: Add compatible for A523
  ASoC: sun4i-spdif: Support SPDIF output on A523 family
  clk: sunxi-ng: sun55i-a523-r-ccu: Mark bus-r-dma as critical
  clk: sunxi-ng: sun55i-a523-ccu: Lower audio0 pll minimum rate
  arm64: dts: allwinner: a523: Add DMA controller device nodes
  arm64: dts: allwinner: a523: Add device node for SPDIF block
  arm64: dts: allwinner: a523: Add device nodes for I2S controllers
  arm64: dts: allwinner: a523: Add I2S2 pins on PI pin group
  [EXAMPLE] arm64: dts: allwinner: a527-cubie-a5e: Enable I2S and SPDIF
    output
 .../dma/allwinner,sun50i-a64-dma.yaml         |   5 +-
 .../sound/allwinner,sun4i-a10-i2s.yaml        |   4 +-
 .../sound/allwinner,sun4i-a10-spdif.yaml      |  44 +++++-
 .../arm64/boot/dts/allwinner/sun55i-a523.dtsi | 135 ++++++++++++++++++
 .../dts/allwinner/sun55i-a527-cubie-a5e.dts   |  52 +++++++
 drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c      |   2 +-
 drivers/clk/sunxi-ng/ccu-sun55i-a523.c        |   2 +-
 sound/soc/sunxi/sun4i-spdif.c                 |  28 +++-
 8 files changed, 259 insertions(+), 13 deletions(-)
-- 
2.47.3
^ permalink raw reply	[flat|nested] 28+ messages in thread
* [PATCH 01/11] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatibles for A523
  2025-10-20 17:10 [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX Chen-Yu Tsai
@ 2025-10-20 17:10 ` Chen-Yu Tsai
  2025-10-20 17:37   ` Conor Dooley
  2025-10-20 17:10 ` [PATCH 02/11] ASoC: dt-bindings: allwinner,sun4i-a10-i2s: Add compatible " Chen-Yu Tsai
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 28+ messages in thread
From: Chen-Yu Tsai @ 2025-10-20 17:10 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul
  Cc: Chen-Yu Tsai, linux-sunxi, linux-sound, linux-clk,
	linux-arm-kernel, devicetree, dmaengine, linux-kernel
From: Chen-Yu Tsai <wens@csie.org>
There are two DMA controllers on the A523, one in the main system area
and the other for the MCU. These are the same as the one found on the
A100. The only difference is the DMA endpoint (DRQ) layout.
Since the number of channels and endpoints are described with additional
generic properties, just add new A523-specific compatible strings and
fallback to the A100 one.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
I could probably take this through the soc tree if Vinod gives an ack.
 .../devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
index 0f2501f72cca..c3e14eb6cfff 100644
--- a/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
+++ b/Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml
@@ -29,7 +29,10 @@ properties:
           - const: allwinner,sun8i-r40-dma
           - const: allwinner,sun50i-a64-dma
       - items:
-          - const: allwinner,sun50i-h616-dma
+          - enum:
+              - allwinner,sun50i-h616-dma
+              - allwinner,sun55i-a523-dma
+              - allwinner,sun55i-a523-mcu-dma
           - const: allwinner,sun50i-a100-dma
 
   reg:
-- 
2.47.3
^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [PATCH 02/11] ASoC: dt-bindings: allwinner,sun4i-a10-i2s: Add compatible for A523
  2025-10-20 17:10 [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX Chen-Yu Tsai
  2025-10-20 17:10 ` [PATCH 01/11] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatibles for A523 Chen-Yu Tsai
@ 2025-10-20 17:10 ` Chen-Yu Tsai
  2025-10-20 17:38   ` Conor Dooley
  2025-10-20 17:10 ` [PATCH 03/11] ASoC: dt-bindings: allwinner,sun4i-a10-spdif: " Chen-Yu Tsai
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 28+ messages in thread
From: Chen-Yu Tsai @ 2025-10-20 17:10 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul
  Cc: linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
As far as the author can tell, based on their respective manuals,
the I2S interface controllers found in the Allwinner A523 SoC is the
same as ones in the R329 SoC.
Add a SoC-specific compatible for it, with a fallback to the R329's
compatible.
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
 .../devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml b/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml
index 739114fb6549..ae86cb5f0a74 100644
--- a/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml
+++ b/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml
@@ -33,7 +33,9 @@ properties:
       - const: allwinner,sun50i-h6-i2s
       - const: allwinner,sun50i-r329-i2s
       - items:
-          - const: allwinner,sun20i-d1-i2s
+          - enum:
+              - allwinner,sun20i-d1-i2s
+              - allwinner,sun55i-a523-i2s
           - const: allwinner,sun50i-r329-i2s
 
   reg:
-- 
2.47.3
^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [PATCH 03/11] ASoC: dt-bindings: allwinner,sun4i-a10-spdif: Add compatible for A523
  2025-10-20 17:10 [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX Chen-Yu Tsai
  2025-10-20 17:10 ` [PATCH 01/11] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatibles for A523 Chen-Yu Tsai
  2025-10-20 17:10 ` [PATCH 02/11] ASoC: dt-bindings: allwinner,sun4i-a10-i2s: Add compatible " Chen-Yu Tsai
@ 2025-10-20 17:10 ` Chen-Yu Tsai
  2025-10-20 17:38   ` Conor Dooley
  2025-10-20 17:10 ` [PATCH 04/11] ASoC: sun4i-spdif: Support SPDIF output on A523 family Chen-Yu Tsai
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 28+ messages in thread
From: Chen-Yu Tsai @ 2025-10-20 17:10 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul
  Cc: linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
The SPDIF hardware block in the A523 SoC has the same layout as the
H616 for the transmitter side. However unlike previous generations,
the hardware block now takes separate module clocks for the TX and RX
sides. This presumably allows the hardware to send and receive audio
streams at different sample rates. The new hardware also gained RX
insertion detection, and some extra information registers.
Add a new compatible for it without any fallbacks.
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
 .../sound/allwinner,sun4i-a10-spdif.yaml      | 44 ++++++++++++++++---
 1 file changed, 38 insertions(+), 6 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-spdif.yaml b/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-spdif.yaml
index aa32dc950e72..1d089ba70f45 100644
--- a/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-spdif.yaml
+++ b/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-spdif.yaml
@@ -23,6 +23,7 @@ properties:
       - const: allwinner,sun8i-h3-spdif
       - const: allwinner,sun50i-h6-spdif
       - const: allwinner,sun50i-h616-spdif
+      - const: allwinner,sun55i-a523-spdif
       - items:
           - const: allwinner,sun8i-a83t-spdif
           - const: allwinner,sun8i-h3-spdif
@@ -37,14 +38,12 @@ properties:
     maxItems: 1
 
   clocks:
-    items:
-      - description: Bus Clock
-      - description: Module Clock
+    minItems: 2
+    maxItems: 3
 
   clock-names:
-    items:
-      - const: apb
-      - const: spdif
+    minItems: 2
+    maxItems: 3
 
   # Even though it only applies to subschemas under the conditionals,
   # not listing them here will trigger a warning because of the
@@ -65,6 +64,7 @@ allOf:
               - allwinner,sun8i-h3-spdif
               - allwinner,sun50i-h6-spdif
               - allwinner,sun50i-h616-spdif
+              - allwinner,sun55i-a523-spdif
 
     then:
       required:
@@ -98,6 +98,38 @@ allOf:
             - const: rx
             - const: tx
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - allwinner,sun55i-a523-spdif
+
+    then:
+      properties:
+        clocks:
+          items:
+            - description: Bus Clock
+            - description: TX Clock
+            - description: RX Clock
+
+        clock-names:
+          items:
+            - const: apb
+            - const: tx
+            - const: rx
+    else:
+      properties:
+        clocks:
+          items:
+            - description: Bus Clock
+            - description: Module Clock
+
+        clock-names:
+          items:
+            - const: apb
+            - const: spdif
+
 required:
   - "#sound-dai-cells"
   - compatible
-- 
2.47.3
^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [PATCH 04/11] ASoC: sun4i-spdif: Support SPDIF output on A523 family
  2025-10-20 17:10 [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX Chen-Yu Tsai
                   ` (2 preceding siblings ...)
  2025-10-20 17:10 ` [PATCH 03/11] ASoC: dt-bindings: allwinner,sun4i-a10-spdif: " Chen-Yu Tsai
@ 2025-10-20 17:10 ` Chen-Yu Tsai
  2025-10-20 17:49   ` Jernej Škrabec
  2025-10-21 12:55   ` kernel test robot
  2025-10-20 17:10 ` [PATCH 05/11] clk: sunxi-ng: sun55i-a523-r-ccu: Mark bus-r-dma as critical Chen-Yu Tsai
                   ` (7 subsequent siblings)
  11 siblings, 2 replies; 28+ messages in thread
From: Chen-Yu Tsai @ 2025-10-20 17:10 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul
  Cc: linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
The TX side of the SPDIF block on the A523 is almost the same the
previous generations, the only difference being that it has separate
module clock inputs for the TX and RX side.
Since this driver currently only supports TX, add support for a
different clock name so that TX and RX clocks can be separated
if RX support is ever added. Then add support for the A523.
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
 sound/soc/sunxi/sun4i-spdif.c | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c
index 34e5bd94e9af..6a58dc4311de 100644
--- a/sound/soc/sunxi/sun4i-spdif.c
+++ b/sound/soc/sunxi/sun4i-spdif.c
@@ -177,6 +177,7 @@ struct sun4i_spdif_quirks {
 	bool has_reset;
 	unsigned int val_fctl_ftx;
 	unsigned int mclk_multiplier;
+	const char *tx_clk_name;
 };
 
 struct sun4i_spdif_dev {
@@ -323,6 +324,7 @@ static int sun4i_spdif_hw_params(struct snd_pcm_substream *substream,
 	}
 	mclk *= host->quirks->mclk_multiplier;
 
+	dev_info(&pdev->dev, "Setting SPDIF clock rate to %u\n", mclk);
 	ret = clk_set_rate(host->spdif_clk, mclk);
 	if (ret < 0) {
 		dev_err(&pdev->dev,
@@ -542,7 +544,6 @@ static struct snd_soc_dai_driver sun4i_spdif_dai = {
 		.formats = SUN4I_FORMATS,
 	},
 	.ops = &sun4i_spdif_dai_ops,
-	.name = "spdif",
 };
 
 static const struct sun4i_spdif_quirks sun4i_a10_spdif_quirks = {
@@ -572,6 +573,14 @@ static const struct sun4i_spdif_quirks sun50i_h6_spdif_quirks = {
 	.mclk_multiplier = 1,
 };
 
+static const struct sun4i_spdif_quirks sun55i_a523_spdif_quirks = {
+	.reg_dac_txdata = SUN8I_SPDIF_TXFIFO,
+	.val_fctl_ftx   = SUN50I_H6_SPDIF_FCTL_FTX,
+	.has_reset      = true,
+	.mclk_multiplier = 1,
+	.tx_clk_name	= "tx",
+};
+
 static const struct of_device_id sun4i_spdif_of_match[] = {
 	{
 		.compatible = "allwinner,sun4i-a10-spdif",
@@ -594,6 +603,15 @@ static const struct of_device_id sun4i_spdif_of_match[] = {
 		/* Essentially the same as the H6, but without RX */
 		.data = &sun50i_h6_spdif_quirks,
 	},
+	{
+		.compatible = "allwinner,sun55i-a523-spdif",
+		/*
+		 * Almost the same as H6, but has split the TX and RX clocks,
+		 * has a separate reset bit for the RX side, and has some
+		 * expanded features for the RX side.
+		 */
+		.data = &sun55i_a523_spdif_quirks,
+	},
 	{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, sun4i_spdif_of_match);
@@ -635,6 +653,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
 	const struct sun4i_spdif_quirks *quirks;
 	int ret;
 	void __iomem *base;
+	const char *tx_clk_name = "spdif";
 
 	dev_dbg(&pdev->dev, "Entered %s\n", __func__);
 
@@ -671,9 +690,12 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
 		return PTR_ERR(host->apb_clk);
 	}
 
-	host->spdif_clk = devm_clk_get(&pdev->dev, "spdif");
+	if (quirks->tx_clk_name)
+		tx_clk_name = quirks->tx_clk_name;
+	host->spdif_clk = devm_clk_get(&pdev->dev, tx_clk_name);
 	if (IS_ERR(host->spdif_clk)) {
-		dev_err(&pdev->dev, "failed to get a spdif clock.\n");
+		dev_err(&pdev->dev, "failed to get the \"%s\" clock.\n",
+			tx_clk_name);
 		return PTR_ERR(host->spdif_clk);
 	}
 
-- 
2.47.3
^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [PATCH 05/11] clk: sunxi-ng: sun55i-a523-r-ccu: Mark bus-r-dma as critical
  2025-10-20 17:10 [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX Chen-Yu Tsai
                   ` (3 preceding siblings ...)
  2025-10-20 17:10 ` [PATCH 04/11] ASoC: sun4i-spdif: Support SPDIF output on A523 family Chen-Yu Tsai
@ 2025-10-20 17:10 ` Chen-Yu Tsai
  2025-10-20 17:51   ` Jernej Škrabec
  2025-10-20 17:10 ` [PATCH 06/11] clk: sunxi-ng: sun55i-a523-ccu: Lower audio0 pll minimum rate Chen-Yu Tsai
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 28+ messages in thread
From: Chen-Yu Tsai @ 2025-10-20 17:10 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul
  Cc: linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
The "bus-r-dma" clock in the A523's PRCM clock controller is also
referred to as "DMA_CLKEN_SW" or "DMA ADB400 gating". It is unclear how
this ties into the DMA controller MBUS clock gate; however if the clock
is not enabled, the DMA controller in the MCU block will fail to access
DRAM, even failing to retrieve the DMA descriptors.
Mark this clock as critical. This sort of mirrors what is done for the
main DMA controller's MBUS clock, which has a separate toggle that is
currently left out of the main clock controller driver.
Fixes: 8cea339cfb81 ("clk: sunxi-ng: add support for the A523/T527 PRCM CCU")
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
 drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c b/drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c
index 70ce0ca0cb7d..fdcdcccd0939 100644
--- a/drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c
+++ b/drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c
@@ -121,7 +121,7 @@ static SUNXI_CCU_GATE_HW(bus_r_ir_rx_clk, "bus-r-ir-rx",
 			 &r_apb0_clk.common.hw, 0x1cc, BIT(0), 0);
 
 static SUNXI_CCU_GATE_HW(bus_r_dma_clk, "bus-r-dma",
-			 &r_apb0_clk.common.hw, 0x1dc, BIT(0), 0);
+			 &r_apb0_clk.common.hw, 0x1dc, BIT(0), CLK_IS_CRITICAL);
 static SUNXI_CCU_GATE_HW(bus_r_rtc_clk, "bus-r-rtc",
 			 &r_apb0_clk.common.hw, 0x20c, BIT(0), 0);
 static SUNXI_CCU_GATE_HW(bus_r_cpucfg_clk, "bus-r-cpucfg",
-- 
2.47.3
^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [PATCH 06/11] clk: sunxi-ng: sun55i-a523-ccu: Lower audio0 pll minimum rate
  2025-10-20 17:10 [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX Chen-Yu Tsai
                   ` (4 preceding siblings ...)
  2025-10-20 17:10 ` [PATCH 05/11] clk: sunxi-ng: sun55i-a523-r-ccu: Mark bus-r-dma as critical Chen-Yu Tsai
@ 2025-10-20 17:10 ` Chen-Yu Tsai
  2025-10-20 17:52   ` Jernej Škrabec
  2025-10-20 17:10 ` [PATCH 07/11] arm64: dts: allwinner: a523: Add DMA controller device nodes Chen-Yu Tsai
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 28+ messages in thread
From: Chen-Yu Tsai @ 2025-10-20 17:10 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul
  Cc: linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
While the user manual states that the PLL's rate should be between 180
MHz and 3 GHz in the register defninition section, it also says the
actual operating frequency is 22.5792*4 MHz in the PLL features table.
22.5792*4 MHz is one of the actual clock rates that we want and is
is available in the SDM table. Lower the minimum clock rate to 90 MHz
so that both rates in the SDM table can be used.
Fixes: 7cae1e2b5544 ("clk: sunxi-ng: Add support for the A523/T527 CCU PLLs")
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
 drivers/clk/sunxi-ng/ccu-sun55i-a523.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/sunxi-ng/ccu-sun55i-a523.c b/drivers/clk/sunxi-ng/ccu-sun55i-a523.c
index acb532f8361b..20dad06b37ca 100644
--- a/drivers/clk/sunxi-ng/ccu-sun55i-a523.c
+++ b/drivers/clk/sunxi-ng/ccu-sun55i-a523.c
@@ -300,7 +300,7 @@ static struct ccu_nm pll_audio0_4x_clk = {
 	.m		= _SUNXI_CCU_DIV(16, 6),
 	.sdm		= _SUNXI_CCU_SDM(pll_audio0_sdm_table, BIT(24),
 					 0x178, BIT(31)),
-	.min_rate	= 180000000U,
+	.min_rate	= 90000000U,
 	.max_rate	= 3000000000U,
 	.common		= {
 		.reg		= 0x078,
-- 
2.47.3
^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [PATCH 07/11] arm64: dts: allwinner: a523: Add DMA controller device nodes
  2025-10-20 17:10 [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX Chen-Yu Tsai
                   ` (5 preceding siblings ...)
  2025-10-20 17:10 ` [PATCH 06/11] clk: sunxi-ng: sun55i-a523-ccu: Lower audio0 pll minimum rate Chen-Yu Tsai
@ 2025-10-20 17:10 ` Chen-Yu Tsai
  2025-10-20 17:57   ` Jernej Škrabec
  2025-10-20 17:10 ` [PATCH 08/11] arm64: dts: allwinner: a523: Add device node for SPDIF block Chen-Yu Tsai
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 28+ messages in thread
From: Chen-Yu Tsai @ 2025-10-20 17:10 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul
  Cc: Chen-Yu Tsai, linux-sunxi, linux-sound, linux-clk,
	linux-arm-kernel, devicetree, dmaengine, linux-kernel
From: Chen-Yu Tsai <wens@csie.org>
The A523 has two DMA controllers. Add device nodes for both. Also hook
up DMA for existing devices.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 .../arm64/boot/dts/allwinner/sun55i-a523.dtsi | 56 +++++++++++++++++++
 1 file changed, 56 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
index a9e051a8bea3..8edbd3873199 100644
--- a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
@@ -241,6 +241,8 @@ uart0: serial@2500000 {
 			reg-io-width = <4>;
 			clocks = <&ccu CLK_BUS_UART0>;
 			resets = <&ccu RST_BUS_UART0>;
+			dmas = <&dma 14>, <&dma 14>;
+			dma-names = "tx", "rx";
 			status = "disabled";
 		};
 
@@ -252,6 +254,8 @@ uart1: serial@2500400 {
 			reg-io-width = <4>;
 			clocks = <&ccu CLK_BUS_UART1>;
 			resets = <&ccu RST_BUS_UART1>;
+			dmas = <&dma 15>, <&dma 15>;
+			dma-names = "tx", "rx";
 			status = "disabled";
 		};
 
@@ -263,6 +267,8 @@ uart2: serial@2500800 {
 			reg-io-width = <4>;
 			clocks = <&ccu CLK_BUS_UART2>;
 			resets = <&ccu RST_BUS_UART2>;
+			dmas = <&dma 16>, <&dma 16>;
+			dma-names = "tx", "rx";
 			status = "disabled";
 		};
 
@@ -274,6 +280,8 @@ uart3: serial@2500c00 {
 			reg-io-width = <4>;
 			clocks = <&ccu CLK_BUS_UART3>;
 			resets = <&ccu RST_BUS_UART3>;
+			dmas = <&dma 17>, <&dma 17>;
+			dma-names = "tx", "rx";
 			status = "disabled";
 		};
 
@@ -285,6 +293,8 @@ uart4: serial@2501000 {
 			reg-io-width = <4>;
 			clocks = <&ccu CLK_BUS_UART4>;
 			resets = <&ccu RST_BUS_UART4>;
+			dmas = <&dma 18>, <&dma 18>;
+			dma-names = "tx", "rx";
 			status = "disabled";
 		};
 
@@ -296,6 +306,8 @@ uart5: serial@2501400 {
 			reg-io-width = <4>;
 			clocks = <&ccu CLK_BUS_UART5>;
 			resets = <&ccu RST_BUS_UART5>;
+			dmas = <&dma 19>, <&dma 19>;
+			dma-names = "tx", "rx";
 			status = "disabled";
 		};
 
@@ -307,6 +319,8 @@ uart6: serial@2501800 {
 			reg-io-width = <4>;
 			clocks = <&ccu CLK_BUS_UART6>;
 			resets = <&ccu RST_BUS_UART6>;
+			dmas = <&dma 20>, <&dma 20>;
+			dma-names = "tx", "rx";
 			status = "disabled";
 		};
 
@@ -318,6 +332,8 @@ uart7: serial@2501c00 {
 			reg-io-width = <4>;
 			clocks = <&ccu CLK_BUS_UART7>;
 			resets = <&ccu RST_BUS_UART7>;
+			dmas = <&dma 21>, <&dma 21>;
+			dma-names = "tx", "rx";
 			status = "disabled";
 		};
 
@@ -329,6 +345,8 @@ i2c0: i2c@2502000 {
 			interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ccu CLK_BUS_I2C0>;
 			resets = <&ccu RST_BUS_I2C0>;
+			dmas = <&dma 43>, <&dma 43>;
+			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -342,6 +360,8 @@ i2c1: i2c@2502400 {
 			interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ccu CLK_BUS_I2C1>;
 			resets = <&ccu RST_BUS_I2C1>;
+			dmas = <&dma 44>, <&dma 44>;
+			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -355,6 +375,8 @@ i2c2: i2c@2502800 {
 			interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ccu CLK_BUS_I2C2>;
 			resets = <&ccu RST_BUS_I2C2>;
+			dmas = <&dma 45>, <&dma 45>;
+			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -368,6 +390,8 @@ i2c3: i2c@2502c00 {
 			interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ccu CLK_BUS_I2C3>;
 			resets = <&ccu RST_BUS_I2C3>;
+			dmas = <&dma 46>, <&dma 46>;
+			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -381,6 +405,8 @@ i2c4: i2c@2503000 {
 			interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ccu CLK_BUS_I2C4>;
 			resets = <&ccu RST_BUS_I2C4>;
+			dmas = <&dma 47>, <&dma 47>;
+			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -394,6 +420,8 @@ i2c5: i2c@2503400 {
 			interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&ccu CLK_BUS_I2C5>;
 			resets = <&ccu RST_BUS_I2C5>;
+			dmas = <&dma 48>, <&dma 48>;
+			dma-names = "rx", "tx";
 			status = "disabled";
 			#address-cells = <1>;
 			#size-cells = <0>;
@@ -408,6 +436,19 @@ syscon: syscon@3000000 {
 			ranges;
 		};
 
+		dma: dma-controller@3002000 {
+			compatible = "allwinner,sun55i-a523-dma",
+				     "allwinner,sun50i-a100-dma";
+			reg = <0x03002000 0x1000>;
+			interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_DMA>, <&ccu CLK_MBUS_DMA>;
+			clock-names = "bus", "mbus";
+			dma-channels = <16>;
+			dma-requests = <54>;
+			resets = <&ccu RST_BUS_DMA>;
+			#dma-cells = <1>;
+		};
+
 		sid: efuse@3006000 {
 			compatible = "allwinner,sun55i-a523-sid",
 				     "allwinner,sun50i-a64-sid";
@@ -729,6 +770,8 @@ r_i2c0: i2c@7081400 {
 			reg = <0x07081400 0x400>;
 			interrupts = <GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&r_ccu CLK_BUS_R_I2C0>;
+			dmas = <&dma 49>, <&dma 49>;
+			dma-names = "rx", "tx";
 			resets = <&r_ccu RST_BUS_R_I2C0>;
 			pinctrl-names = "default";
 			pinctrl-0 = <&r_i2c_pins>;
@@ -775,6 +818,19 @@ mcu_ccu: clock-controller@7102000 {
 			#reset-cells = <1>;
 		};
 
+		mcu_dma: dma-controller@7121000 {
+			compatible = "allwinner,sun55i-a523-mcu-dma",
+				     "allwinner,sun50i-a100-dma";
+			reg = <0x07121000 0x1000>;
+			interrupts = <GIC_SPI 197 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&mcu_ccu CLK_BUS_MCU_DMA>, <&mcu_ccu CLK_MCU_MBUS_DMA>;
+			clock-names = "bus", "mbus";
+			dma-channels = <16>;
+			dma-requests = <15>;
+			resets = <&mcu_ccu RST_BUS_MCU_DMA>;
+			#dma-cells = <1>;
+		};
+
 		npu: npu@7122000 {
 			compatible = "vivante,gc";
 			reg = <0x07122000 0x1000>;
-- 
2.47.3
^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [PATCH 08/11] arm64: dts: allwinner: a523: Add device node for SPDIF block
  2025-10-20 17:10 [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX Chen-Yu Tsai
                   ` (6 preceding siblings ...)
  2025-10-20 17:10 ` [PATCH 07/11] arm64: dts: allwinner: a523: Add DMA controller device nodes Chen-Yu Tsai
@ 2025-10-20 17:10 ` Chen-Yu Tsai
  2025-10-20 17:58   ` Jernej Škrabec
  2025-10-20 17:10 ` [PATCH 09/11] arm64: dts: allwinner: a523: Add device nodes for I2S controllers Chen-Yu Tsai
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 28+ messages in thread
From: Chen-Yu Tsai @ 2025-10-20 17:10 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul
  Cc: linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
The A523 has a SPDIF interface that is capable of both playback and
capture.
Add a node for it.
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
 arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
index 8edbd3873199..33f991dbd00b 100644
--- a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
@@ -818,6 +818,21 @@ mcu_ccu: clock-controller@7102000 {
 			#reset-cells = <1>;
 		};
 
+		spdif: spdif@7116000 {
+			compatible = "allwinner,sun55i-a523-spdif";
+			reg = <0x07116000 0x400>;
+			interrupts = <GIC_SPI 196 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&mcu_ccu CLK_BUS_MCU_SPDIF>,
+				 <&mcu_ccu CLK_MCU_SPDIF_TX>,
+				 <&mcu_ccu CLK_MCU_SPDIF_RX>;
+			clock-names = "apb", "tx", "rx";
+			resets = <&mcu_ccu RST_BUS_MCU_SPDIF>;
+			dmas = <&mcu_dma 2>, <&mcu_dma 2>;
+			dma-names = "rx", "tx";
+			#sound-dai-cells = <0>;
+			status = "disabled";
+		};
+
 		mcu_dma: dma-controller@7121000 {
 			compatible = "allwinner,sun55i-a523-mcu-dma",
 				     "allwinner,sun50i-a100-dma";
-- 
2.47.3
^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [PATCH 09/11] arm64: dts: allwinner: a523: Add device nodes for I2S controllers
  2025-10-20 17:10 [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX Chen-Yu Tsai
                   ` (7 preceding siblings ...)
  2025-10-20 17:10 ` [PATCH 08/11] arm64: dts: allwinner: a523: Add device node for SPDIF block Chen-Yu Tsai
@ 2025-10-20 17:10 ` Chen-Yu Tsai
  2025-10-20 17:59   ` Jernej Škrabec
  2025-10-20 17:10 ` [PATCH 10/11] arm64: dts: allwinner: a523: Add I2S2 pins on PI pin group Chen-Yu Tsai
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 28+ messages in thread
From: Chen-Yu Tsai @ 2025-10-20 17:10 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul
  Cc: linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
The A523 family of SoCs have four I2S controllers capable of both
playback and capture. The user manual also implies that I2S2 also
outputs to the eDP interface controller.
Add device nodes for all of them.
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
 .../arm64/boot/dts/allwinner/sun55i-a523.dtsi | 56 +++++++++++++++++++
 1 file changed, 56 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
index 33f991dbd00b..eea9ce83783c 100644
--- a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
@@ -818,6 +818,62 @@ mcu_ccu: clock-controller@7102000 {
 			#reset-cells = <1>;
 		};
 
+		i2s0: i2s@7112000 {
+			compatible = "allwinner,sun55i-a523-i2s",
+				     "allwinner,sun50i-r329-i2s";
+			reg = <0x07112000 0x1000>;
+			interrupts = <GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&mcu_ccu CLK_BUS_MCU_I2S0>, <&mcu_ccu CLK_MCU_I2S0>;
+			clock-names = "apb", "mod";
+			resets = <&mcu_ccu RST_BUS_MCU_I2S0>;
+			dmas = <&mcu_dma 3>, <&mcu_dma 3>;
+			dma-names = "rx", "tx";
+			#sound-dai-cells = <0>;
+			status = "disabled";
+		};
+
+		i2s1: i2s@7113000 {
+			compatible = "allwinner,sun55i-a523-i2s",
+				     "allwinner,sun50i-r329-i2s";
+			reg = <0x07113000 0x1000>;
+			interrupts = <GIC_SPI 193 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&mcu_ccu CLK_BUS_MCU_I2S1>, <&mcu_ccu CLK_MCU_I2S1>;
+			clock-names = "apb", "mod";
+			resets = <&mcu_ccu RST_BUS_MCU_I2S1>;
+			dmas = <&mcu_dma 4>, <&mcu_dma 4>;
+			dma-names = "rx", "tx";
+			#sound-dai-cells = <0>;
+			status = "disabled";
+		};
+
+		i2s2: i2s@7114000 {
+			compatible = "allwinner,sun55i-a523-i2s",
+				     "allwinner,sun50i-r329-i2s";
+			reg = <0x07114000 0x1000>;
+			interrupts = <GIC_SPI 194 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&mcu_ccu CLK_BUS_MCU_I2S2>, <&mcu_ccu CLK_MCU_I2S2>;
+			clock-names = "apb", "mod";
+			resets = <&mcu_ccu RST_BUS_MCU_I2S2>;
+			dmas = <&mcu_dma 5>, <&mcu_dma 5>;
+			dma-names = "rx", "tx";
+			#sound-dai-cells = <0>;
+			status = "disabled";
+		};
+
+		i2s3: i2s@7115000 {
+			compatible = "allwinner,sun55i-a523-i2s",
+				     "allwinner,sun50i-r329-i2s";
+			reg = <0x07115000 0x1000>;
+			interrupts = <GIC_SPI 195 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&mcu_ccu CLK_BUS_MCU_I2S3>, <&mcu_ccu CLK_MCU_I2S3>;
+			clock-names = "apb", "mod";
+			resets = <&mcu_ccu RST_BUS_MCU_I2S3>;
+			dmas = <&mcu_dma 6>, <&mcu_dma 6>;
+			dma-names = "rx", "tx";
+			#sound-dai-cells = <0>;
+			status = "disabled";
+		};
+
 		spdif: spdif@7116000 {
 			compatible = "allwinner,sun55i-a523-spdif";
 			reg = <0x07116000 0x400>;
-- 
2.47.3
^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [PATCH 10/11] arm64: dts: allwinner: a523: Add I2S2 pins on PI pin group
  2025-10-20 17:10 [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX Chen-Yu Tsai
                   ` (8 preceding siblings ...)
  2025-10-20 17:10 ` [PATCH 09/11] arm64: dts: allwinner: a523: Add device nodes for I2S controllers Chen-Yu Tsai
@ 2025-10-20 17:10 ` Chen-Yu Tsai
  2025-10-20 18:00   ` Jernej Škrabec
  2025-10-20 17:10 ` [PATCH 11/11] [EXAMPLE] arm64: dts: allwinner: a527-cubie-a5e: Enable I2S and SPDIF output Chen-Yu Tsai
  2025-10-22 19:07 ` (subset) [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX Chen-Yu Tsai
  11 siblings, 1 reply; 28+ messages in thread
From: Chen-Yu Tsai @ 2025-10-20 17:10 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul
  Cc: linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
The Radxa Cubie A5E exposes I2S2 through the PI pin group on the 40-pin
GPIO header.
Add a pinmux setting for it so potential users can directly reference
it.
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
 arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
index eea9ce83783c..cebd8e16e845 100644
--- a/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi
@@ -145,6 +145,14 @@ pio: pinctrl@2000000 {
 			interrupt-controller;
 			#interrupt-cells = <3>;
 
+			/omit-if-no-ref/
+			i2s2_pi_pins: i2s2-pi-pins {
+				pins = "PI2", "PI3", "PI4", "PI5";
+				allwinner,pinmux = <5>;
+				function = "i2s2";
+				bias-disable;
+			};
+
 			mmc0_pins: mmc0-pins {
 				pins = "PF0" ,"PF1", "PF2", "PF3", "PF4", "PF5";
 				allwinner,pinmux = <2>;
-- 
2.47.3
^ permalink raw reply related	[flat|nested] 28+ messages in thread
* [PATCH 11/11] [EXAMPLE] arm64: dts: allwinner: a527-cubie-a5e: Enable I2S and SPDIF output
  2025-10-20 17:10 [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX Chen-Yu Tsai
                   ` (9 preceding siblings ...)
  2025-10-20 17:10 ` [PATCH 10/11] arm64: dts: allwinner: a523: Add I2S2 pins on PI pin group Chen-Yu Tsai
@ 2025-10-20 17:10 ` Chen-Yu Tsai
  2025-10-21 21:14   ` kernel test robot
  2025-10-22 19:07 ` (subset) [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX Chen-Yu Tsai
  11 siblings, 1 reply; 28+ messages in thread
From: Chen-Yu Tsai @ 2025-10-20 17:10 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul
  Cc: linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
This is an example change.
The Radxa Cubie A5E exposes I2S2 and SPDIF on the 40-pin header. Enable
both.
In this example, I2S2 is connected to adafruit speaker bonnet, which
sports a pair of MAX98357A for speaker amplication. SPDIF is connected
to a SPDIF interface card for PCs, which has both coaxial and optical
outputs. The output was connected via optical cable to a dumb SPDIF to
analog audio converter.
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
---
 .../dts/allwinner/sun55i-a527-cubie-a5e.dts   | 52 +++++++++++++++++++
 1 file changed, 52 insertions(+)
diff --git a/arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts b/arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts
index bfdf1728cd14..828d101d28e8 100644
--- a/arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts
+++ b/arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts
@@ -64,6 +64,46 @@ reg_usb_vbus: vbus {
 		gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>;	/* PL8 */
 		enable-active-high;
 	};
+
+	codec: audio-codec {
+		compatible = "maxim,max98360a";
+		#sound-dai-cells = <0>;
+	};
+
+	sound-i2s {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "I2S";
+		simple-audio-card,format = "left_j";
+		simple-audio-card,bitclock-master = <&dailink_cpu>;
+		simple-audio-card,frame-master = <&dailink_cpu>;
+		simple-audio-card,mclk-fs = <128>;
+
+		dailink_cpu: simple-audio-card,cpu {
+			sound-dai = <&i2s2>;
+		};
+
+		dailink0_master: simple-audio-card,codec {
+			sound-dai = <&codec>;
+		};
+	};
+
+	sound-spdif {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "spdif-out";
+
+		simple-audio-card,cpu {
+			sound-dai = <&spdif>;
+		};
+
+		simple-audio-card,codec {
+			sound-dai = <&spdif_out>;
+		};
+	};
+
+	spdif_out: spdif-out {
+		#sound-dai-cells = <0>;
+		compatible = "linux,spdif-dit";
+	};
 };
 
 &ehci0 {
@@ -101,6 +141,12 @@ &gpu {
 	status = "okay";
 };
 
+&i2s2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2s2_pi_pins>;
+	status = "okay";
+};
+
 &mdio0 {
 	ext_rgmii0_phy: ethernet-phy@1 {
 		compatible = "ethernet-phy-ieee802.3-c22";
@@ -344,6 +390,12 @@ &r_pio {
 	vcc-pm-supply = <®_aldo3>;
 };
 
+&spdif {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spdif_out_pi_pin>;
+	status = "okay";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pb_pins>;
-- 
2.47.3
^ permalink raw reply related	[flat|nested] 28+ messages in thread
* Re: [PATCH 01/11] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatibles for A523
  2025-10-20 17:10 ` [PATCH 01/11] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatibles for A523 Chen-Yu Tsai
@ 2025-10-20 17:37   ` Conor Dooley
  0 siblings, 0 replies; 28+ messages in thread
From: Conor Dooley @ 2025-10-20 17:37 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Jernej Skrabec, Samuel Holland, Mark Brown, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	Chen-Yu Tsai, linux-sunxi, linux-sound, linux-clk,
	linux-arm-kernel, devicetree, dmaengine, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: [PATCH 03/11] ASoC: dt-bindings: allwinner,sun4i-a10-spdif: Add compatible for A523
  2025-10-20 17:10 ` [PATCH 03/11] ASoC: dt-bindings: allwinner,sun4i-a10-spdif: " Chen-Yu Tsai
@ 2025-10-20 17:38   ` Conor Dooley
  0 siblings, 0 replies; 28+ messages in thread
From: Conor Dooley @ 2025-10-20 17:38 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Jernej Skrabec, Samuel Holland, Mark Brown, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: [PATCH 02/11] ASoC: dt-bindings: allwinner,sun4i-a10-i2s: Add compatible for A523
  2025-10-20 17:10 ` [PATCH 02/11] ASoC: dt-bindings: allwinner,sun4i-a10-i2s: Add compatible " Chen-Yu Tsai
@ 2025-10-20 17:38   ` Conor Dooley
  0 siblings, 0 replies; 28+ messages in thread
From: Conor Dooley @ 2025-10-20 17:38 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Jernej Skrabec, Samuel Holland, Mark Brown, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: [PATCH 04/11] ASoC: sun4i-spdif: Support SPDIF output on A523 family
  2025-10-20 17:10 ` [PATCH 04/11] ASoC: sun4i-spdif: Support SPDIF output on A523 family Chen-Yu Tsai
@ 2025-10-20 17:49   ` Jernej Škrabec
  2025-10-21  3:50     ` Chen-Yu Tsai
  2025-10-21 12:55   ` kernel test robot
  1 sibling, 1 reply; 28+ messages in thread
From: Jernej Škrabec @ 2025-10-20 17:49 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul, Chen-Yu Tsai
  Cc: linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
Hi,
Dne ponedeljek, 20. oktober 2025 ob 19:10:50 Srednjeevropski poletni čas je Chen-Yu Tsai napisal(a):
> The TX side of the SPDIF block on the A523 is almost the same the
> previous generations, the only difference being that it has separate
> module clock inputs for the TX and RX side.
> 
> Since this driver currently only supports TX, add support for a
> different clock name so that TX and RX clocks can be separated
> if RX support is ever added. Then add support for the A523.
> 
> Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
> ---
>  sound/soc/sunxi/sun4i-spdif.c | 28 +++++++++++++++++++++++++---
>  1 file changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c
> index 34e5bd94e9af..6a58dc4311de 100644
> --- a/sound/soc/sunxi/sun4i-spdif.c
> +++ b/sound/soc/sunxi/sun4i-spdif.c
> @@ -177,6 +177,7 @@ struct sun4i_spdif_quirks {
>  	bool has_reset;
>  	unsigned int val_fctl_ftx;
>  	unsigned int mclk_multiplier;
> +	const char *tx_clk_name;
>  };
>  
>  struct sun4i_spdif_dev {
> @@ -323,6 +324,7 @@ static int sun4i_spdif_hw_params(struct snd_pcm_substream *substream,
>  	}
>  	mclk *= host->quirks->mclk_multiplier;
>  
> +	dev_info(&pdev->dev, "Setting SPDIF clock rate to %u\n", mclk);
>  	ret = clk_set_rate(host->spdif_clk, mclk);
>  	if (ret < 0) {
>  		dev_err(&pdev->dev,
> @@ -542,7 +544,6 @@ static struct snd_soc_dai_driver sun4i_spdif_dai = {
>  		.formats = SUN4I_FORMATS,
>  	},
>  	.ops = &sun4i_spdif_dai_ops,
> -	.name = "spdif",
Why this change?
>  };
>  
>  static const struct sun4i_spdif_quirks sun4i_a10_spdif_quirks = {
> @@ -572,6 +573,14 @@ static const struct sun4i_spdif_quirks sun50i_h6_spdif_quirks = {
>  	.mclk_multiplier = 1,
>  };
>  
> +static const struct sun4i_spdif_quirks sun55i_a523_spdif_quirks = {
> +	.reg_dac_txdata = SUN8I_SPDIF_TXFIFO,
> +	.val_fctl_ftx   = SUN50I_H6_SPDIF_FCTL_FTX,
> +	.has_reset      = true,
> +	.mclk_multiplier = 1,
> +	.tx_clk_name	= "tx",
> +};
> +
>  static const struct of_device_id sun4i_spdif_of_match[] = {
>  	{
>  		.compatible = "allwinner,sun4i-a10-spdif",
> @@ -594,6 +603,15 @@ static const struct of_device_id sun4i_spdif_of_match[] = {
>  		/* Essentially the same as the H6, but without RX */
>  		.data = &sun50i_h6_spdif_quirks,
>  	},
> +	{
> +		.compatible = "allwinner,sun55i-a523-spdif",
> +		/*
> +		 * Almost the same as H6, but has split the TX and RX clocks,
> +		 * has a separate reset bit for the RX side, and has some
> +		 * expanded features for the RX side.
> +		 */
> +		.data = &sun55i_a523_spdif_quirks,
> +	},
>  	{ /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, sun4i_spdif_of_match);
> @@ -635,6 +653,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
>  	const struct sun4i_spdif_quirks *quirks;
>  	int ret;
>  	void __iomem *base;
> +	const char *tx_clk_name = "spdif";
Reverse tree?
Otherwise it looks good.
Best regards,
Jernej
>  
>  	dev_dbg(&pdev->dev, "Entered %s\n", __func__);
>  
> @@ -671,9 +690,12 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
>  		return PTR_ERR(host->apb_clk);
>  	}
>  
> -	host->spdif_clk = devm_clk_get(&pdev->dev, "spdif");
> +	if (quirks->tx_clk_name)
> +		tx_clk_name = quirks->tx_clk_name;
> +	host->spdif_clk = devm_clk_get(&pdev->dev, tx_clk_name);
>  	if (IS_ERR(host->spdif_clk)) {
> -		dev_err(&pdev->dev, "failed to get a spdif clock.\n");
> +		dev_err(&pdev->dev, "failed to get the \"%s\" clock.\n",
> +			tx_clk_name);
>  		return PTR_ERR(host->spdif_clk);
>  	}
>  
> 
^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: [PATCH 05/11] clk: sunxi-ng: sun55i-a523-r-ccu: Mark bus-r-dma as critical
  2025-10-20 17:10 ` [PATCH 05/11] clk: sunxi-ng: sun55i-a523-r-ccu: Mark bus-r-dma as critical Chen-Yu Tsai
@ 2025-10-20 17:51   ` Jernej Škrabec
  0 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2025-10-20 17:51 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul, Chen-Yu Tsai
  Cc: linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
Dne ponedeljek, 20. oktober 2025 ob 19:10:51 Srednjeevropski poletni čas je Chen-Yu Tsai napisal(a):
> The "bus-r-dma" clock in the A523's PRCM clock controller is also
> referred to as "DMA_CLKEN_SW" or "DMA ADB400 gating". It is unclear how
> this ties into the DMA controller MBUS clock gate; however if the clock
> is not enabled, the DMA controller in the MCU block will fail to access
> DRAM, even failing to retrieve the DMA descriptors.
> 
> Mark this clock as critical. This sort of mirrors what is done for the
> main DMA controller's MBUS clock, which has a separate toggle that is
> currently left out of the main clock controller driver.
> 
> Fixes: 8cea339cfb81 ("clk: sunxi-ng: add support for the A523/T527 PRCM CCU")
> Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> ---
>  drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c b/drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c
> index 70ce0ca0cb7d..fdcdcccd0939 100644
> --- a/drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c
> +++ b/drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c
> @@ -121,7 +121,7 @@ static SUNXI_CCU_GATE_HW(bus_r_ir_rx_clk, "bus-r-ir-rx",
>  			 &r_apb0_clk.common.hw, 0x1cc, BIT(0), 0);
>  
>  static SUNXI_CCU_GATE_HW(bus_r_dma_clk, "bus-r-dma",
> -			 &r_apb0_clk.common.hw, 0x1dc, BIT(0), 0);
> +			 &r_apb0_clk.common.hw, 0x1dc, BIT(0), CLK_IS_CRITICAL);
>  static SUNXI_CCU_GATE_HW(bus_r_rtc_clk, "bus-r-rtc",
>  			 &r_apb0_clk.common.hw, 0x20c, BIT(0), 0);
>  static SUNXI_CCU_GATE_HW(bus_r_cpucfg_clk, "bus-r-cpucfg",
> 
^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: [PATCH 06/11] clk: sunxi-ng: sun55i-a523-ccu: Lower audio0 pll minimum rate
  2025-10-20 17:10 ` [PATCH 06/11] clk: sunxi-ng: sun55i-a523-ccu: Lower audio0 pll minimum rate Chen-Yu Tsai
@ 2025-10-20 17:52   ` Jernej Škrabec
  2025-10-20 18:09     ` Chen-Yu Tsai
  0 siblings, 1 reply; 28+ messages in thread
From: Jernej Škrabec @ 2025-10-20 17:52 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul, Chen-Yu Tsai
  Cc: linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
Dne ponedeljek, 20. oktober 2025 ob 19:10:52 Srednjeevropski poletni čas je Chen-Yu Tsai napisal(a):
> While the user manual states that the PLL's rate should be between 180
> MHz and 3 GHz in the register defninition section, it also says the
> actual operating frequency is 22.5792*4 MHz in the PLL features table.
> 
> 22.5792*4 MHz is one of the actual clock rates that we want and is
> is available in the SDM table. Lower the minimum clock rate to 90 MHz
> so that both rates in the SDM table can be used.
So factor of 2 could be missed somewhere?
> 
> Fixes: 7cae1e2b5544 ("clk: sunxi-ng: Add support for the A523/T527 CCU PLLs")
> Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> ---
>  drivers/clk/sunxi-ng/ccu-sun55i-a523.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/sunxi-ng/ccu-sun55i-a523.c b/drivers/clk/sunxi-ng/ccu-sun55i-a523.c
> index acb532f8361b..20dad06b37ca 100644
> --- a/drivers/clk/sunxi-ng/ccu-sun55i-a523.c
> +++ b/drivers/clk/sunxi-ng/ccu-sun55i-a523.c
> @@ -300,7 +300,7 @@ static struct ccu_nm pll_audio0_4x_clk = {
>  	.m		= _SUNXI_CCU_DIV(16, 6),
>  	.sdm		= _SUNXI_CCU_SDM(pll_audio0_sdm_table, BIT(24),
>  					 0x178, BIT(31)),
> -	.min_rate	= 180000000U,
> +	.min_rate	= 90000000U,
>  	.max_rate	= 3000000000U,
>  	.common		= {
>  		.reg		= 0x078,
> 
^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: [PATCH 07/11] arm64: dts: allwinner: a523: Add DMA controller device nodes
  2025-10-20 17:10 ` [PATCH 07/11] arm64: dts: allwinner: a523: Add DMA controller device nodes Chen-Yu Tsai
@ 2025-10-20 17:57   ` Jernej Škrabec
  0 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2025-10-20 17:57 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul, Chen-Yu Tsai
  Cc: Chen-Yu Tsai, linux-sunxi, linux-sound, linux-clk,
	linux-arm-kernel, devicetree, dmaengine, linux-kernel
Dne ponedeljek, 20. oktober 2025 ob 19:10:53 Srednjeevropski poletni čas je Chen-Yu Tsai napisal(a):
> From: Chen-Yu Tsai <wens@csie.org>
> 
> The A523 has two DMA controllers. Add device nodes for both. Also hook
> up DMA for existing devices.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: [PATCH 08/11] arm64: dts: allwinner: a523: Add device node for SPDIF block
  2025-10-20 17:10 ` [PATCH 08/11] arm64: dts: allwinner: a523: Add device node for SPDIF block Chen-Yu Tsai
@ 2025-10-20 17:58   ` Jernej Škrabec
  0 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2025-10-20 17:58 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul, Chen-Yu Tsai
  Cc: linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
Dne ponedeljek, 20. oktober 2025 ob 19:10:54 Srednjeevropski poletni čas je Chen-Yu Tsai napisal(a):
> The A523 has a SPDIF interface that is capable of both playback and
> capture.
> 
> Add a node for it.
> 
> Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: [PATCH 09/11] arm64: dts: allwinner: a523: Add device nodes for I2S controllers
  2025-10-20 17:10 ` [PATCH 09/11] arm64: dts: allwinner: a523: Add device nodes for I2S controllers Chen-Yu Tsai
@ 2025-10-20 17:59   ` Jernej Škrabec
  0 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2025-10-20 17:59 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul, Chen-Yu Tsai
  Cc: linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
Dne ponedeljek, 20. oktober 2025 ob 19:10:55 Srednjeevropski poletni čas je Chen-Yu Tsai napisal(a):
> The A523 family of SoCs have four I2S controllers capable of both
> playback and capture. The user manual also implies that I2S2 also
> outputs to the eDP interface controller.
> 
> Add device nodes for all of them.
> 
> Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: [PATCH 10/11] arm64: dts: allwinner: a523: Add I2S2 pins on PI pin group
  2025-10-20 17:10 ` [PATCH 10/11] arm64: dts: allwinner: a523: Add I2S2 pins on PI pin group Chen-Yu Tsai
@ 2025-10-20 18:00   ` Jernej Škrabec
  0 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2025-10-20 18:00 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul, Chen-Yu Tsai
  Cc: linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
Dne ponedeljek, 20. oktober 2025 ob 19:10:56 Srednjeevropski poletni čas je Chen-Yu Tsai napisal(a):
> The Radxa Cubie A5E exposes I2S2 through the PI pin group on the 40-pin
> GPIO header.
> 
> Add a pinmux setting for it so potential users can directly reference
> it.
> 
> Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: [PATCH 06/11] clk: sunxi-ng: sun55i-a523-ccu: Lower audio0 pll minimum rate
  2025-10-20 17:52   ` Jernej Škrabec
@ 2025-10-20 18:09     ` Chen-Yu Tsai
  2025-10-20 18:22       ` Jernej Škrabec
  0 siblings, 1 reply; 28+ messages in thread
From: Chen-Yu Tsai @ 2025-10-20 18:09 UTC (permalink / raw)
  To: Jernej Škrabec
  Cc: Jernej Skrabec, Samuel Holland, Mark Brown, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
On Tue, Oct 21, 2025 at 1:52 AM Jernej Škrabec <jernej.skrabec@gmail.com> wrote:
>
> Dne ponedeljek, 20. oktober 2025 ob 19:10:52 Srednjeevropski poletni čas je Chen-Yu Tsai napisal(a):
> > While the user manual states that the PLL's rate should be between 180
> > MHz and 3 GHz in the register defninition section, it also says the
> > actual operating frequency is 22.5792*4 MHz in the PLL features table.
> >
> > 22.5792*4 MHz is one of the actual clock rates that we want and is
> > is available in the SDM table. Lower the minimum clock rate to 90 MHz
> > so that both rates in the SDM table can be used.
>
> So factor of 2 could be missed somewhere?
Not sure what you mean? This PLL only gives *4 and *1 outputs.
> >
> > Fixes: 7cae1e2b5544 ("clk: sunxi-ng: Add support for the A523/T527 CCU PLLs")
> > Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
>
> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
>
> Best regards,
> Jernej
>
> > ---
> >  drivers/clk/sunxi-ng/ccu-sun55i-a523.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/clk/sunxi-ng/ccu-sun55i-a523.c b/drivers/clk/sunxi-ng/ccu-sun55i-a523.c
> > index acb532f8361b..20dad06b37ca 100644
> > --- a/drivers/clk/sunxi-ng/ccu-sun55i-a523.c
> > +++ b/drivers/clk/sunxi-ng/ccu-sun55i-a523.c
> > @@ -300,7 +300,7 @@ static struct ccu_nm pll_audio0_4x_clk = {
> >       .m              = _SUNXI_CCU_DIV(16, 6),
> >       .sdm            = _SUNXI_CCU_SDM(pll_audio0_sdm_table, BIT(24),
> >                                        0x178, BIT(31)),
> > -     .min_rate       = 180000000U,
> > +     .min_rate       = 90000000U,
> >       .max_rate       = 3000000000U,
> >       .common         = {
> >               .reg            = 0x078,
> >
>
>
>
>
^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: [PATCH 06/11] clk: sunxi-ng: sun55i-a523-ccu: Lower audio0 pll minimum rate
  2025-10-20 18:09     ` Chen-Yu Tsai
@ 2025-10-20 18:22       ` Jernej Škrabec
  0 siblings, 0 replies; 28+ messages in thread
From: Jernej Škrabec @ 2025-10-20 18:22 UTC (permalink / raw)
  To: wens
  Cc: Jernej Skrabec, Samuel Holland, Mark Brown, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
Dne ponedeljek, 20. oktober 2025 ob 20:09:18 Srednjeevropski poletni čas je Chen-Yu Tsai napisal(a):
> On Tue, Oct 21, 2025 at 1:52 AM Jernej Škrabec <jernej.skrabec@gmail.com> wrote:
> >
> > Dne ponedeljek, 20. oktober 2025 ob 19:10:52 Srednjeevropski poletni čas je Chen-Yu Tsai napisal(a):
> > > While the user manual states that the PLL's rate should be between 180
> > > MHz and 3 GHz in the register defninition section, it also says the
> > > actual operating frequency is 22.5792*4 MHz in the PLL features table.
> > >
> > > 22.5792*4 MHz is one of the actual clock rates that we want and is
> > > is available in the SDM table. Lower the minimum clock rate to 90 MHz
> > > so that both rates in the SDM table can be used.
> >
> > So factor of 2 could be missed somewhere?
> 
> Not sure what you mean? This PLL only gives *4 and *1 outputs.
Right. Nevermind then.
Best regards,
Jernej
> 
> > >
> > > Fixes: 7cae1e2b5544 ("clk: sunxi-ng: Add support for the A523/T527 CCU PLLs")
> > > Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
> >
> > Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
> >
> > Best regards,
> > Jernej
> >
> > > ---
> > >  drivers/clk/sunxi-ng/ccu-sun55i-a523.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/clk/sunxi-ng/ccu-sun55i-a523.c b/drivers/clk/sunxi-ng/ccu-sun55i-a523.c
> > > index acb532f8361b..20dad06b37ca 100644
> > > --- a/drivers/clk/sunxi-ng/ccu-sun55i-a523.c
> > > +++ b/drivers/clk/sunxi-ng/ccu-sun55i-a523.c
> > > @@ -300,7 +300,7 @@ static struct ccu_nm pll_audio0_4x_clk = {
> > >       .m              = _SUNXI_CCU_DIV(16, 6),
> > >       .sdm            = _SUNXI_CCU_SDM(pll_audio0_sdm_table, BIT(24),
> > >                                        0x178, BIT(31)),
> > > -     .min_rate       = 180000000U,
> > > +     .min_rate       = 90000000U,
> > >       .max_rate       = 3000000000U,
> > >       .common         = {
> > >               .reg            = 0x078,
> > >
> >
> >
> >
> >
> 
^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: [PATCH 04/11] ASoC: sun4i-spdif: Support SPDIF output on A523 family
  2025-10-20 17:49   ` Jernej Škrabec
@ 2025-10-21  3:50     ` Chen-Yu Tsai
  0 siblings, 0 replies; 28+ messages in thread
From: Chen-Yu Tsai @ 2025-10-21  3:50 UTC (permalink / raw)
  To: Jernej Škrabec
  Cc: Jernej Skrabec, Samuel Holland, Mark Brown, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
On Tue, Oct 21, 2025 at 1:49 AM Jernej Škrabec <jernej.skrabec@gmail.com> wrote:
>
> Hi,
>
> Dne ponedeljek, 20. oktober 2025 ob 19:10:50 Srednjeevropski poletni čas je Chen-Yu Tsai napisal(a):
> > The TX side of the SPDIF block on the A523 is almost the same the
> > previous generations, the only difference being that it has separate
> > module clock inputs for the TX and RX side.
> >
> > Since this driver currently only supports TX, add support for a
> > different clock name so that TX and RX clocks can be separated
> > if RX support is ever added. Then add support for the A523.
> >
> > Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
> > ---
> >  sound/soc/sunxi/sun4i-spdif.c | 28 +++++++++++++++++++++++++---
> >  1 file changed, 25 insertions(+), 3 deletions(-)
> >
> > diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c
> > index 34e5bd94e9af..6a58dc4311de 100644
> > --- a/sound/soc/sunxi/sun4i-spdif.c
> > +++ b/sound/soc/sunxi/sun4i-spdif.c
> > @@ -177,6 +177,7 @@ struct sun4i_spdif_quirks {
> >       bool has_reset;
> >       unsigned int val_fctl_ftx;
> >       unsigned int mclk_multiplier;
> > +     const char *tx_clk_name;
> >  };
> >
> >  struct sun4i_spdif_dev {
> > @@ -323,6 +324,7 @@ static int sun4i_spdif_hw_params(struct snd_pcm_substream *substream,
> >       }
> >       mclk *= host->quirks->mclk_multiplier;
> >
> > +     dev_info(&pdev->dev, "Setting SPDIF clock rate to %u\n", mclk);
> >       ret = clk_set_rate(host->spdif_clk, mclk);
> >       if (ret < 0) {
> >               dev_err(&pdev->dev,
> > @@ -542,7 +544,6 @@ static struct snd_soc_dai_driver sun4i_spdif_dai = {
> >               .formats = SUN4I_FORMATS,
> >       },
> >       .ops = &sun4i_spdif_dai_ops,
> > -     .name = "spdif",
>
> Why this change?
Now that you mention it, this looks bogus to me as well. I'll drop it.
> >  };
> >
> >  static const struct sun4i_spdif_quirks sun4i_a10_spdif_quirks = {
> > @@ -572,6 +573,14 @@ static const struct sun4i_spdif_quirks sun50i_h6_spdif_quirks = {
> >       .mclk_multiplier = 1,
> >  };
> >
> > +static const struct sun4i_spdif_quirks sun55i_a523_spdif_quirks = {
> > +     .reg_dac_txdata = SUN8I_SPDIF_TXFIFO,
> > +     .val_fctl_ftx   = SUN50I_H6_SPDIF_FCTL_FTX,
> > +     .has_reset      = true,
> > +     .mclk_multiplier = 1,
> > +     .tx_clk_name    = "tx",
> > +};
> > +
> >  static const struct of_device_id sun4i_spdif_of_match[] = {
> >       {
> >               .compatible = "allwinner,sun4i-a10-spdif",
> > @@ -594,6 +603,15 @@ static const struct of_device_id sun4i_spdif_of_match[] = {
> >               /* Essentially the same as the H6, but without RX */
> >               .data = &sun50i_h6_spdif_quirks,
> >       },
> > +     {
> > +             .compatible = "allwinner,sun55i-a523-spdif",
> > +             /*
> > +              * Almost the same as H6, but has split the TX and RX clocks,
> > +              * has a separate reset bit for the RX side, and has some
> > +              * expanded features for the RX side.
> > +              */
> > +             .data = &sun55i_a523_spdif_quirks,
> > +     },
> >       { /* sentinel */ }
> >  };
> >  MODULE_DEVICE_TABLE(of, sun4i_spdif_of_match);
> > @@ -635,6 +653,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
> >       const struct sun4i_spdif_quirks *quirks;
> >       int ret;
> >       void __iomem *base;
> > +     const char *tx_clk_name = "spdif";
>
> Reverse tree?
I think that only applies to the network tree.
> Otherwise it looks good.
Thanks!
ChenYu
> Best regards,
> Jernej
>
> >
> >       dev_dbg(&pdev->dev, "Entered %s\n", __func__);
> >
> > @@ -671,9 +690,12 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
> >               return PTR_ERR(host->apb_clk);
> >       }
> >
> > -     host->spdif_clk = devm_clk_get(&pdev->dev, "spdif");
> > +     if (quirks->tx_clk_name)
> > +             tx_clk_name = quirks->tx_clk_name;
> > +     host->spdif_clk = devm_clk_get(&pdev->dev, tx_clk_name);
> >       if (IS_ERR(host->spdif_clk)) {
> > -             dev_err(&pdev->dev, "failed to get a spdif clock.\n");
> > +             dev_err(&pdev->dev, "failed to get the \"%s\" clock.\n",
> > +                     tx_clk_name);
> >               return PTR_ERR(host->spdif_clk);
> >       }
> >
> >
>
>
>
>
^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: [PATCH 04/11] ASoC: sun4i-spdif: Support SPDIF output on A523 family
  2025-10-20 17:10 ` [PATCH 04/11] ASoC: sun4i-spdif: Support SPDIF output on A523 family Chen-Yu Tsai
  2025-10-20 17:49   ` Jernej Škrabec
@ 2025-10-21 12:55   ` kernel test robot
  1 sibling, 0 replies; 28+ messages in thread
From: kernel test robot @ 2025-10-21 12:55 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul
  Cc: oe-kbuild-all, linux-sunxi, linux-sound, linux-clk,
	linux-arm-kernel, devicetree, dmaengine, linux-kernel
Hi Chen-Yu,
kernel test robot noticed the following build warnings:
[auto build test WARNING on sunxi/sunxi/for-next]
[also build test WARNING on broonie-sound/for-next vkoul-dmaengine/next linus/master v6.18-rc2 next-20251021]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url:    https://github.com/intel-lab-lkp/linux/commits/Chen-Yu-Tsai/dt-bindings-dma-allwinner-sun50i-a64-dma-Add-compatibles-for-A523/20251021-011340
base:   https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git sunxi/for-next
patch link:    https://lore.kernel.org/r/20251020171059.2786070-5-wens%40kernel.org
patch subject: [PATCH 04/11] ASoC: sun4i-spdif: Support SPDIF output on A523 family
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20251021/202510212039.XiolKgXp-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 754ebc6ebb9fb9fbee7aef33478c74ea74949853)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251021/202510212039.XiolKgXp-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510212039.XiolKgXp-lkp@intel.com/
All warnings (new ones prefixed by >>):
   Warning: sound/soc/sunxi/sun4i-spdif.c:180 struct member 'mclk_multiplier' not described in 'sun4i_spdif_quirks'
>> Warning: sound/soc/sunxi/sun4i-spdif.c:180 struct member 'tx_clk_name' not described in 'sun4i_spdif_quirks'
-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: [PATCH 11/11] [EXAMPLE] arm64: dts: allwinner: a527-cubie-a5e: Enable I2S and SPDIF output
  2025-10-20 17:10 ` [PATCH 11/11] [EXAMPLE] arm64: dts: allwinner: a527-cubie-a5e: Enable I2S and SPDIF output Chen-Yu Tsai
@ 2025-10-21 21:14   ` kernel test robot
  0 siblings, 0 replies; 28+ messages in thread
From: kernel test robot @ 2025-10-21 21:14 UTC (permalink / raw)
  To: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Mark Brown,
	Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Vinod Koul
  Cc: oe-kbuild-all, linux-sunxi, linux-sound, linux-clk,
	linux-arm-kernel, devicetree, dmaengine, linux-kernel
Hi Chen-Yu,
kernel test robot noticed the following build errors:
[auto build test ERROR on sunxi/sunxi/for-next]
[also build test ERROR on broonie-sound/for-next vkoul-dmaengine/next linus/master v6.18-rc2 next-20251021]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url:    https://github.com/intel-lab-lkp/linux/commits/Chen-Yu-Tsai/dt-bindings-dma-allwinner-sun50i-a64-dma-Add-compatibles-for-A523/20251021-011340
base:   https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git sunxi/for-next
patch link:    https://lore.kernel.org/r/20251020171059.2786070-12-wens%40kernel.org
patch subject: [PATCH 11/11] [EXAMPLE] arm64: dts: allwinner: a527-cubie-a5e: Enable I2S and SPDIF output
config: arm64-defconfig (https://download.01.org/0day-ci/archive/20251022/202510220453.UbrhVlRH-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251022/202510220453.UbrhVlRH-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510220453.UbrhVlRH-lkp@intel.com/
All errors (new ones prefixed by >>):
   also defined at arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts:393.8-397.3
>> ERROR: Input tree has errors, aborting (use -f to force output)
-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: (subset) [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX
  2025-10-20 17:10 [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX Chen-Yu Tsai
                   ` (10 preceding siblings ...)
  2025-10-20 17:10 ` [PATCH 11/11] [EXAMPLE] arm64: dts: allwinner: a527-cubie-a5e: Enable I2S and SPDIF output Chen-Yu Tsai
@ 2025-10-22 19:07 ` Chen-Yu Tsai
  11 siblings, 0 replies; 28+ messages in thread
From: Chen-Yu Tsai @ 2025-10-22 19:07 UTC (permalink / raw)
  To: Jernej Skrabec, Samuel Holland, Mark Brown, Stephen Boyd,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Vinod Koul,
	Chen-Yu Tsai
  Cc: linux-sunxi, linux-sound, linux-clk, linux-arm-kernel, devicetree,
	dmaengine, linux-kernel
On Tue, 21 Oct 2025 01:10:46 +0800, Chen-Yu Tsai wrote:
> This series enables the SPDIF and I2S hardware found on the Allwinner
> A523/A527/T527 family SoCs. These SoCs have one SPDIF interface and
> four I2S interfaces. All of them are capable of both playback and
> capture, however the SPDIF driver only supports playback.
> 
> The series is organized by subsystem, so each maintainer can find the
> patches they need to take.
> 
> [...]
Applied to sunxi/clk-fixes-for-6.18 in local tree, thanks!
[05/11] clk: sunxi-ng: sun55i-a523-r-ccu: Mark bus-r-dma as critical
        commit: 5888533c6011de319c5f23ae147f1f291ce81582
[06/11] clk: sunxi-ng: sun55i-a523-ccu: Lower audio0 pll minimum rate
        commit: 2050280a4bb660b47f8cccf75a69293ae7cbb087
Best regards,
-- 
Chen-Yu Tsai <wens@kernel.org>
^ permalink raw reply	[flat|nested] 28+ messages in thread
end of thread, other threads:[~2025-10-22 19:07 UTC | newest]
Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-20 17:10 [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX Chen-Yu Tsai
2025-10-20 17:10 ` [PATCH 01/11] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatibles for A523 Chen-Yu Tsai
2025-10-20 17:37   ` Conor Dooley
2025-10-20 17:10 ` [PATCH 02/11] ASoC: dt-bindings: allwinner,sun4i-a10-i2s: Add compatible " Chen-Yu Tsai
2025-10-20 17:38   ` Conor Dooley
2025-10-20 17:10 ` [PATCH 03/11] ASoC: dt-bindings: allwinner,sun4i-a10-spdif: " Chen-Yu Tsai
2025-10-20 17:38   ` Conor Dooley
2025-10-20 17:10 ` [PATCH 04/11] ASoC: sun4i-spdif: Support SPDIF output on A523 family Chen-Yu Tsai
2025-10-20 17:49   ` Jernej Škrabec
2025-10-21  3:50     ` Chen-Yu Tsai
2025-10-21 12:55   ` kernel test robot
2025-10-20 17:10 ` [PATCH 05/11] clk: sunxi-ng: sun55i-a523-r-ccu: Mark bus-r-dma as critical Chen-Yu Tsai
2025-10-20 17:51   ` Jernej Škrabec
2025-10-20 17:10 ` [PATCH 06/11] clk: sunxi-ng: sun55i-a523-ccu: Lower audio0 pll minimum rate Chen-Yu Tsai
2025-10-20 17:52   ` Jernej Škrabec
2025-10-20 18:09     ` Chen-Yu Tsai
2025-10-20 18:22       ` Jernej Škrabec
2025-10-20 17:10 ` [PATCH 07/11] arm64: dts: allwinner: a523: Add DMA controller device nodes Chen-Yu Tsai
2025-10-20 17:57   ` Jernej Škrabec
2025-10-20 17:10 ` [PATCH 08/11] arm64: dts: allwinner: a523: Add device node for SPDIF block Chen-Yu Tsai
2025-10-20 17:58   ` Jernej Škrabec
2025-10-20 17:10 ` [PATCH 09/11] arm64: dts: allwinner: a523: Add device nodes for I2S controllers Chen-Yu Tsai
2025-10-20 17:59   ` Jernej Škrabec
2025-10-20 17:10 ` [PATCH 10/11] arm64: dts: allwinner: a523: Add I2S2 pins on PI pin group Chen-Yu Tsai
2025-10-20 18:00   ` Jernej Škrabec
2025-10-20 17:10 ` [PATCH 11/11] [EXAMPLE] arm64: dts: allwinner: a527-cubie-a5e: Enable I2S and SPDIF output Chen-Yu Tsai
2025-10-21 21:14   ` kernel test robot
2025-10-22 19:07 ` (subset) [PATCH 00/11] allwinner: a523: Enable I2S and SPDIF TX Chen-Yu Tsai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).