Skip to contentSkip to conversation

Add tested digital audio blocks to A64

PATCH New codekipper at gmail.com 2 participants 7 messages Jan 29, 2018

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

v2 cover Add tested digital audio blocks to A64

From: Marcus Cooper <[email protected]>

Hi All,

this patch series adds the digital audio blocks to the A64 SoC. No block changes are necessary.

BR,
CK

---
v2 changes compared to v1 are:
- Added SoC specific compatiables
- moved spdif default pins to dtsi
- Added i2s2 block for HDMI as it has now been tested.
---
Marcus Cooper (5):
arm64: allwinner: a64: Add the SPDIF block and pin
arm64: allwinner: a64: Add SPDIF to the A64
arm64: allwinner: a64: Add SPDIF to the Pine64
arm64: allwinner: a64: Add DAI nodes
arm64: allwinner: a64: Add DAI node for HDMI

 .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts |  5 ++
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi      | 81 ++++++++++++++++++++++
 2 files changed, 86 insertions(+)
Signature · 1 line
2.16.1
#1 lore raw

PATCH v2 1/5 arm64: allwinner: a64: Add the SPDIF block and pin

From: Marcus Cooper <[email protected]>

Add the SPDIF transceiver controller block and pin to the A64 dtsi.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +21 -0
index d783d164b9c3..43c54a2133f0 100644
@@ -336,6 +336,11 @@
 				drive-strength = <40>;
 			};
 
+			spdif_tx_pin: spdif {
+				pins = "PH8";
+				function = "spdif";
+			};
+
 			spi0_pins: spi0 {
 				pins = "PC0", "PC1", "PC2", "PC3";
 				function = "spi0";
@@ -382,6 +387,22 @@
 			};
 		};
 
+		spdif: spdif at 1c21000 {
+			#sound-dai-cells = <0>;
+			compatible = "allwinner,sun50i-a64-spdif",
+				     "allwinner,sun8i-h3-spdif";
+			reg = <0x01c21000 0x400>;
+			interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_SPDIF>, <&ccu CLK_SPDIF>;
+			resets = <&ccu RST_BUS_SPDIF>;
+			clock-names = "apb", "spdif";
+			dmas = <&dma 2>;
+			dma-names = "tx";
+			pinctrl-names = "default";
+			pinctrl-0 = <&spdif_tx_pin>;
+			status = "disabled";
+		};
+
 		uart0: serial at 1c28000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x01c28000 0x400>;
Signature · 1 line
2.16.1
#2 lore raw

PATCH v2 2/5 arm64: allwinner: a64: Add SPDIF to the A64

In reply to codekipper at gmail.com

From: Marcus Cooper <[email protected]>

Add the device tree sound bindings for the S/PDIF block.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +18 -0
index 43c54a2133f0..b9e69657a2e8 100644
@@ -112,6 +112,24 @@
 		method = "smc";
 	};
 
+	sound_spdif {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "On-board SPDIF";
+
+		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";
+	};
+
 	timer {
 		compatible = "arm,armv8-timer";
 		interrupts = <GIC_PPI 13
Signature · 1 line
2.16.1
#3 lore raw

PATCH v2 3/5 arm64: allwinner: a64: Add SPDIF to the Pine64

In reply to codekipper at gmail.com

From: Marcus Cooper <[email protected]>

The S/PDIF transmitter can be reached on the Euler connector. But as this is a GPIO then leave it disabled so that an overlay can override the status property.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts +5 -0
index 604cdaedac38..d1161069af9e 100644
@@ -230,6 +230,11 @@
 	regulator-name = "vcc-rtc";
 };
 
+/* On Euler connector */
+&spdif {
+	status = "disabled";
+};
+
 /* On Exp and Euler connectors */
 &uart0 {
 	pinctrl-names = "default";
Signature · 1 line
2.16.1
#4 lore raw

PATCH v2 4/5 arm64: allwinner: a64: Add DAI nodes

In reply to codekipper at gmail.com

From: Marcus Cooper <[email protected]>

Add the DAI blocks to the device tree. I2S0 and I2S1 are for connecting to an external codec.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 28 +++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +28 -0
index b9e69657a2e8..1b6dc31e7d91 100644
@@ -421,6 +421,34 @@
 			status = "disabled";
 		};
 
+		i2s0: i2s at 1c22000 {
+			#sound-dai-cells = <0>;
+			compatible = "allwinner,sun50i-a64-i2s",
+				     "allwinner,sun8i-h3-i2s";
+			reg = <0x01c22000 0x400>;
+			interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_I2S0>, <&ccu CLK_I2S0>;
+			clock-names = "apb", "mod";
+			resets = <&ccu RST_BUS_I2S0>;
+			dma-names = "rx", "tx";
+			dmas = <&dma 3>, <&dma 3>;
+			status = "disabled";
+		};
+
+		i2s1: i2s at 1c22400 {
+			#sound-dai-cells = <0>;
+			compatible = "allwinner,sun50i-a64-i2s",
+				     "allwinner,sun8i-h3-i2s";
+			reg = <0x01c22400 0x400>;
+			interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_I2S1>, <&ccu CLK_I2S1>;
+			clock-names = "apb", "mod";
+			resets = <&ccu RST_BUS_I2S1>;
+			dma-names = "rx", "tx";
+			dmas = <&dma 4>, <&dma 4>;
+			status = "disabled";
+		};
+
 		uart0: serial at 1c28000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x01c28000 0x400>;
Signature · 1 line
2.16.1
#5 lore raw

PATCH v2 5/5 arm64: allwinner: a64: Add DAI node for HDMI

In reply to codekipper at gmail.com

From: Marcus Cooper <[email protected]>

Add the new DAI block for I2S2 which is used for HDMI audio.

---
 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +14 -0
index 1b6dc31e7d91..c913dada7653 100644
@@ -449,6 +449,20 @@
 			status = "disabled";
 		};
 
+		i2s2: i2s at 1c22800 {
+			#sound-dai-cells = <0>;
+			compatible = "allwinner,sun50i-a64-i2s",
+				     "allwinner,sun8i-h3-i2s";
+			reg = <0x01c22800 0x400>;
+			interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_I2S2>, <&ccu CLK_I2S2>;
+			clock-names = "apb", "mod";
+			resets = <&ccu RST_BUS_I2S2>;
+			dma-names = "tx";
+			dmas = <&dma 27>;
+			status = "disabled";
+		};
+
 		uart0: serial at 1c28000 {
 			compatible = "snps,dw-apb-uart";
 			reg = <0x01c28000 0x400>;
Signature · 1 line
2.16.1
#6 lore raw

v2 cover Add tested digital audio blocks to A64

In reply to codekipper at gmail.com
Quoted 6 lines · codekipper at gmail.com

From: Marcus Cooper <[email protected]>

Hi All,

this patch series adds the digital audio blocks to the A64 SoC. No block changes are necessary.

queued all of these changes for 4.17. Thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180129/657f0248/attachment.sig>