linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] arm64: dts: meson-gx: add initial playback support
@ 2020-04-21 16:39 Jerome Brunet
  2020-04-21 16:39 ` [PATCH 1/6] arm64: defconfig: enable meson gx audio as module Jerome Brunet
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Jerome Brunet @ 2020-04-21 16:39 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: Jerome Brunet, linux-amlogic, devicetree, linux-kernel

This patchset is adding the aiu support in DT and well as basic card
support for the p230/q200 and libretech boards

I was hoping to provide the internal codec support with this series but
this is still blocked on the reset dt-bindings of the DAC [0].

So far, things are fairly stable on these boards. I have experienced
a few glitches on rare occasions. I have not been able to precisely found
out why. It seems to be linked the AIU resets and 8ch support. Maybe more
eyes (and ears) on this will help. If things get annoying and no solution
is found, I'll submit a change to restrict the output to i2s 2ch.

[0]: https://lore.kernel.org/r/20200122092526.2436421-1-jbrunet@baylibre.com

Jerome Brunet (6):
  arm64: defconfig: enable meson gx audio as module
  arm64: dts: meson-gx: add aiu support
  arm64: dts: meson: p230-q200: add initial audio playback support
  arm64: dts: meson: libretech-cc: add initial audio playback support
  arm64: dts: meson: libretech-ac: add initial audio playback support
  arm64: dts: meson: libretech-pc: add initial audio playback support

 .../dts/amlogic/meson-gx-libretech-pc.dtsi    | 40 ++++++++++++
 .../boot/dts/amlogic/meson-gx-p23x-q20x.dtsi  | 63 +++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi     | 13 ++++
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi   | 23 +++++++
 .../amlogic/meson-gxl-s805x-libretech-ac.dts  | 40 ++++++++++++
 .../amlogic/meson-gxl-s905x-libretech-cc.dts  | 40 ++++++++++++
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi    | 23 +++++++
 arch/arm64/configs/defconfig                  |  2 +
 8 files changed, 244 insertions(+)

-- 
2.25.2


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

* [PATCH 1/6] arm64: defconfig: enable meson gx audio as module
  2020-04-21 16:39 [PATCH 0/6] arm64: dts: meson-gx: add initial playback support Jerome Brunet
@ 2020-04-21 16:39 ` Jerome Brunet
  2020-04-21 16:39 ` [PATCH 2/6] arm64: dts: meson-gx: add aiu support Jerome Brunet
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Jerome Brunet @ 2020-04-21 16:39 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: Jerome Brunet, linux-amlogic, devicetree, linux-kernel

Enable the module config for the Amlogic GX audio card.
This module will imply the internal components usually associated
with it to make a functional sound card on these platforms.

Also enable the simple amplifier module which often used on the
output stage of those cards.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 arch/arm64/configs/defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 24e534d85045..71a6e1309b5f 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -642,6 +642,7 @@ CONFIG_SND_HDA_CODEC_HDMI=m
 CONFIG_SND_SOC=y
 CONFIG_SND_BCM2835_SOC_I2S=m
 CONFIG_SND_MESON_AXG_SOUND_CARD=m
+CONFIG_SND_MESON_GX_SOUND_CARD=m
 CONFIG_SND_SOC_SDM845=m
 CONFIG_SND_SOC_ROCKCHIP=m
 CONFIG_SND_SOC_ROCKCHIP_SPDIF=m
@@ -654,6 +655,7 @@ CONFIG_SND_SOC_AK4613=m
 CONFIG_SND_SOC_ES7134=m
 CONFIG_SND_SOC_ES7241=m
 CONFIG_SND_SOC_PCM3168A_I2C=m
+CONFIG_SND_SOC_SIMPLE_AMPLIFIER=m
 CONFIG_SND_SOC_TAS571X=m
 CONFIG_SND_SOC_WCD934X=m
 CONFIG_SND_SOC_WSA881X=m
-- 
2.25.2


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

* [PATCH 2/6] arm64: dts: meson-gx: add aiu support
  2020-04-21 16:39 [PATCH 0/6] arm64: dts: meson-gx: add initial playback support Jerome Brunet
  2020-04-21 16:39 ` [PATCH 1/6] arm64: defconfig: enable meson gx audio as module Jerome Brunet
@ 2020-04-21 16:39 ` Jerome Brunet
  2020-04-22 13:12   ` Neil Armstrong
  2020-04-21 16:39 ` [PATCH 3/6] arm64: dts: meson: p230-q200: add initial audio playback support Jerome Brunet
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 11+ messages in thread
From: Jerome Brunet @ 2020-04-21 16:39 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: Jerome Brunet, linux-amlogic, devicetree, linux-kernel

Add the AIU audio device to the Amlogic GX SoC family DT.
ATM, this device provides the i2s and spdif output stages and also
the hdmi and internal codec glues.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 arch/arm64/boot/dts/amlogic/meson-gx.dtsi   | 13 ++++++++++++
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 23 +++++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi  | 23 +++++++++++++++++++++
 3 files changed, 59 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
index 03f79fe045b7..a8dc8f810253 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
@@ -278,6 +278,17 @@ reset: reset-controller@4404 {
 				#reset-cells = <1>;
 			};
 
+			aiu: audio-controller@5400 {
+				compatible = "amlogic,aiu";
+				#sound-dai-cells = <2>;
+				sound-name-prefix = "AIU";
+				reg = <0x0 0x5400 0x0 0x2ac>;
+				interrupts = <GIC_SPI 48 IRQ_TYPE_EDGE_RISING>,
+					     <GIC_SPI 50 IRQ_TYPE_EDGE_RISING>;
+				interrupt-names = "i2s", "spdif";
+				status = "disabled";
+			};
+
 			uart_A: serial@84c0 {
 				compatible = "amlogic,meson-gx-uart";
 				reg = <0x0 0x84c0 0x0 0x18>;
@@ -626,6 +637,8 @@ hdmi_tx: hdmi-tx@c883a000 {
 			interrupts = <GIC_SPI 57 IRQ_TYPE_EDGE_RISING>;
 			#address-cells = <1>;
 			#size-cells = <0>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "HDMITX";
 			status = "disabled";
 
 			/* VPU VENC Input */
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
index 0cb40326b0d3..234490d3ee68 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
@@ -60,6 +60,29 @@ usb1: usb@c9100000 {
 	};
 };
 
+&aiu {
+	compatible = "amlogic,aiu-gxbb", "amlogic,aiu";
+	clocks = <&clkc CLKID_AIU_GLUE>,
+		 <&clkc CLKID_I2S_OUT>,
+		 <&clkc CLKID_AOCLK_GATE>,
+		 <&clkc CLKID_CTS_AMCLK>,
+		 <&clkc CLKID_MIXER_IFACE>,
+		 <&clkc CLKID_IEC958>,
+		 <&clkc CLKID_IEC958_GATE>,
+		 <&clkc CLKID_CTS_MCLK_I958>,
+		 <&clkc CLKID_CTS_I958>;
+	clock-names = "pclk",
+		      "i2s_pclk",
+		      "i2s_aoclk",
+		      "i2s_mclk",
+		      "i2s_mixer",
+		      "spdif_pclk",
+		      "spdif_aoclk",
+		      "spdif_mclk",
+		      "spdif_mclk_sel";
+	resets = <&reset RESET_AIU>;
+};
+
 &aobus {
 	pinctrl_aobus: pinctrl@14 {
 		compatible = "amlogic,meson-gxbb-aobus-pinctrl";
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
index 259d86399390..d9f00c5a9a5c 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
@@ -49,6 +49,29 @@ crypto: crypto@c883e000 {
 	};
 };
 
+&aiu {
+	compatible = "amlogic,aiu-gxl", "amlogic,aiu";
+	clocks = <&clkc CLKID_AIU_GLUE>,
+		 <&clkc CLKID_I2S_OUT>,
+		 <&clkc CLKID_AOCLK_GATE>,
+		 <&clkc CLKID_CTS_AMCLK>,
+		 <&clkc CLKID_MIXER_IFACE>,
+		 <&clkc CLKID_IEC958>,
+		 <&clkc CLKID_IEC958_GATE>,
+		 <&clkc CLKID_CTS_MCLK_I958>,
+		 <&clkc CLKID_CTS_I958>;
+	clock-names = "pclk",
+		      "i2s_pclk",
+		      "i2s_aoclk",
+		      "i2s_mclk",
+		      "i2s_mixer",
+		      "spdif_pclk",
+		      "spdif_aoclk",
+		      "spdif_mclk",
+		      "spdif_mclk_sel";
+	resets = <&reset RESET_AIU>;
+};
+
 &apb {
 	usb2_phy0: phy@78000 {
 		compatible = "amlogic,meson-gxl-usb2-phy";
-- 
2.25.2


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

* [PATCH 3/6] arm64: dts: meson: p230-q200: add initial audio playback support
  2020-04-21 16:39 [PATCH 0/6] arm64: dts: meson-gx: add initial playback support Jerome Brunet
  2020-04-21 16:39 ` [PATCH 1/6] arm64: defconfig: enable meson gx audio as module Jerome Brunet
  2020-04-21 16:39 ` [PATCH 2/6] arm64: dts: meson-gx: add aiu support Jerome Brunet
@ 2020-04-21 16:39 ` Jerome Brunet
  2020-04-21 16:39 ` [PATCH 4/6] arm64: dts: meson: libretech-cc: " Jerome Brunet
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Jerome Brunet @ 2020-04-21 16:39 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: Jerome Brunet, linux-amlogic, devicetree, linux-kernel

Add basic audio support on the p230/q200 reference design.
This initial support is limited to HDMI i2s and SPDIF (LPCM).

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 .../boot/dts/amlogic/meson-gx-p23x-q20x.dtsi  | 63 +++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi
index 12d5e333e5f2..99c1f7f9d37e 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi
@@ -8,12 +8,21 @@
  * the pin-compatible S912 (GXM) or S905D (GXL) SoCs.
  */
 
+#include <dt-bindings/sound/meson-aiu.h>
+
 / {
 	aliases {
 		serial0 = &uart_AO;
 		ethernet0 = &ethmac;
 	};
 
+	spdif_dit: audio-codec-0 {
+		#sound-dai-cells = <0>;
+		compatible = "linux,spdif-dit";
+		status = "okay";
+		sound-name-prefix = "DIT";
+	};
+
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
@@ -102,6 +111,60 @@ hdmi_connector_in: endpoint {
 			};
 		};
 	};
+
+	sound {
+		compatible = "amlogic,gx-sound-card";
+		model = "GX-P230-Q200";
+		assigned-clocks = <&clkc CLKID_MPLL0>,
+				  <&clkc CLKID_MPLL1>,
+				  <&clkc CLKID_MPLL2>;
+		assigned-clock-parents = <0>, <0>, <0>;
+		assigned-clock-rates = <294912000>,
+				       <270950400>,
+				       <393216000>;
+		status = "okay";
+
+		dai-link-0 {
+			sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
+		};
+
+		dai-link-1 {
+			sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>;
+		};
+
+		dai-link-2 {
+			sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
+			dai-format = "i2s";
+			mclk-fs = <256>;
+
+			codec-0 {
+				sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
+			};
+		};
+
+		dai-link-3 {
+			sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>;
+
+			codec-0 {
+				sound-dai = <&spdif_dit>;
+			};
+		};
+
+		dai-link-4 {
+			sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
+
+			codec-0 {
+				sound-dai = <&hdmi_tx>;
+			};
+		};
+	};
+};
+
+&aiu {
+	status = "okay";
+	pinctrl-0 = <&spdif_out_h_pins>;
+	pinctrl-names = "default";
+
 };
 
 &cec_AO {
-- 
2.25.2


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

* [PATCH 4/6] arm64: dts: meson: libretech-cc: add initial audio playback support
  2020-04-21 16:39 [PATCH 0/6] arm64: dts: meson-gx: add initial playback support Jerome Brunet
                   ` (2 preceding siblings ...)
  2020-04-21 16:39 ` [PATCH 3/6] arm64: dts: meson: p230-q200: add initial audio playback support Jerome Brunet
@ 2020-04-21 16:39 ` Jerome Brunet
  2020-04-21 16:39 ` [PATCH 5/6] arm64: dts: meson: libretech-ac: " Jerome Brunet
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Jerome Brunet @ 2020-04-21 16:39 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: Jerome Brunet, linux-amlogic, devicetree, linux-kernel

Add initial audio support limited to HDMI i2s.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 .../amlogic/meson-gxl-s905x-libretech-cc.dts  | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
index e8348b2728db..4c9dded836e2 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts
@@ -8,6 +8,7 @@
 /dts-v1/;
 
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/sound/meson-aiu.h>
 
 #include "meson-gxl-s905x.dtsi"
 
@@ -124,6 +125,45 @@ vddio_boot: regulator-vddio_boot {
 		regulator-max-microvolt = <1800000>;
 		vin-supply = <&vcc_3v3>;
 	};
+
+	sound {
+		compatible = "amlogic,gx-sound-card";
+		model = "GXL-LIBRETECH-S905X-CC";
+		assigned-clocks = <&clkc CLKID_MPLL0>,
+				  <&clkc CLKID_MPLL1>,
+				  <&clkc CLKID_MPLL2>;
+		assigned-clock-parents = <0>, <0>, <0>;
+		assigned-clock-rates = <294912000>,
+				       <270950400>,
+				       <393216000>;
+		status = "okay";
+
+		dai-link-0 {
+			sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
+		};
+
+		dai-link-1 {
+			sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
+			dai-format = "i2s";
+			mclk-fs = <256>;
+
+			codec-0 {
+				sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
+			};
+		};
+
+		dai-link-2 {
+			sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
+
+			codec-0 {
+				sound-dai = <&hdmi_tx>;
+			};
+		};
+	};
+};
+
+&aiu {
+	status = "okay";
 };
 
 &cec_AO {
-- 
2.25.2


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

* [PATCH 5/6] arm64: dts: meson: libretech-ac: add initial audio playback support
  2020-04-21 16:39 [PATCH 0/6] arm64: dts: meson-gx: add initial playback support Jerome Brunet
                   ` (3 preceding siblings ...)
  2020-04-21 16:39 ` [PATCH 4/6] arm64: dts: meson: libretech-cc: " Jerome Brunet
@ 2020-04-21 16:39 ` Jerome Brunet
  2020-04-21 16:39 ` [PATCH 6/6] arm64: dts: meson: libretech-pc: " Jerome Brunet
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Jerome Brunet @ 2020-04-21 16:39 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: Jerome Brunet, linux-amlogic, devicetree, linux-kernel

Add initial audio support limited to HDMI i2s.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 .../amlogic/meson-gxl-s805x-libretech-ac.dts  | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts
index 4d5949496596..3f35331c1652 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts
@@ -8,6 +8,7 @@
 /dts-v1/;
 
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/sound/meson-aiu.h>
 
 #include "meson-gxl-s905x.dtsi"
 
@@ -105,6 +106,45 @@ vddio_boot: regulator-vddio_boot {
 		vin-supply = <&vcc_3v3>;
 		regulator-always-on;
 	};
+
+	sound {
+		compatible = "amlogic,gx-sound-card";
+		model = "GXL-LIBRETECH-S805X-AC";
+		assigned-clocks = <&clkc CLKID_MPLL0>,
+				  <&clkc CLKID_MPLL1>,
+				  <&clkc CLKID_MPLL2>;
+		assigned-clock-parents = <0>, <0>, <0>;
+		assigned-clock-rates = <294912000>,
+				       <270950400>,
+				       <393216000>;
+		status = "okay";
+
+		dai-link-0 {
+			sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
+		};
+
+		dai-link-1 {
+			sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
+			dai-format = "i2s";
+			mclk-fs = <256>;
+
+			codec-0 {
+				sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
+			};
+		};
+
+		dai-link-2 {
+			sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
+
+			codec-0 {
+				sound-dai = <&hdmi_tx>;
+			};
+		};
+	};
+};
+
+&aiu {
+	status = "okay";
 };
 
 &cec_AO {
-- 
2.25.2


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

* [PATCH 6/6] arm64: dts: meson: libretech-pc: add initial audio playback support
  2020-04-21 16:39 [PATCH 0/6] arm64: dts: meson-gx: add initial playback support Jerome Brunet
                   ` (4 preceding siblings ...)
  2020-04-21 16:39 ` [PATCH 5/6] arm64: dts: meson: libretech-ac: " Jerome Brunet
@ 2020-04-21 16:39 ` Jerome Brunet
  2020-04-30  1:54 ` [PATCH 0/6] arm64: dts: meson-gx: add initial " Christian Hewitt
  2020-04-30 14:54 ` Kevin Hilman
  7 siblings, 0 replies; 11+ messages in thread
From: Jerome Brunet @ 2020-04-21 16:39 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: Jerome Brunet, linux-amlogic, devicetree, linux-kernel

Add initial audio support limited to HDMI i2s.

Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
 .../dts/amlogic/meson-gx-libretech-pc.dtsi    | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gx-libretech-pc.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx-libretech-pc.dtsi
index 248b018c83d5..f1dec81d347b 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gx-libretech-pc.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gx-libretech-pc.dtsi
@@ -8,6 +8,7 @@
 
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/leds/common.h>
+#include <dt-bindings/sound/meson-aiu.h>
 
 / {
 	adc-keys {
@@ -175,6 +176,45 @@ vddio_card: regulator-vddio-card {
 		regulator-settling-time-up-us = <200>;
 		regulator-settling-time-down-us = <50000>;
 	};
+
+	sound {
+		compatible = "amlogic,gx-sound-card";
+		model = "GXL-LIBRETECH-S9XX-PC";
+		assigned-clocks = <&clkc CLKID_MPLL0>,
+				  <&clkc CLKID_MPLL1>,
+				  <&clkc CLKID_MPLL2>;
+		assigned-clock-parents = <0>, <0>, <0>;
+		assigned-clock-rates = <294912000>,
+				       <270950400>,
+				       <393216000>;
+		status = "okay";
+
+		dai-link-0 {
+			sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
+		};
+
+		dai-link-1 {
+			sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
+			dai-format = "i2s";
+			mclk-fs = <256>;
+
+			codec-0 {
+				sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
+			};
+		};
+
+		dai-link-2 {
+			sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
+
+			codec-0 {
+				sound-dai = <&hdmi_tx>;
+			};
+		};
+	};
+};
+
+&aiu {
+	status = "okay";
 };
 
 &cec_AO {
-- 
2.25.2


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

* Re: [PATCH 2/6] arm64: dts: meson-gx: add aiu support
  2020-04-21 16:39 ` [PATCH 2/6] arm64: dts: meson-gx: add aiu support Jerome Brunet
@ 2020-04-22 13:12   ` Neil Armstrong
  2020-04-22 14:38     ` Jerome Brunet
  0 siblings, 1 reply; 11+ messages in thread
From: Neil Armstrong @ 2020-04-22 13:12 UTC (permalink / raw)
  To: Jerome Brunet, Kevin Hilman; +Cc: linux-amlogic, devicetree, linux-kernel

On 21/04/2020 18:39, Jerome Brunet wrote:
> Add the AIU audio device to the Amlogic GX SoC family DT.
> ATM, this device provides the i2s and spdif output stages and also
> the hdmi and internal codec glues.
> 
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  arch/arm64/boot/dts/amlogic/meson-gx.dtsi   | 13 ++++++++++++
>  arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 23 +++++++++++++++++++++
>  arch/arm64/boot/dts/amlogic/meson-gxl.dtsi  | 23 +++++++++++++++++++++
>  3 files changed, 59 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
> index 03f79fe045b7..a8dc8f810253 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
> @@ -278,6 +278,17 @@ reset: reset-controller@4404 {
>  				#reset-cells = <1>;
>  			};
>  
> +			aiu: audio-controller@5400 {
> +				compatible = "amlogic,aiu";
> +				#sound-dai-cells = <2>;
> +				sound-name-prefix = "AIU";
> +				reg = <0x0 0x5400 0x0 0x2ac>;
> +				interrupts = <GIC_SPI 48 IRQ_TYPE_EDGE_RISING>,
> +					     <GIC_SPI 50 IRQ_TYPE_EDGE_RISING>;
> +				interrupt-names = "i2s", "spdif";
> +				status = "disabled";
> +			};
> +
>  			uart_A: serial@84c0 {
>  				compatible = "amlogic,meson-gx-uart";
>  				reg = <0x0 0x84c0 0x0 0x18>;
> @@ -626,6 +637,8 @@ hdmi_tx: hdmi-tx@c883a000 {
>  			interrupts = <GIC_SPI 57 IRQ_TYPE_EDGE_RISING>;
>  			#address-cells = <1>;
>  			#size-cells = <0>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "HDMITX";

sound-name-prefix is not a valid property in Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml

It should be added.

AFAIK sound-name-prefix is not present on g12-common, is it missing ?

Neil

>  			status = "disabled";
>  
>  			/* VPU VENC Input */
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
> index 0cb40326b0d3..234490d3ee68 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
> @@ -60,6 +60,29 @@ usb1: usb@c9100000 {
>  	};
>  };
>  
> +&aiu {
> +	compatible = "amlogic,aiu-gxbb", "amlogic,aiu";
> +	clocks = <&clkc CLKID_AIU_GLUE>,
> +		 <&clkc CLKID_I2S_OUT>,
> +		 <&clkc CLKID_AOCLK_GATE>,
> +		 <&clkc CLKID_CTS_AMCLK>,
> +		 <&clkc CLKID_MIXER_IFACE>,
> +		 <&clkc CLKID_IEC958>,
> +		 <&clkc CLKID_IEC958_GATE>,
> +		 <&clkc CLKID_CTS_MCLK_I958>,
> +		 <&clkc CLKID_CTS_I958>;
> +	clock-names = "pclk",
> +		      "i2s_pclk",
> +		      "i2s_aoclk",
> +		      "i2s_mclk",
> +		      "i2s_mixer",
> +		      "spdif_pclk",
> +		      "spdif_aoclk",
> +		      "spdif_mclk",
> +		      "spdif_mclk_sel";
> +	resets = <&reset RESET_AIU>;
> +};
> +
>  &aobus {
>  	pinctrl_aobus: pinctrl@14 {
>  		compatible = "amlogic,meson-gxbb-aobus-pinctrl";
> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
> index 259d86399390..d9f00c5a9a5c 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
> @@ -49,6 +49,29 @@ crypto: crypto@c883e000 {
>  	};
>  };
>  
> +&aiu {
> +	compatible = "amlogic,aiu-gxl", "amlogic,aiu";
> +	clocks = <&clkc CLKID_AIU_GLUE>,
> +		 <&clkc CLKID_I2S_OUT>,
> +		 <&clkc CLKID_AOCLK_GATE>,
> +		 <&clkc CLKID_CTS_AMCLK>,
> +		 <&clkc CLKID_MIXER_IFACE>,
> +		 <&clkc CLKID_IEC958>,
> +		 <&clkc CLKID_IEC958_GATE>,
> +		 <&clkc CLKID_CTS_MCLK_I958>,
> +		 <&clkc CLKID_CTS_I958>;
> +	clock-names = "pclk",
> +		      "i2s_pclk",
> +		      "i2s_aoclk",
> +		      "i2s_mclk",
> +		      "i2s_mixer",
> +		      "spdif_pclk",
> +		      "spdif_aoclk",
> +		      "spdif_mclk",
> +		      "spdif_mclk_sel";
> +	resets = <&reset RESET_AIU>;
> +};
> +
>  &apb {
>  	usb2_phy0: phy@78000 {
>  		compatible = "amlogic,meson-gxl-usb2-phy";
> 


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

* Re: [PATCH 2/6] arm64: dts: meson-gx: add aiu support
  2020-04-22 13:12   ` Neil Armstrong
@ 2020-04-22 14:38     ` Jerome Brunet
  0 siblings, 0 replies; 11+ messages in thread
From: Jerome Brunet @ 2020-04-22 14:38 UTC (permalink / raw)
  To: Neil Armstrong, Kevin Hilman; +Cc: linux-amlogic, devicetree, linux-kernel


On Wed 22 Apr 2020 at 15:12, Neil Armstrong <narmstrong@baylibre.com> wrote:

> On 21/04/2020 18:39, Jerome Brunet wrote:
>> Add the AIU audio device to the Amlogic GX SoC family DT.
>> ATM, this device provides the i2s and spdif output stages and also
>> the hdmi and internal codec glues.
>> 
>> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
>> ---
>>  arch/arm64/boot/dts/amlogic/meson-gx.dtsi   | 13 ++++++++++++
>>  arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 23 +++++++++++++++++++++
>>  arch/arm64/boot/dts/amlogic/meson-gxl.dtsi  | 23 +++++++++++++++++++++
>>  3 files changed, 59 insertions(+)
>> 
>> diff --git a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
>> index 03f79fe045b7..a8dc8f810253 100644
>> --- a/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
>> +++ b/arch/arm64/boot/dts/amlogic/meson-gx.dtsi
>> @@ -278,6 +278,17 @@ reset: reset-controller@4404 {
>>  				#reset-cells = <1>;
>>  			};
>>  
>> +			aiu: audio-controller@5400 {
>> +				compatible = "amlogic,aiu";
>> +				#sound-dai-cells = <2>;
>> +				sound-name-prefix = "AIU";
>> +				reg = <0x0 0x5400 0x0 0x2ac>;
>> +				interrupts = <GIC_SPI 48 IRQ_TYPE_EDGE_RISING>,
>> +					     <GIC_SPI 50 IRQ_TYPE_EDGE_RISING>;
>> +				interrupt-names = "i2s", "spdif";
>> +				status = "disabled";
>> +			};
>> +
>>  			uart_A: serial@84c0 {
>>  				compatible = "amlogic,meson-gx-uart";
>>  				reg = <0x0 0x84c0 0x0 0x18>;
>> @@ -626,6 +637,8 @@ hdmi_tx: hdmi-tx@c883a000 {
>>  			interrupts = <GIC_SPI 57 IRQ_TYPE_EDGE_RISING>;
>>  			#address-cells = <1>;
>>  			#size-cells = <0>;
>> +			#sound-dai-cells = <0>;
>> +			sound-name-prefix = "HDMITX";
>
> sound-name-prefix is not a valid property in Documentation/devicetree/bindings/display/amlogic,meson-dw-hdmi.yaml
>
> It should be added.

Not sure it should be explicitly added. It should be valid for any
device providing a sound-dai (sound-dai-cell)

>
> AFAIK sound-name-prefix is not present on g12-common, is it missing ?

It might not be strictly required, as long as there is no name colision
in the ASoC widget and Control, it is OK. IMHO, it is a good practice to
set one to avoid those colision.

>
> Neil
>
>>  			status = "disabled";
>>  
>>  			/* VPU VENC Input */
>> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
>> index 0cb40326b0d3..234490d3ee68 100644
>> --- a/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
>> +++ b/arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi
>> @@ -60,6 +60,29 @@ usb1: usb@c9100000 {
>>  	};
>>  };
>>  
>> +&aiu {
>> +	compatible = "amlogic,aiu-gxbb", "amlogic,aiu";
>> +	clocks = <&clkc CLKID_AIU_GLUE>,
>> +		 <&clkc CLKID_I2S_OUT>,
>> +		 <&clkc CLKID_AOCLK_GATE>,
>> +		 <&clkc CLKID_CTS_AMCLK>,
>> +		 <&clkc CLKID_MIXER_IFACE>,
>> +		 <&clkc CLKID_IEC958>,
>> +		 <&clkc CLKID_IEC958_GATE>,
>> +		 <&clkc CLKID_CTS_MCLK_I958>,
>> +		 <&clkc CLKID_CTS_I958>;
>> +	clock-names = "pclk",
>> +		      "i2s_pclk",
>> +		      "i2s_aoclk",
>> +		      "i2s_mclk",
>> +		      "i2s_mixer",
>> +		      "spdif_pclk",
>> +		      "spdif_aoclk",
>> +		      "spdif_mclk",
>> +		      "spdif_mclk_sel";
>> +	resets = <&reset RESET_AIU>;
>> +};
>> +
>>  &aobus {
>>  	pinctrl_aobus: pinctrl@14 {
>>  		compatible = "amlogic,meson-gxbb-aobus-pinctrl";
>> diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
>> index 259d86399390..d9f00c5a9a5c 100644
>> --- a/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
>> +++ b/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi
>> @@ -49,6 +49,29 @@ crypto: crypto@c883e000 {
>>  	};
>>  };
>>  
>> +&aiu {
>> +	compatible = "amlogic,aiu-gxl", "amlogic,aiu";
>> +	clocks = <&clkc CLKID_AIU_GLUE>,
>> +		 <&clkc CLKID_I2S_OUT>,
>> +		 <&clkc CLKID_AOCLK_GATE>,
>> +		 <&clkc CLKID_CTS_AMCLK>,
>> +		 <&clkc CLKID_MIXER_IFACE>,
>> +		 <&clkc CLKID_IEC958>,
>> +		 <&clkc CLKID_IEC958_GATE>,
>> +		 <&clkc CLKID_CTS_MCLK_I958>,
>> +		 <&clkc CLKID_CTS_I958>;
>> +	clock-names = "pclk",
>> +		      "i2s_pclk",
>> +		      "i2s_aoclk",
>> +		      "i2s_mclk",
>> +		      "i2s_mixer",
>> +		      "spdif_pclk",
>> +		      "spdif_aoclk",
>> +		      "spdif_mclk",
>> +		      "spdif_mclk_sel";
>> +	resets = <&reset RESET_AIU>;
>> +};
>> +
>>  &apb {
>>  	usb2_phy0: phy@78000 {
>>  		compatible = "amlogic,meson-gxl-usb2-phy";
>> 


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

* Re: [PATCH 0/6] arm64: dts: meson-gx: add initial playback support
  2020-04-21 16:39 [PATCH 0/6] arm64: dts: meson-gx: add initial playback support Jerome Brunet
                   ` (5 preceding siblings ...)
  2020-04-21 16:39 ` [PATCH 6/6] arm64: dts: meson: libretech-pc: " Jerome Brunet
@ 2020-04-30  1:54 ` Christian Hewitt
  2020-04-30 14:54 ` Kevin Hilman
  7 siblings, 0 replies; 11+ messages in thread
From: Christian Hewitt @ 2020-04-30  1:54 UTC (permalink / raw)
  To: Jerome Brunet; +Cc: Kevin Hilman, linux-amlogic, devicetree, linux-kernel


> On 21 Apr 2020, at 8:39 pm, Jerome Brunet <jbrunet@baylibre.com> wrote:
> 
> This patchset is adding the aiu support in DT and well as basic card
> support for the p230/q200 and libretech boards
> 
> I was hoping to provide the internal codec support with this series but
> this is still blocked on the reset dt-bindings of the DAC [0].
> 
> So far, things are fairly stable on these boards. I have experienced
> a few glitches on rare occasions. I have not been able to precisely found
> out why. It seems to be linked the AIU resets and 8ch support. Maybe more
> eyes (and ears) on this will help. If things get annoying and no solution
> is found, I'll submit a change to restrict the output to i2s 2ch.
> 
> [0]: https://lore.kernel.org/r/20200122092526.2436421-1-jbrunet@baylibre.com

I have a reproducible way to provoke one glitch using Kodi but we can talk
about that off-list. Overall the series (and changes in [0] above) work
well and it’s great to see progress.

Tested-by: Christian Hewitt <christianshewitt@gmail.com>

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

* Re: [PATCH 0/6] arm64: dts: meson-gx: add initial playback support
  2020-04-21 16:39 [PATCH 0/6] arm64: dts: meson-gx: add initial playback support Jerome Brunet
                   ` (6 preceding siblings ...)
  2020-04-30  1:54 ` [PATCH 0/6] arm64: dts: meson-gx: add initial " Christian Hewitt
@ 2020-04-30 14:54 ` Kevin Hilman
  7 siblings, 0 replies; 11+ messages in thread
From: Kevin Hilman @ 2020-04-30 14:54 UTC (permalink / raw)
  To: Jerome Brunet; +Cc: devicetree, linux-amlogic, linux-kernel

On Tue, 21 Apr 2020 18:39:29 +0200, Jerome Brunet wrote:
> This patchset is adding the aiu support in DT and well as basic card
> support for the p230/q200 and libretech boards
> 
> I was hoping to provide the internal codec support with this series but
> this is still blocked on the reset dt-bindings of the DAC [0].
> 
> So far, things are fairly stable on these boards. I have experienced
> a few glitches on rare occasions. I have not been able to precisely found
> out why. It seems to be linked the AIU resets and 8ch support. Maybe more
> eyes (and ears) on this will help. If things get annoying and no solution
> is found, I'll submit a change to restrict the output to i2s 2ch.
> 
> [...]

Queued for v5.8, thanks!

[1/6] arm64: defconfig: enable meson gx audio as module
      commit: cba26aef31ec791bc4d5ea13cb2c1288fcd95c0e
[2/6] arm64: dts: meson-gx: add aiu support
      commit: c531ca35ad54abcf6ceb35767ff25355557aa7ca
[3/6] arm64: dts: meson: p230-q200: add initial audio playback support
      commit: ace867239dd8059f2e92556895e7e13aea7b2e8a
[4/6] arm64: dts: meson: libretech-cc: add initial audio playback support
      commit: 9644eb9dc8bd1ac1112e267d771c6b492af1ff79
[5/6] arm64: dts: meson: libretech-ac: add initial audio playback support
      commit: 74c601fa46d109049472bb66adee88b3290b4bb8
[6/6] arm64: dts: meson: libretech-pc: add initial audio playback support
      commit: 1c75a81473153c211478e37152223aa585631b87

Best regards,
-- 
Kevin Hilman <khilman@baylibre.com>

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

end of thread, other threads:[~2020-04-30 14:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-21 16:39 [PATCH 0/6] arm64: dts: meson-gx: add initial playback support Jerome Brunet
2020-04-21 16:39 ` [PATCH 1/6] arm64: defconfig: enable meson gx audio as module Jerome Brunet
2020-04-21 16:39 ` [PATCH 2/6] arm64: dts: meson-gx: add aiu support Jerome Brunet
2020-04-22 13:12   ` Neil Armstrong
2020-04-22 14:38     ` Jerome Brunet
2020-04-21 16:39 ` [PATCH 3/6] arm64: dts: meson: p230-q200: add initial audio playback support Jerome Brunet
2020-04-21 16:39 ` [PATCH 4/6] arm64: dts: meson: libretech-cc: " Jerome Brunet
2020-04-21 16:39 ` [PATCH 5/6] arm64: dts: meson: libretech-ac: " Jerome Brunet
2020-04-21 16:39 ` [PATCH 6/6] arm64: dts: meson: libretech-pc: " Jerome Brunet
2020-04-30  1:54 ` [PATCH 0/6] arm64: dts: meson-gx: add initial " Christian Hewitt
2020-04-30 14:54 ` Kevin Hilman

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