Skip to contentSkip to conversation

Enable SPDIF on the Mele I7

PATCH New codekipper at gmail.com 3 participants 10 messages Dec 20, 2016 – Jan 9, 2017

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

cover Enable SPDIF on the Mele I7

From: Marcus Cooper <[email protected]>

Hi All,
here is the patch set required to enable SPDIF on the Mele I7 which is a A31 based TV-box. To get this working a fix has to be applied to the clock driver and this will be pushed seperately.

For now the dtsi changes can be applied and when the clk change is merged then we can finialise this push by applying the I7 patch. BR,
CK

Marcus Cooper (3):
ARM: dts: sun6i: Add SPDIF TX pin to the A31
ARM: dts: sun6i: Add the SPDIF block to the A31
ARM: dts: sun6i: Add SPDIF to the Mele I7

 arch/arm/boot/dts/sun6i-a31-i7.dts | 24 ++++++++++++++++++++++++
 arch/arm/boot/dts/sun6i-a31.dtsi   | 19 +++++++++++++++++++
 2 files changed, 43 insertions(+)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/3 ARM: dts: sun6i: Add SPDIF TX pin to the A31

From: Marcus Cooper <[email protected]>

Add the SPDIF TX pin to the A31 dtsi.

---
 arch/arm/boot/dts/sun6i-a31.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/sun6i-a31.dtsi +5 -0
index 20a0331ddfb5..7370ba6c9993 100644
@@ -586,6 +586,11 @@
 				bias-pull-up;
 			};
 
+			spdif_pins_a: spdif at 0 {
+				pins = "PH28";
+				function = "spdif";
+			};
+
 			uart0_pins_a: uart0 at 0 {
 				pins = "PH20", "PH21";
 				function = "uart0";
Signature · 1 line
2.11.0
#2 lore raw

PATCH 1/3 ARM: dts: sun6i: Add SPDIF TX pin to the A31

Quoted 5 lines · codekipper at gmail.com

From: Marcus Cooper <[email protected]>

Add the SPDIF TX pin to the A31 dtsi.

Applied, 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: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161220/804105e1/attachment.sig>
#3 lore raw

PATCH 2/3 ARM: dts: sun6i: Add the SPDIF block to the A31

In reply to codekipper at gmail.com

From: Marcus Cooper <[email protected]>

Add the SPDIF transceiver controller block to the A31 dtsi.

---
 arch/arm/boot/dts/sun6i-a31.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm/boot/dts/sun6i-a31.dtsi +14 -0
index 7370ba6c9993..559c53efa7e6 100644
@@ -613,6 +613,20 @@
 			reg = <0x01c20ca0 0x20>;
 		};
 
+		spdif: spdif at 01c21000 {
+			#sound-dai-cells = <0>;
+			compatible = "allwinner,sun6i-a31-spdif";
+			reg = <0x01c21000 0x400>;
+			interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_APB1_SPDIF>, <&ccu CLK_SPDIF>;
+			resets = <&ccu RST_APB1_SPDIF>;
+			clock-names = "apb", "spdif";
+			dmas = <&dma 2>, <&dma 2>;
+			dma-names = "rx", "tx";
+			spdif-out = "disabled";
+			status = "disabled";
+		};
+
 		lradc: lradc at 01c22800 {
 			compatible = "allwinner,sun4i-a10-lradc-keys";
 			reg = <0x01c22800 0x100>;
Signature · 1 line
2.11.0
#4 lore raw

PATCH 2/3 ARM: dts: sun6i: Add the SPDIF block to the A31

Hi,

Quoted 18 lines · codekipper at gmail.com

From: Marcus Cooper <[email protected]>

Add the SPDIF transceiver controller block to the A31 dtsi.

---
 arch/arm/boot/dts/sun6i-a31.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm/boot/dts/sun6i-a31.dtsi +1 -0
index 7370ba6c9993..559c53efa7e6 100644
@@ -613,6 +613,20 @@
 			reg = <0x01c20ca0 0x20>;
 		};
 
+		spdif: spdif at 01c21000 {

arch/arm/boot/dts/sun6i-a31.dtsi line 626

Quoted 10 lines
arch/arm/boot/dts/sun6i-a31.dtsi +10 -0
+			#sound-dai-cells = <0>;
+			compatible = "allwinner,sun6i-a31-spdif";
+			reg = <0x01c21000 0x400>;
+			interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_APB1_SPDIF>, <&ccu CLK_SPDIF>;
+			resets = <&ccu RST_APB1_SPDIF>;
+			clock-names = "apb", "spdif";
+			dmas = <&dma 2>, <&dma 2>;
+			dma-names = "rx", "tx";
+			spdif-out = "disabled";

That property isn't documented anywhere, and doesn't seem to be used in your driver either.

On a separate topic, is the channel inversion bug also found on the A31?

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: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161220/b0c1450a/attachment.sig>
#5 lore raw

PATCH 2/3 ARM: dts: sun6i: Add the SPDIF block to the A31

Quoted 20 lines · Maxime Ripard

Hi,

Quoted 17 lines · codekipper at gmail.com

From: Marcus Cooper <[email protected]>

Add the SPDIF transceiver controller block to the A31 dtsi.

---
 arch/arm/boot/dts/sun6i-a31.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm/boot/dts/sun6i-a31.dtsi +0 -0
index 7370ba6c9993..559c53efa7e6 100644
@@ -613,6 +613,20 @@
                      reg = <0x01c20ca0 0x20>;
              };
 
Quoted 14 lines

arch/arm/boot/dts/sun6i-a31.dtsi line 626

Quoted 11 lines
arch/arm/boot/dts/sun6i-a31.dtsi +11 -0
+             spdif: spdif at 01c21000 {
+                     #sound-dai-cells = <0>;
+                     compatible = "allwinner,sun6i-a31-spdif";
+                     reg = <0x01c21000 0x400>;
+                     interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
+                     clocks = <&ccu CLK_APB1_SPDIF>, <&ccu CLK_SPDIF>;
+                     resets = <&ccu RST_APB1_SPDIF>;
+                     clock-names = "apb", "spdif";
+                     dmas = <&dma 2>, <&dma 2>;
+                     dma-names = "rx", "tx";
+                     spdif-out = "disabled";

That property isn't documented anywhere, and doesn't seem to be used in your driver either.

Ooops....do you want me to respin a new patch or will you do your magic with 'dd'? It fell through the cracks as it was cherry picked from my dev branch where I was at one time playing with spdif-in. This has pretty much been relegated to the bottom of my todo/finish list.

Quoted 3 lines

On a separate topic, is the channel inversion bug also found on the A31?

I have seen this and I'm sure that was also on my A31 hardware but I've just fired her up and the speaker test worked as expected. I also repeated the test on my A10 device and didn't hear the issue. CK

Quoted 7 lines

Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

#6 lore raw

PATCH 2/3 ARM: dts: sun6i: Add the SPDIF block to the A31

Quoted 37 lines · Code Kipper
Quoted 20 lines · Maxime Ripard

Hi,

Quoted 17 lines · codekipper at gmail.com

From: Marcus Cooper <[email protected]>

Add the SPDIF transceiver controller block to the A31 dtsi.

---
 arch/arm/boot/dts/sun6i-a31.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm/boot/dts/sun6i-a31.dtsi +0 -0
index 7370ba6c9993..559c53efa7e6 100644
@@ -613,6 +613,20 @@
                      reg = <0x01c20ca0 0x20>;
              };
 
Quoted 14 lines

arch/arm/boot/dts/sun6i-a31.dtsi line 626

Quoted 11 lines
arch/arm/boot/dts/sun6i-a31.dtsi +11 -0
+             spdif: spdif at 01c21000 {
+                     #sound-dai-cells = <0>;
+                     compatible = "allwinner,sun6i-a31-spdif";
+                     reg = <0x01c21000 0x400>;
+                     interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
+                     clocks = <&ccu CLK_APB1_SPDIF>, <&ccu CLK_SPDIF>;
+                     resets = <&ccu RST_APB1_SPDIF>;
+                     clock-names = "apb", "spdif";
+                     dmas = <&dma 2>, <&dma 2>;
+                     dma-names = "rx", "tx";
+                     spdif-out = "disabled";

That property isn't documented anywhere, and doesn't seem to be used in your driver either.

Quoted 2 lines

Ooops....do you want me to respin a new patch or will you do your magic with 'dd'?

Sorry, it's C-w for me :)

Quoted 3 lines

It fell through the cracks as it was cherry picked from my dev branch where I was at one time playing with spdif-in. This has pretty much been relegated to the bottom of my todo/finish list.

I fixed and applied.

Quoted 6 lines
Quoted 2 lines

On a separate topic, is the channel inversion bug also found on the A31?

I have seen this and I'm sure that was also on my A31 hardware but I've just fired her up and the speaker test worked as expected. I also repeated the test on my A10 device and didn't hear the issue.

Ok.

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: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20161220/20d095e5/attachment-0001.sig>
#7 lore raw

PATCH 3/3 ARM: dts: sun6i: Add SPDIF to the Mele I7

In reply to codekipper at gmail.com

From: Marcus Cooper <[email protected]>

Enable the S/PDIF transmitter that is present on the Mele I7.

---
 arch/arm/boot/dts/sun6i-a31-i7.dts | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm/boot/dts/sun6i-a31-i7.dts +24 -0
index a2193309a199..2bc57d2dcd80 100644
@@ -69,6 +69,23 @@
 			gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>;
 		};
 	};
+
+	sound {
+		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";
+	};
 };
 
 &codec {
@@ -138,6 +155,13 @@
 	status = "okay";
 };
 
+&spdif {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spdif_pins_a>;
+	spdif-out = "okay";
+	status = "okay";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_pins_a>;
Signature · 1 line
2.11.0
#8 lore raw

PATCH 3/3 ARM: dts: sun6i: Add SPDIF to the Mele I7

Quoted 5 lines · On Tue, Dec 20, 2016 at 6:40 PM, <[email protected]> wrote:

From: Marcus Cooper <[email protected]>

Enable the S/PDIF transmitter that is present on the Mele I7.

This patch should be ready to be merged. The associated clk and dtsi changes are already in Maxime's tree.

Quoted 53 lines
---
 arch/arm/boot/dts/sun6i-a31-i7.dts | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm/boot/dts/sun6i-a31-i7.dts +24 -1
index a2193309a199..2bc57d2dcd80 100644
@@ -69,6 +69,23 @@
                        gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>;
                };
        };
+
+       sound {
+               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";
+       };
 };
 
 &codec {
@@ -138,6 +155,13 @@
        status = "okay";
 };
 
+&spdif {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spdif_pins_a>;
+       spdif-out = "okay";
+       status = "okay";
+};
+
 &uart0 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart0_pins_a>;
--

2.11.0

--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe at googlegroups.com. For more options, visit https://groups.google.com/d/optout.

#9 lore raw

PATCH 3/3 ARM: dts: sun6i: Add SPDIF to the Mele I7

Quoted 11 lines · Chen-Yu Tsai
Quoted 5 lines · On Tue, Dec 20, 2016 at 6:40 PM, <[email protected]> wrote:

From: Marcus Cooper <[email protected]>

Enable the S/PDIF transmitter that is present on the Mele I7.

This patch should be ready to be merged. The associated clk and dtsi changes are already in Maxime's tree.

Applied, 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: 801 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170109/c439d597/attachment.sig>