linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 0/2] Allwinner H6 SPDIF support
@ 2019-08-12 10:51 Clément Péron
  2019-08-12 10:51 ` [PATCH v6 1/2] arm64: dts: allwinner: Add SPDIF node for Allwinner H6 Clément Péron
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Clément Péron @ 2019-08-12 10:51 UTC (permalink / raw)
  To: Maxime Ripard, Rob Herring
  Cc: linux-arm-kernel, devicetree, linux-kernel, linux-sunxi,
	Clément Péron

Allwinner H6 SoC has a SPDIF controller called One Wire Audio (OWA) which
is different from the previous H3 generation and not compatible.

Difference are an increase of fifo sizes, some memory mapping are different
and there is now the possibility to output the master clock on a pin.

Actually all these features are unused and only a bit for flushing the TX
fifo is required.

Changes since v5:
 - Move soundcard to board device-tree

Changes since v4:
 - rename audio card name to sun50i-h6-spdif
 - drop patches already merged

Changes since v3:
 - rename reg_fctl_ftx to val_fctl_ftx
 - rebase this series on sound-next
 - fix dt-bindings due to change in sound-next
 - change node name sound_spdif to sound-spdif

Changes since v2:
 - Split quirks and H6 support patch
 - Add specific section for quirks comment

Changes since v1:
 - Remove H3 compatible
 - Add TX fifo bit flush quirks
 - Add H6 bindings in SPDIF driver

Clément Péron (2):
  arm64: dts: allwinner: Add SPDIF node for Allwinner H6
  arm64: dts: allwinner: h6: Enable SPDIF for Beelink GS1

 .../dts/allwinner/sun50i-h6-beelink-gs1.dts   | 22 +++++++++++++++++++
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi  | 20 +++++++++++++++++
 2 files changed, 42 insertions(+)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v6 1/2] arm64: dts: allwinner: Add SPDIF node for Allwinner H6
  2019-08-12 10:51 [PATCH v6 0/2] Allwinner H6 SPDIF support Clément Péron
@ 2019-08-12 10:51 ` Clément Péron
  2019-08-12 10:51 ` [PATCH v6 2/2] arm64: dts: allwinner: h6: Enable SPDIF for Beelink GS1 Clément Péron
  2019-08-12 11:23 ` [PATCH v6 0/2] Allwinner H6 SPDIF support Maxime Ripard
  2 siblings, 0 replies; 4+ messages in thread
From: Clément Péron @ 2019-08-12 10:51 UTC (permalink / raw)
  To: Maxime Ripard, Rob Herring
  Cc: linux-arm-kernel, devicetree, linux-kernel, linux-sunxi,
	Clément Péron

The Allwinner H6 has a SPDIF controller called OWA (One Wire Audio).

Only one pinmuxing is available so set it as default.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
---
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index 7628a7c83096..2ba9ab9e0924 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -282,6 +282,11 @@
 				bias-pull-up;
 			};
 
+			spdif_tx_pin: spdif-tx-pin {
+				pins = "PH7";
+				function = "spdif";
+			};
+
 			uart0_ph_pins: uart0-ph-pins {
 				pins = "PH0", "PH1";
 				function = "uart0";
@@ -411,6 +416,21 @@
 			};
 		};
 
+		spdif: spdif@5093000 {
+			#sound-dai-cells = <0>;
+			compatible = "allwinner,sun50i-h6-spdif";
+			reg = <0x05093000 0x400>;
+			interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_SPDIF>, <&ccu CLK_SPDIF>;
+			clock-names = "apb", "spdif";
+			resets = <&ccu RST_BUS_SPDIF>;
+			dmas = <&dma 2>;
+			dma-names = "tx";
+			pinctrl-names = "default";
+			pinctrl-0 = <&spdif_tx_pin>;
+			status = "disabled";
+		};
+
 		usb2otg: usb@5100000 {
 			compatible = "allwinner,sun50i-h6-musb",
 				     "allwinner,sun8i-a33-musb";
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v6 2/2] arm64: dts: allwinner: h6: Enable SPDIF for Beelink GS1
  2019-08-12 10:51 [PATCH v6 0/2] Allwinner H6 SPDIF support Clément Péron
  2019-08-12 10:51 ` [PATCH v6 1/2] arm64: dts: allwinner: Add SPDIF node for Allwinner H6 Clément Péron
@ 2019-08-12 10:51 ` Clément Péron
  2019-08-12 11:23 ` [PATCH v6 0/2] Allwinner H6 SPDIF support Maxime Ripard
  2 siblings, 0 replies; 4+ messages in thread
From: Clément Péron @ 2019-08-12 10:51 UTC (permalink / raw)
  To: Maxime Ripard, Rob Herring
  Cc: linux-arm-kernel, devicetree, linux-kernel, linux-sunxi,
	Clément Péron

Beelink GS1 board has a SPDIF out connector, so enable it in
the device-tree and add a simple SPDIF soundcard.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
---
 .../dts/allwinner/sun50i-h6-beelink-gs1.dts   | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts
index 0dc33c90dd60..4bd14f085070 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts
@@ -51,6 +51,24 @@
 		regulator-max-microvolt = <5000000>;
 		regulator-always-on;
 	};
+
+	sound-spdif {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "sun50i-h6-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";
+	};
 };
 
 &de {
@@ -243,6 +261,10 @@
 	vcc-pm-supply = <&reg_aldo1>;
 };
 
+&spdif {
+	status = "okay";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_ph_pins>;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v6 0/2] Allwinner H6 SPDIF support
  2019-08-12 10:51 [PATCH v6 0/2] Allwinner H6 SPDIF support Clément Péron
  2019-08-12 10:51 ` [PATCH v6 1/2] arm64: dts: allwinner: Add SPDIF node for Allwinner H6 Clément Péron
  2019-08-12 10:51 ` [PATCH v6 2/2] arm64: dts: allwinner: h6: Enable SPDIF for Beelink GS1 Clément Péron
@ 2019-08-12 11:23 ` Maxime Ripard
  2 siblings, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2019-08-12 11:23 UTC (permalink / raw)
  To: Clément Péron
  Cc: Rob Herring, linux-arm-kernel, devicetree, linux-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 589 bytes --]

On Mon, Aug 12, 2019 at 12:51:13PM +0200, Clément Péron wrote:
> Allwinner H6 SoC has a SPDIF controller called One Wire Audio (OWA) which
> is different from the previous H3 generation and not compatible.
>
> Difference are an increase of fifo sizes, some memory mapping are different
> and there is now the possibility to output the master clock on a pin.
>
> Actually all these features are unused and only a bit for flushing the TX
> fifo is required.

Applied both, thanks

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-12 11:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-12 10:51 [PATCH v6 0/2] Allwinner H6 SPDIF support Clément Péron
2019-08-12 10:51 ` [PATCH v6 1/2] arm64: dts: allwinner: Add SPDIF node for Allwinner H6 Clément Péron
2019-08-12 10:51 ` [PATCH v6 2/2] arm64: dts: allwinner: h6: Enable SPDIF for Beelink GS1 Clément Péron
2019-08-12 11:23 ` [PATCH v6 0/2] Allwinner H6 SPDIF support Maxime Ripard

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).