allwinner: a523: Enable I2S and SPDIF TX
Subsystems (5)
Chen-Yu Tsai
maintainerv2 cover allwinner: a523: Enable I2S and SPDIF TX
Hi folks,
This is v2 of my Allwinner A523 family I2S and SPDIF enablement series.
Changes since v1:
- Collected tags
- Dropped clk patches that were merged
- Added patch for SPDIF pinmux settings that was missing in v1
- Dropped bogus change to DAI name in SPDIF driver
- Dropped clk rate message in SPDIF driver
- Switched my email to kernel.org one
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 adds devices nodes for the DMA controllers.
Patch 6 adds a devices node for the SPDIF interface controller.
Patch 7 adds device nodes for the I2S interface controllers.
Patch 8 adds one set of pinmux settings for I2S2.
Patch 9 adds pinmux settings for SPDIF.
Patch 10 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 (10):
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
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
arm64: dts: allwinner: a523: Add SPDIF TX pin on PB and PI pins [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 | 149 ++++++++++++++++++ .../dts/allwinner/sun55i-a527-cubie-a5e.dts | 52 ++++++ sound/soc/sunxi/sun4i-spdif.c | 26 ++- 6 files changed, 270 insertions(+), 10 deletions(-)
Signature · 1 line
2.47.3
Chen-Yu Tsai
maintainerPATCH v2 1/10 dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatibles for A523
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.
--- .../devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/dma/allwinner,sun50i-a64-dma.yaml +4 -1
@@ -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:
Signature · 1 line
2.47.3
Chen-Yu Tsai
maintainerPATCH v2 2/10 ASoC: dt-bindings: allwinner,sun4i-a10-i2s: Add compatible for A523
In reply to Chen-Yu TsaiAs 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.
--- .../devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml +3 -1
@@ -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:
Signature · 1 line
2.47.3
Chen-Yu Tsai
maintainerPATCH v2 3/10 ASoC: dt-bindings: allwinner,sun4i-a10-spdif: Add compatible for A523
In reply to Chen-Yu TsaiThe 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.
--- .../sound/allwinner,sun4i-a10-spdif.yaml | 44 ++++++++++++++++--- 1 file changed, 38 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-spdif.yaml +38 -6
@@ -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
Signature · 1 line
2.47.3
Chen-Yu Tsai
maintainerPATCH v2 4/10 ASoC: sun4i-spdif: Support SPDIF output on A523 family
In reply to Chen-Yu TsaiThe 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.
---
Changes since v1:
- Dropped bogus name removal
- Dropped clock rate debug message
--- sound/soc/sunxi/sun4i-spdif.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-)
sound/soc/sunxi/sun4i-spdif.c +24 -2
@@ -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 {
@@ -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); }
Signature · 1 line
2.47.3
Re: [PATCH v2 04/10] ASoC: sun4i-spdif: Support SPDIF output on A523 family
Dne ponedeljek, 27. oktober 2025 ob 13:56:45 Srednjeevropski standardni čas je Chen-Yu Tsai napisal(a):
Quoted 9 lines
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 <[email protected]>
Best regards,
Jernej
Chen-Yu Tsai
maintainerPATCH v2 5/10 arm64: dts: allwinner: a523: Add DMA controller device nodes
In reply to Chen-Yu TsaiThe A523 has two DMA controllers. Add device nodes for both. Also hook up DMA for existing devices.
--- .../arm64/boot/dts/allwinner/sun55i-a523.dtsi | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +56 -0
@@ -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>;
Signature · 1 line
2.47.3
Chen-Yu Tsai
maintainerPATCH v2 6/10 arm64: dts: allwinner: a523: Add device node for SPDIF block
In reply to Chen-Yu TsaiThe A523 has a SPDIF interface that is capable of both playback and capture.
Add a node for it.
--- arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +15 -0
@@ -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";
Signature · 1 line
2.47.3
Chen-Yu Tsai
maintainerPATCH v2 7/10 arm64: dts: allwinner: a523: Add device nodes for I2S controllers
In reply to Chen-Yu TsaiThe 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.
--- .../arm64/boot/dts/allwinner/sun55i-a523.dtsi | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +56 -0
@@ -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>;
Signature · 1 line
2.47.3
Chen-Yu Tsai
maintainerPATCH v2 8/10 arm64: dts: allwinner: a523: Add I2S2 pins on PI pin group
In reply to Chen-Yu TsaiThe 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.
--- arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +8 -0
@@ -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>;
Signature · 1 line
2.47.3
Chen-Yu Tsai
maintainerPATCH v2 9/10 arm64: dts: allwinner: a523: Add SPDIF TX pin on PB and PI pins
In reply to Chen-Yu TsaiThe SPDIF TX (called OWA OUT in the datasheet) is available on three pins. Of those, the PH pin is unlikely to be used since it conflicts with the first Ethernet controller.
The Radxa Cubie A5E exposes SPDIF TX through the PI pin group on the 40-pin GPIO header.
The Orange Pi 4A exposes SPDIF TX through both the PB and PI pin groups on the 40-pin GPIO header. The PB pin alternatively would be used for I2S0 though.
Add pinmux settings for both options so potential users can directly reference either one.
---
Changes since v1:
- New patch; missing from v1 causing dts to not compile
--- arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a523.dtsi +14 -0
@@ -200,6 +200,20 @@ rgmii1_pins: rgmii1-pins { bias-disable; }; + /omit-if-no-ref/ + spdif_out_pb_pin: spdif-pb-pin { + pins = "PB8"; + function = "spdif"; + allwinner,pinmux = <2>; + }; + + /omit-if-no-ref/ + spdif_out_pi_pin: spdif-pi-pin { + pins = "PI10"; + function = "spdif"; + allwinner,pinmux = <2>; + }; + uart0_pb_pins: uart0-pb-pins { pins = "PB9", "PB10"; allwinner,pinmux = <2>;
Signature · 1 line
2.47.3
Re: [PATCH v2 09/10] arm64: dts: allwinner: a523: Add SPDIF TX pin on PB and PI pins
Dne ponedeljek, 27. oktober 2025 ob 13:56:50 Srednjeevropski standardni čas je Chen-Yu Tsai napisal(a):
Quoted 7 lines
The SPDIF TX (called OWA OUT in the datasheet) is available on three pins. Of those, the PH pin is unlikely to be used since it conflicts with the first Ethernet controller.
The Radxa Cubie A5E exposes SPDIF TX through the PI pin group on the 40-pin GPIO header.
Quoted 8 lines
The Orange Pi 4A exposes SPDIF TX through both the PB and PI pin groups on the 40-pin GPIO header. The PB pin alternatively would be used for I2S0 though.
Add pinmux settings for both options so potential users can directly reference either one.
Signed-off-by Chen-Yu Tsai <[email protected]>
Best regards,
Jernej
Chen-Yu Tsai
maintainerPATCH v2 10/10 arm64: dts: allwinner: a527-cubie-a5e: Enable I2S and SPDIF output
In reply to Chen-Yu TsaiThis 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.
--- .../dts/allwinner/sun55i-a527-cubie-a5e.dts | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+)
arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts +52 -0
@@ -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>;
Signature · 1 line
2.47.3
Mark Brown
maintainerRe: (subset) [PATCH v2 00/10] allwinner: a523: Enable I2S and SPDIF TX
In reply to Chen-Yu TsaiQuoted 11 lines · Chen-Yu Tsai
This is v2 of my Allwinner A523 family I2S and SPDIF enablement series.
Changes since v1:
- Collected tags
- Dropped clk patches that were merged
- Added patch for SPDIF pinmux settings that was missing in v1
- Dropped bogus change to DAI name in SPDIF driver
- Dropped clk rate message in SPDIF driver
- Switched my email to kernel.org one[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[02/10] ASoC: dt-bindings: allwinner,sun4i-a10-i2s: Add compatible for A523
commit: 67e4b0dfcc6702a31fbb6a3015c0dc867e295eb4
[03/10] ASoC: dt-bindings: allwinner,sun4i-a10-spdif: Add compatible for A523
commit: 6ddcd78aa7f85e1d94ab7f90c72d1ad0c0c7b6ea
[04/10] ASoC: sun4i-spdif: Support SPDIF output on A523 family
commit: 4a5ac6cd05a7e54f1585d7779464d6ed6272c134All 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
Chen-Yu Tsai
maintainerRe: (subset) [PATCH v2 00/10] allwinner: a523: Enable I2S and SPDIF TX
In reply to Chen-Yu TsaiQuoted 11 lines · Chen-Yu Tsai
This is v2 of my Allwinner A523 family I2S and SPDIF enablement series.
Changes since v1:
- Collected tags
- Dropped clk patches that were merged
- Added patch for SPDIF pinmux settings that was missing in v1
- Dropped bogus change to DAI name in SPDIF driver
- Dropped clk rate message in SPDIF driver
- Switched my email to kernel.org one[...]
Applied to sunxi/dt-for-6.19 in local tree, thanks!
[01/10] dt-bindings: dma: allwinner,sun50i-a64-dma: Add compatibles for A523
commit: 697fbb43aba6dae48cbe5e1fa0d3023a0b12ab73
[05/10] arm64: dts: allwinner: a523: Add DMA controller device nodes
commit: 55d43ef77712e3b7fd4c3db5715be1f405afe31e
[06/10] arm64: dts: allwinner: a523: Add device node for SPDIF block
commit: e51b773798ea1dece229b44854256ec38d35cc41
[07/10] arm64: dts: allwinner: a523: Add device nodes for I2S controllers
commit: 1fe1e9b67166e304e8c3e46bdd1104519d6d1bd7
[08/10] arm64: dts: allwinner: a523: Add I2S2 pins on PI pin group
commit: a9050236f81c43fc2eaa2e13098c7fb53c3aba34
[09/10] arm64: dts: allwinner: a523: Add SPDIF TX pin on PB and PI pins
commit: ae0d3f1e6dd2c6404db2fbd7556b93eddd6c87b8Best regards,
Signature · 1 line
Chen-Yu Tsai <[email protected]>