All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Meson8/Meson8b: sound card support
@ 2021-07-17 23:30 ` Martin Blumenstingl
  0 siblings, 0 replies; 18+ messages in thread
From: Martin Blumenstingl @ 2021-07-17 23:30 UTC (permalink / raw)
  To: linux-amlogic
  Cc: narmstrong, khilman, linux-arm-kernel, linux-kernel, Martin Blumenstingl

This series adds the AIU audio controller for Meson8 and Meson8b. The
AIU audio controller has been found to work fine with out-of-tree
patches for HDMI audio (over I2S). SPDIF output also works (tested with
a scope).
Endless Mini (EC-100) has an RT5640 audio codec. The driver for this
codec can be selected since commit 08c56cab302a05 ("ASoC: rt5640: Make
codec selectable"), which is part of Linux 5.14-rc1. While support is
not perfect (due to us lacking proper support for configuring
GPIO_BSD_EN) audio output still works fine.

This series is based on my bugfix patch "ARM: dts: meson8: Use a
higher default GPU clock frequency" from [0]

Changes since v1 at [1]:
- added sound-name-prefix = "AIU"; to the first patch to make it
  identical to what we have in meson-gx.dtsi
- drop audio-routing property from the sound card in the second patch
  as it doesn't appear to be needed


[0] https://patchwork.kernel.org/project/linux-amlogic/patch/20210711214023.2163565-1-martin.blumenstingl@googlemail.com/
[1] https://patchwork.kernel.org/project/linux-amlogic/cover/20210713231103.2994354-1-martin.blumenstingl@googlemail.com/


Martin Blumenstingl (2):
  ARM: dts: meson: Add the AIU audio controller
  ARM: dts: meson8b: ec100: wire up the RT5640 audio codec

 arch/arm/boot/dts/meson.dtsi        | 12 ++++++
 arch/arm/boot/dts/meson8.dtsi       | 63 +++++++++++++++++++++++++++++
 arch/arm/boot/dts/meson8b-ec100.dts | 44 ++++++++++++++++++++
 arch/arm/boot/dts/meson8b.dtsi      | 63 +++++++++++++++++++++++++++++
 4 files changed, 182 insertions(+)

-- 
2.32.0


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

* [PATCH v2 0/2] Meson8/Meson8b: sound card support
@ 2021-07-17 23:30 ` Martin Blumenstingl
  0 siblings, 0 replies; 18+ messages in thread
From: Martin Blumenstingl @ 2021-07-17 23:30 UTC (permalink / raw)
  To: linux-amlogic
  Cc: narmstrong, khilman, linux-arm-kernel, linux-kernel, Martin Blumenstingl

This series adds the AIU audio controller for Meson8 and Meson8b. The
AIU audio controller has been found to work fine with out-of-tree
patches for HDMI audio (over I2S). SPDIF output also works (tested with
a scope).
Endless Mini (EC-100) has an RT5640 audio codec. The driver for this
codec can be selected since commit 08c56cab302a05 ("ASoC: rt5640: Make
codec selectable"), which is part of Linux 5.14-rc1. While support is
not perfect (due to us lacking proper support for configuring
GPIO_BSD_EN) audio output still works fine.

This series is based on my bugfix patch "ARM: dts: meson8: Use a
higher default GPU clock frequency" from [0]

Changes since v1 at [1]:
- added sound-name-prefix = "AIU"; to the first patch to make it
  identical to what we have in meson-gx.dtsi
- drop audio-routing property from the sound card in the second patch
  as it doesn't appear to be needed


[0] https://patchwork.kernel.org/project/linux-amlogic/patch/20210711214023.2163565-1-martin.blumenstingl@googlemail.com/
[1] https://patchwork.kernel.org/project/linux-amlogic/cover/20210713231103.2994354-1-martin.blumenstingl@googlemail.com/


Martin Blumenstingl (2):
  ARM: dts: meson: Add the AIU audio controller
  ARM: dts: meson8b: ec100: wire up the RT5640 audio codec

 arch/arm/boot/dts/meson.dtsi        | 12 ++++++
 arch/arm/boot/dts/meson8.dtsi       | 63 +++++++++++++++++++++++++++++
 arch/arm/boot/dts/meson8b-ec100.dts | 44 ++++++++++++++++++++
 arch/arm/boot/dts/meson8b.dtsi      | 63 +++++++++++++++++++++++++++++
 4 files changed, 182 insertions(+)

-- 
2.32.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 0/2] Meson8/Meson8b: sound card support
@ 2021-07-17 23:30 ` Martin Blumenstingl
  0 siblings, 0 replies; 18+ messages in thread
From: Martin Blumenstingl @ 2021-07-17 23:30 UTC (permalink / raw)
  To: linux-amlogic
  Cc: narmstrong, khilman, linux-arm-kernel, linux-kernel, Martin Blumenstingl

This series adds the AIU audio controller for Meson8 and Meson8b. The
AIU audio controller has been found to work fine with out-of-tree
patches for HDMI audio (over I2S). SPDIF output also works (tested with
a scope).
Endless Mini (EC-100) has an RT5640 audio codec. The driver for this
codec can be selected since commit 08c56cab302a05 ("ASoC: rt5640: Make
codec selectable"), which is part of Linux 5.14-rc1. While support is
not perfect (due to us lacking proper support for configuring
GPIO_BSD_EN) audio output still works fine.

This series is based on my bugfix patch "ARM: dts: meson8: Use a
higher default GPU clock frequency" from [0]

Changes since v1 at [1]:
- added sound-name-prefix = "AIU"; to the first patch to make it
  identical to what we have in meson-gx.dtsi
- drop audio-routing property from the sound card in the second patch
  as it doesn't appear to be needed


[0] https://patchwork.kernel.org/project/linux-amlogic/patch/20210711214023.2163565-1-martin.blumenstingl@googlemail.com/
[1] https://patchwork.kernel.org/project/linux-amlogic/cover/20210713231103.2994354-1-martin.blumenstingl@googlemail.com/


Martin Blumenstingl (2):
  ARM: dts: meson: Add the AIU audio controller
  ARM: dts: meson8b: ec100: wire up the RT5640 audio codec

 arch/arm/boot/dts/meson.dtsi        | 12 ++++++
 arch/arm/boot/dts/meson8.dtsi       | 63 +++++++++++++++++++++++++++++
 arch/arm/boot/dts/meson8b-ec100.dts | 44 ++++++++++++++++++++
 arch/arm/boot/dts/meson8b.dtsi      | 63 +++++++++++++++++++++++++++++
 4 files changed, 182 insertions(+)

-- 
2.32.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v2 1/2] ARM: dts: meson: Add the AIU audio controller
  2021-07-17 23:30 ` Martin Blumenstingl
  (?)
@ 2021-07-17 23:30   ` Martin Blumenstingl
  -1 siblings, 0 replies; 18+ messages in thread
From: Martin Blumenstingl @ 2021-07-17 23:30 UTC (permalink / raw)
  To: linux-amlogic
  Cc: narmstrong, khilman, linux-arm-kernel, linux-kernel, Martin Blumenstingl

Add the AIU audio controller to the Amlogic Meson6/8/8b/8m2 SoC DT. This
provides I2S and SPDIF outputs as well as codec glues for the internal
HDMI controller.
Also add the clock inputs and pin mux definitions on Meson8/8b/8m2. On
Meson6 this is omitted because we neither have a clock nor pin
controller node there yet.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 arch/arm/boot/dts/meson.dtsi   | 12 +++++++
 arch/arm/boot/dts/meson8.dtsi  | 63 ++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/meson8b.dtsi | 63 ++++++++++++++++++++++++++++++++++
 3 files changed, 138 insertions(+)

diff --git a/arch/arm/boot/dts/meson.dtsi b/arch/arm/boot/dts/meson.dtsi
index bd0e864964e9..3be7cba603d5 100644
--- a/arch/arm/boot/dts/meson.dtsi
+++ b/arch/arm/boot/dts/meson.dtsi
@@ -5,6 +5,7 @@
 
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/sound/meson-aiu.h>
 
 / {
 	#address-cells = <1>;
@@ -36,6 +37,17 @@ hhi: system-controller@4000 {
 				reg = <0x4000 0x400>;
 			};
 
+			aiu: audio-controller@5400 {
+				compatible = "amlogic,aiu";
+				#sound-dai-cells = <2>;
+				sound-name-prefix = "AIU";
+				reg = <0x5400 0x2ac>;
+				interrupts = <GIC_SPI 48 IRQ_TYPE_EDGE_RISING>,
+					     <GIC_SPI 50 IRQ_TYPE_EDGE_RISING>;
+				interrupt-names = "i2s", "spdif";
+				status = "disabled";
+			};
+
 			assist: assist@7c00 {
 				compatible = "amlogic,meson-mx-assist", "syscon";
 				reg = <0x7c00 0x200>;
diff --git a/arch/arm/boot/dts/meson8.dtsi b/arch/arm/boot/dts/meson8.dtsi
index 686c7b7c79d5..f80ddc98d3a2 100644
--- a/arch/arm/boot/dts/meson8.dtsi
+++ b/arch/arm/boot/dts/meson8.dtsi
@@ -317,6 +317,29 @@ mali: gpu@c0000 {
 	};
 }; /* end of / */
 
+&aiu {
+	compatible = "amlogic,aiu-meson8", "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 {
 	pmu: pmu@e0 {
 		compatible = "amlogic,meson8-pmu", "syscon";
@@ -340,6 +363,38 @@ gpio_ao: ao-bank@14 {
 			gpio-ranges = <&pinctrl_aobus 0 0 16>;
 		};
 
+		i2s_am_clk_pins: i2s-am-clk-out {
+			mux {
+				groups = "i2s_am_clk_out_ao";
+				function = "i2s_ao";
+				bias-disable;
+			};
+		};
+
+		i2s_out_ao_clk_pins: i2s-ao-clk-out {
+			mux {
+				groups = "i2s_ao_clk_out_ao";
+				function = "i2s_ao";
+				bias-disable;
+			};
+		};
+
+		i2s_out_lr_clk_pins: i2s-lr-clk-out {
+			mux {
+				groups = "i2s_lr_clk_out_ao";
+				function = "i2s_ao";
+				bias-disable;
+			};
+		};
+
+		i2s_out_ch01_ao_pins: i2s-out-ch01 {
+			mux {
+				groups = "i2s_out_ch01_ao";
+				function = "i2s_ao";
+				bias-disable;
+			};
+		};
+
 		uart_ao_a_pins: uart_ao_a {
 			mux {
 				groups = "uart_tx_ao_a", "uart_rx_ao_a";
@@ -460,6 +515,14 @@ mux {
 			};
 		};
 
+		spdif_out_pins: spdif-out {
+			mux {
+				groups = "spdif_out";
+				function = "spdif";
+				bias-disable;
+			};
+		};
+
 		spi_nor_pins: nor {
 			mux {
 				groups = "nor_d", "nor_q", "nor_c", "nor_cs";
diff --git a/arch/arm/boot/dts/meson8b.dtsi b/arch/arm/boot/dts/meson8b.dtsi
index c02b03cbcdf4..b49b7cbaed4e 100644
--- a/arch/arm/boot/dts/meson8b.dtsi
+++ b/arch/arm/boot/dts/meson8b.dtsi
@@ -279,6 +279,29 @@ mali: gpu@c0000 {
 	};
 }; /* end of / */
 
+&aiu {
+	compatible = "amlogic,aiu-meson8b", "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 {
 	pmu: pmu@e0 {
 		compatible = "amlogic,meson8b-pmu", "syscon";
@@ -302,6 +325,46 @@ gpio_ao: ao-bank@14 {
 			gpio-ranges = <&pinctrl_aobus 0 0 16>;
 		};
 
+		i2s_am_clk_pins: i2s-am-clk-out {
+			mux {
+				groups = "i2s_am_clk_out";
+				function = "i2s";
+				bias-disable;
+			};
+		};
+
+		i2s_out_ao_clk_pins: i2s-ao-clk-out {
+			mux {
+				groups = "i2s_ao_clk_out";
+				function = "i2s";
+				bias-disable;
+			};
+		};
+
+		i2s_out_lr_clk_pins: i2s-lr-clk-out {
+			mux {
+				groups = "i2s_lr_clk_out";
+				function = "i2s";
+				bias-disable;
+			};
+		};
+
+		i2s_out_ch01_ao_pins: i2s-out-ch01 {
+			mux {
+				groups = "i2s_out_01";
+				function = "i2s";
+				bias-disable;
+			};
+		};
+
+		spdif_out_1_pins: spdif-out-1 {
+			mux {
+				groups = "spdif_out_1";
+				function = "spdif_1";
+				bias-disable;
+			};
+		};
+
 		uart_ao_a_pins: uart_ao_a {
 			mux {
 				groups = "uart_tx_ao_a", "uart_rx_ao_a";
-- 
2.32.0


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

* [PATCH v2 1/2] ARM: dts: meson: Add the AIU audio controller
@ 2021-07-17 23:30   ` Martin Blumenstingl
  0 siblings, 0 replies; 18+ messages in thread
From: Martin Blumenstingl @ 2021-07-17 23:30 UTC (permalink / raw)
  To: linux-amlogic
  Cc: narmstrong, khilman, linux-arm-kernel, linux-kernel, Martin Blumenstingl

Add the AIU audio controller to the Amlogic Meson6/8/8b/8m2 SoC DT. This
provides I2S and SPDIF outputs as well as codec glues for the internal
HDMI controller.
Also add the clock inputs and pin mux definitions on Meson8/8b/8m2. On
Meson6 this is omitted because we neither have a clock nor pin
controller node there yet.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 arch/arm/boot/dts/meson.dtsi   | 12 +++++++
 arch/arm/boot/dts/meson8.dtsi  | 63 ++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/meson8b.dtsi | 63 ++++++++++++++++++++++++++++++++++
 3 files changed, 138 insertions(+)

diff --git a/arch/arm/boot/dts/meson.dtsi b/arch/arm/boot/dts/meson.dtsi
index bd0e864964e9..3be7cba603d5 100644
--- a/arch/arm/boot/dts/meson.dtsi
+++ b/arch/arm/boot/dts/meson.dtsi
@@ -5,6 +5,7 @@
 
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/sound/meson-aiu.h>
 
 / {
 	#address-cells = <1>;
@@ -36,6 +37,17 @@ hhi: system-controller@4000 {
 				reg = <0x4000 0x400>;
 			};
 
+			aiu: audio-controller@5400 {
+				compatible = "amlogic,aiu";
+				#sound-dai-cells = <2>;
+				sound-name-prefix = "AIU";
+				reg = <0x5400 0x2ac>;
+				interrupts = <GIC_SPI 48 IRQ_TYPE_EDGE_RISING>,
+					     <GIC_SPI 50 IRQ_TYPE_EDGE_RISING>;
+				interrupt-names = "i2s", "spdif";
+				status = "disabled";
+			};
+
 			assist: assist@7c00 {
 				compatible = "amlogic,meson-mx-assist", "syscon";
 				reg = <0x7c00 0x200>;
diff --git a/arch/arm/boot/dts/meson8.dtsi b/arch/arm/boot/dts/meson8.dtsi
index 686c7b7c79d5..f80ddc98d3a2 100644
--- a/arch/arm/boot/dts/meson8.dtsi
+++ b/arch/arm/boot/dts/meson8.dtsi
@@ -317,6 +317,29 @@ mali: gpu@c0000 {
 	};
 }; /* end of / */
 
+&aiu {
+	compatible = "amlogic,aiu-meson8", "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 {
 	pmu: pmu@e0 {
 		compatible = "amlogic,meson8-pmu", "syscon";
@@ -340,6 +363,38 @@ gpio_ao: ao-bank@14 {
 			gpio-ranges = <&pinctrl_aobus 0 0 16>;
 		};
 
+		i2s_am_clk_pins: i2s-am-clk-out {
+			mux {
+				groups = "i2s_am_clk_out_ao";
+				function = "i2s_ao";
+				bias-disable;
+			};
+		};
+
+		i2s_out_ao_clk_pins: i2s-ao-clk-out {
+			mux {
+				groups = "i2s_ao_clk_out_ao";
+				function = "i2s_ao";
+				bias-disable;
+			};
+		};
+
+		i2s_out_lr_clk_pins: i2s-lr-clk-out {
+			mux {
+				groups = "i2s_lr_clk_out_ao";
+				function = "i2s_ao";
+				bias-disable;
+			};
+		};
+
+		i2s_out_ch01_ao_pins: i2s-out-ch01 {
+			mux {
+				groups = "i2s_out_ch01_ao";
+				function = "i2s_ao";
+				bias-disable;
+			};
+		};
+
 		uart_ao_a_pins: uart_ao_a {
 			mux {
 				groups = "uart_tx_ao_a", "uart_rx_ao_a";
@@ -460,6 +515,14 @@ mux {
 			};
 		};
 
+		spdif_out_pins: spdif-out {
+			mux {
+				groups = "spdif_out";
+				function = "spdif";
+				bias-disable;
+			};
+		};
+
 		spi_nor_pins: nor {
 			mux {
 				groups = "nor_d", "nor_q", "nor_c", "nor_cs";
diff --git a/arch/arm/boot/dts/meson8b.dtsi b/arch/arm/boot/dts/meson8b.dtsi
index c02b03cbcdf4..b49b7cbaed4e 100644
--- a/arch/arm/boot/dts/meson8b.dtsi
+++ b/arch/arm/boot/dts/meson8b.dtsi
@@ -279,6 +279,29 @@ mali: gpu@c0000 {
 	};
 }; /* end of / */
 
+&aiu {
+	compatible = "amlogic,aiu-meson8b", "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 {
 	pmu: pmu@e0 {
 		compatible = "amlogic,meson8b-pmu", "syscon";
@@ -302,6 +325,46 @@ gpio_ao: ao-bank@14 {
 			gpio-ranges = <&pinctrl_aobus 0 0 16>;
 		};
 
+		i2s_am_clk_pins: i2s-am-clk-out {
+			mux {
+				groups = "i2s_am_clk_out";
+				function = "i2s";
+				bias-disable;
+			};
+		};
+
+		i2s_out_ao_clk_pins: i2s-ao-clk-out {
+			mux {
+				groups = "i2s_ao_clk_out";
+				function = "i2s";
+				bias-disable;
+			};
+		};
+
+		i2s_out_lr_clk_pins: i2s-lr-clk-out {
+			mux {
+				groups = "i2s_lr_clk_out";
+				function = "i2s";
+				bias-disable;
+			};
+		};
+
+		i2s_out_ch01_ao_pins: i2s-out-ch01 {
+			mux {
+				groups = "i2s_out_01";
+				function = "i2s";
+				bias-disable;
+			};
+		};
+
+		spdif_out_1_pins: spdif-out-1 {
+			mux {
+				groups = "spdif_out_1";
+				function = "spdif_1";
+				bias-disable;
+			};
+		};
+
 		uart_ao_a_pins: uart_ao_a {
 			mux {
 				groups = "uart_tx_ao_a", "uart_rx_ao_a";
-- 
2.32.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 1/2] ARM: dts: meson: Add the AIU audio controller
@ 2021-07-17 23:30   ` Martin Blumenstingl
  0 siblings, 0 replies; 18+ messages in thread
From: Martin Blumenstingl @ 2021-07-17 23:30 UTC (permalink / raw)
  To: linux-amlogic
  Cc: narmstrong, khilman, linux-arm-kernel, linux-kernel, Martin Blumenstingl

Add the AIU audio controller to the Amlogic Meson6/8/8b/8m2 SoC DT. This
provides I2S and SPDIF outputs as well as codec glues for the internal
HDMI controller.
Also add the clock inputs and pin mux definitions on Meson8/8b/8m2. On
Meson6 this is omitted because we neither have a clock nor pin
controller node there yet.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 arch/arm/boot/dts/meson.dtsi   | 12 +++++++
 arch/arm/boot/dts/meson8.dtsi  | 63 ++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/meson8b.dtsi | 63 ++++++++++++++++++++++++++++++++++
 3 files changed, 138 insertions(+)

diff --git a/arch/arm/boot/dts/meson.dtsi b/arch/arm/boot/dts/meson.dtsi
index bd0e864964e9..3be7cba603d5 100644
--- a/arch/arm/boot/dts/meson.dtsi
+++ b/arch/arm/boot/dts/meson.dtsi
@@ -5,6 +5,7 @@
 
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/sound/meson-aiu.h>
 
 / {
 	#address-cells = <1>;
@@ -36,6 +37,17 @@ hhi: system-controller@4000 {
 				reg = <0x4000 0x400>;
 			};
 
+			aiu: audio-controller@5400 {
+				compatible = "amlogic,aiu";
+				#sound-dai-cells = <2>;
+				sound-name-prefix = "AIU";
+				reg = <0x5400 0x2ac>;
+				interrupts = <GIC_SPI 48 IRQ_TYPE_EDGE_RISING>,
+					     <GIC_SPI 50 IRQ_TYPE_EDGE_RISING>;
+				interrupt-names = "i2s", "spdif";
+				status = "disabled";
+			};
+
 			assist: assist@7c00 {
 				compatible = "amlogic,meson-mx-assist", "syscon";
 				reg = <0x7c00 0x200>;
diff --git a/arch/arm/boot/dts/meson8.dtsi b/arch/arm/boot/dts/meson8.dtsi
index 686c7b7c79d5..f80ddc98d3a2 100644
--- a/arch/arm/boot/dts/meson8.dtsi
+++ b/arch/arm/boot/dts/meson8.dtsi
@@ -317,6 +317,29 @@ mali: gpu@c0000 {
 	};
 }; /* end of / */
 
+&aiu {
+	compatible = "amlogic,aiu-meson8", "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 {
 	pmu: pmu@e0 {
 		compatible = "amlogic,meson8-pmu", "syscon";
@@ -340,6 +363,38 @@ gpio_ao: ao-bank@14 {
 			gpio-ranges = <&pinctrl_aobus 0 0 16>;
 		};
 
+		i2s_am_clk_pins: i2s-am-clk-out {
+			mux {
+				groups = "i2s_am_clk_out_ao";
+				function = "i2s_ao";
+				bias-disable;
+			};
+		};
+
+		i2s_out_ao_clk_pins: i2s-ao-clk-out {
+			mux {
+				groups = "i2s_ao_clk_out_ao";
+				function = "i2s_ao";
+				bias-disable;
+			};
+		};
+
+		i2s_out_lr_clk_pins: i2s-lr-clk-out {
+			mux {
+				groups = "i2s_lr_clk_out_ao";
+				function = "i2s_ao";
+				bias-disable;
+			};
+		};
+
+		i2s_out_ch01_ao_pins: i2s-out-ch01 {
+			mux {
+				groups = "i2s_out_ch01_ao";
+				function = "i2s_ao";
+				bias-disable;
+			};
+		};
+
 		uart_ao_a_pins: uart_ao_a {
 			mux {
 				groups = "uart_tx_ao_a", "uart_rx_ao_a";
@@ -460,6 +515,14 @@ mux {
 			};
 		};
 
+		spdif_out_pins: spdif-out {
+			mux {
+				groups = "spdif_out";
+				function = "spdif";
+				bias-disable;
+			};
+		};
+
 		spi_nor_pins: nor {
 			mux {
 				groups = "nor_d", "nor_q", "nor_c", "nor_cs";
diff --git a/arch/arm/boot/dts/meson8b.dtsi b/arch/arm/boot/dts/meson8b.dtsi
index c02b03cbcdf4..b49b7cbaed4e 100644
--- a/arch/arm/boot/dts/meson8b.dtsi
+++ b/arch/arm/boot/dts/meson8b.dtsi
@@ -279,6 +279,29 @@ mali: gpu@c0000 {
 	};
 }; /* end of / */
 
+&aiu {
+	compatible = "amlogic,aiu-meson8b", "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 {
 	pmu: pmu@e0 {
 		compatible = "amlogic,meson8b-pmu", "syscon";
@@ -302,6 +325,46 @@ gpio_ao: ao-bank@14 {
 			gpio-ranges = <&pinctrl_aobus 0 0 16>;
 		};
 
+		i2s_am_clk_pins: i2s-am-clk-out {
+			mux {
+				groups = "i2s_am_clk_out";
+				function = "i2s";
+				bias-disable;
+			};
+		};
+
+		i2s_out_ao_clk_pins: i2s-ao-clk-out {
+			mux {
+				groups = "i2s_ao_clk_out";
+				function = "i2s";
+				bias-disable;
+			};
+		};
+
+		i2s_out_lr_clk_pins: i2s-lr-clk-out {
+			mux {
+				groups = "i2s_lr_clk_out";
+				function = "i2s";
+				bias-disable;
+			};
+		};
+
+		i2s_out_ch01_ao_pins: i2s-out-ch01 {
+			mux {
+				groups = "i2s_out_01";
+				function = "i2s";
+				bias-disable;
+			};
+		};
+
+		spdif_out_1_pins: spdif-out-1 {
+			mux {
+				groups = "spdif_out_1";
+				function = "spdif_1";
+				bias-disable;
+			};
+		};
+
 		uart_ao_a_pins: uart_ao_a {
 			mux {
 				groups = "uart_tx_ao_a", "uart_rx_ao_a";
-- 
2.32.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v2 2/2] ARM: dts: meson8b: ec100: wire up the RT5640 audio codec
  2021-07-17 23:30 ` Martin Blumenstingl
  (?)
@ 2021-07-17 23:30   ` Martin Blumenstingl
  -1 siblings, 0 replies; 18+ messages in thread
From: Martin Blumenstingl @ 2021-07-17 23:30 UTC (permalink / raw)
  To: linux-amlogic
  Cc: narmstrong, khilman, linux-arm-kernel, linux-kernel, Martin Blumenstingl

The Realtek RT5640 codec is connected to the SoC's I2S interface.
Describe this in the .dts together with the codec's LDO1 enable GPIO so
audio can be played on the Endless Mini.
While here, add a note about the realtek,ldo1-en-gpios for which the
EC100 uses GPIO_BSD_EN. Due to driver limitations this pin cannot be
used currently.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 arch/arm/boot/dts/meson8b-ec100.dts | 44 +++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/arch/arm/boot/dts/meson8b-ec100.dts b/arch/arm/boot/dts/meson8b-ec100.dts
index 8e48ccc6b634..e404bdccdab9 100644
--- a/arch/arm/boot/dts/meson8b-ec100.dts
+++ b/arch/arm/boot/dts/meson8b-ec100.dts
@@ -96,6 +96,32 @@ rtc32k_xtal: rtc32k-xtal-clk {
 		#clock-cells = <0>;
 	};
 
+	sound {
+		compatible = "amlogic,gx-sound-card";
+		model = "M8B-EC100";
+
+		assigned-clocks = <&clkc CLKID_MPLL0>,
+				  <&clkc CLKID_MPLL1>,
+				  <&clkc CLKID_MPLL2>;
+		assigned-clock-rates = <270950400>,
+				       <294912000>,
+				       <393216000>;
+
+		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 = <&rt5640>;
+			};
+		};
+	};
+
 	usb_vbus: regulator-usb-vbus {
 		/*
 		 * Silergy SY6288CCAC-GP 2A Power Distribution Switch.
@@ -242,6 +268,14 @@ vddee: regulator-vddee {
 	};
 };
 
+&aiu {
+	status = "okay";
+
+	pinctrl-0 = <&i2s_am_clk_pins>, <&i2s_out_ao_clk_pins>,
+		    <&i2s_out_lr_clk_pins>, <&i2s_out_ch01_ao_pins>;
+	pinctrl-names = "default";
+};
+
 &cpu0 {
 	cpu-supply = <&vcck>;
 };
@@ -283,9 +317,19 @@ &i2c_A {
 
 	rt5640: codec@1c {
 		compatible = "realtek,rt5640";
+
 		reg = <0x1c>;
+
+		#sound-dai-cells = <0>;
+
 		interrupt-parent = <&gpio_intc>;
 		interrupts = <13 IRQ_TYPE_EDGE_BOTH>; /* GPIOAO_13 */
+
+		/*
+		 * TODO: realtek,ldo1-en-gpios is connected to GPIO_BSD_EN.
+		 * We currently cannot configure this pin correctly.
+		 * Luckily for us it's in the "right" state by default.
+		 */
 		realtek,in1-differential;
 	};
 };
-- 
2.32.0


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

* [PATCH v2 2/2] ARM: dts: meson8b: ec100: wire up the RT5640 audio codec
@ 2021-07-17 23:30   ` Martin Blumenstingl
  0 siblings, 0 replies; 18+ messages in thread
From: Martin Blumenstingl @ 2021-07-17 23:30 UTC (permalink / raw)
  To: linux-amlogic
  Cc: narmstrong, khilman, linux-arm-kernel, linux-kernel, Martin Blumenstingl

The Realtek RT5640 codec is connected to the SoC's I2S interface.
Describe this in the .dts together with the codec's LDO1 enable GPIO so
audio can be played on the Endless Mini.
While here, add a note about the realtek,ldo1-en-gpios for which the
EC100 uses GPIO_BSD_EN. Due to driver limitations this pin cannot be
used currently.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 arch/arm/boot/dts/meson8b-ec100.dts | 44 +++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/arch/arm/boot/dts/meson8b-ec100.dts b/arch/arm/boot/dts/meson8b-ec100.dts
index 8e48ccc6b634..e404bdccdab9 100644
--- a/arch/arm/boot/dts/meson8b-ec100.dts
+++ b/arch/arm/boot/dts/meson8b-ec100.dts
@@ -96,6 +96,32 @@ rtc32k_xtal: rtc32k-xtal-clk {
 		#clock-cells = <0>;
 	};
 
+	sound {
+		compatible = "amlogic,gx-sound-card";
+		model = "M8B-EC100";
+
+		assigned-clocks = <&clkc CLKID_MPLL0>,
+				  <&clkc CLKID_MPLL1>,
+				  <&clkc CLKID_MPLL2>;
+		assigned-clock-rates = <270950400>,
+				       <294912000>,
+				       <393216000>;
+
+		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 = <&rt5640>;
+			};
+		};
+	};
+
 	usb_vbus: regulator-usb-vbus {
 		/*
 		 * Silergy SY6288CCAC-GP 2A Power Distribution Switch.
@@ -242,6 +268,14 @@ vddee: regulator-vddee {
 	};
 };
 
+&aiu {
+	status = "okay";
+
+	pinctrl-0 = <&i2s_am_clk_pins>, <&i2s_out_ao_clk_pins>,
+		    <&i2s_out_lr_clk_pins>, <&i2s_out_ch01_ao_pins>;
+	pinctrl-names = "default";
+};
+
 &cpu0 {
 	cpu-supply = <&vcck>;
 };
@@ -283,9 +317,19 @@ &i2c_A {
 
 	rt5640: codec@1c {
 		compatible = "realtek,rt5640";
+
 		reg = <0x1c>;
+
+		#sound-dai-cells = <0>;
+
 		interrupt-parent = <&gpio_intc>;
 		interrupts = <13 IRQ_TYPE_EDGE_BOTH>; /* GPIOAO_13 */
+
+		/*
+		 * TODO: realtek,ldo1-en-gpios is connected to GPIO_BSD_EN.
+		 * We currently cannot configure this pin correctly.
+		 * Luckily for us it's in the "right" state by default.
+		 */
 		realtek,in1-differential;
 	};
 };
-- 
2.32.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 2/2] ARM: dts: meson8b: ec100: wire up the RT5640 audio codec
@ 2021-07-17 23:30   ` Martin Blumenstingl
  0 siblings, 0 replies; 18+ messages in thread
From: Martin Blumenstingl @ 2021-07-17 23:30 UTC (permalink / raw)
  To: linux-amlogic
  Cc: narmstrong, khilman, linux-arm-kernel, linux-kernel, Martin Blumenstingl

The Realtek RT5640 codec is connected to the SoC's I2S interface.
Describe this in the .dts together with the codec's LDO1 enable GPIO so
audio can be played on the Endless Mini.
While here, add a note about the realtek,ldo1-en-gpios for which the
EC100 uses GPIO_BSD_EN. Due to driver limitations this pin cannot be
used currently.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 arch/arm/boot/dts/meson8b-ec100.dts | 44 +++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/arch/arm/boot/dts/meson8b-ec100.dts b/arch/arm/boot/dts/meson8b-ec100.dts
index 8e48ccc6b634..e404bdccdab9 100644
--- a/arch/arm/boot/dts/meson8b-ec100.dts
+++ b/arch/arm/boot/dts/meson8b-ec100.dts
@@ -96,6 +96,32 @@ rtc32k_xtal: rtc32k-xtal-clk {
 		#clock-cells = <0>;
 	};
 
+	sound {
+		compatible = "amlogic,gx-sound-card";
+		model = "M8B-EC100";
+
+		assigned-clocks = <&clkc CLKID_MPLL0>,
+				  <&clkc CLKID_MPLL1>,
+				  <&clkc CLKID_MPLL2>;
+		assigned-clock-rates = <270950400>,
+				       <294912000>,
+				       <393216000>;
+
+		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 = <&rt5640>;
+			};
+		};
+	};
+
 	usb_vbus: regulator-usb-vbus {
 		/*
 		 * Silergy SY6288CCAC-GP 2A Power Distribution Switch.
@@ -242,6 +268,14 @@ vddee: regulator-vddee {
 	};
 };
 
+&aiu {
+	status = "okay";
+
+	pinctrl-0 = <&i2s_am_clk_pins>, <&i2s_out_ao_clk_pins>,
+		    <&i2s_out_lr_clk_pins>, <&i2s_out_ch01_ao_pins>;
+	pinctrl-names = "default";
+};
+
 &cpu0 {
 	cpu-supply = <&vcck>;
 };
@@ -283,9 +317,19 @@ &i2c_A {
 
 	rt5640: codec@1c {
 		compatible = "realtek,rt5640";
+
 		reg = <0x1c>;
+
+		#sound-dai-cells = <0>;
+
 		interrupt-parent = <&gpio_intc>;
 		interrupts = <13 IRQ_TYPE_EDGE_BOTH>; /* GPIOAO_13 */
+
+		/*
+		 * TODO: realtek,ldo1-en-gpios is connected to GPIO_BSD_EN.
+		 * We currently cannot configure this pin correctly.
+		 * Luckily for us it's in the "right" state by default.
+		 */
 		realtek,in1-differential;
 	};
 };
-- 
2.32.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v2 1/2] ARM: dts: meson: Add the AIU audio controller
  2021-07-17 23:30   ` Martin Blumenstingl
  (?)
@ 2021-07-26  8:00     ` Neil Armstrong
  -1 siblings, 0 replies; 18+ messages in thread
From: Neil Armstrong @ 2021-07-26  8:00 UTC (permalink / raw)
  To: Martin Blumenstingl, linux-amlogic
  Cc: khilman, linux-arm-kernel, linux-kernel

On 18/07/2021 01:30, Martin Blumenstingl wrote:
> Add the AIU audio controller to the Amlogic Meson6/8/8b/8m2 SoC DT. This
> provides I2S and SPDIF outputs as well as codec glues for the internal
> HDMI controller.
> Also add the clock inputs and pin mux definitions on Meson8/8b/8m2. On
> Meson6 this is omitted because we neither have a clock nor pin
> controller node there yet.
> 
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>  arch/arm/boot/dts/meson.dtsi   | 12 +++++++
>  arch/arm/boot/dts/meson8.dtsi  | 63 ++++++++++++++++++++++++++++++++++
>  arch/arm/boot/dts/meson8b.dtsi | 63 ++++++++++++++++++++++++++++++++++
>  3 files changed, 138 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/meson.dtsi b/arch/arm/boot/dts/meson.dtsi
> index bd0e864964e9..3be7cba603d5 100644
> --- a/arch/arm/boot/dts/meson.dtsi
> +++ b/arch/arm/boot/dts/meson.dtsi
> @@ -5,6 +5,7 @@
>  
>  #include <dt-bindings/interrupt-controller/irq.h>
>  #include <dt-bindings/interrupt-controller/arm-gic.h>
> +#include <dt-bindings/sound/meson-aiu.h>
>  
>  / {
>  	#address-cells = <1>;
> @@ -36,6 +37,17 @@ hhi: system-controller@4000 {
>  				reg = <0x4000 0x400>;
>  			};
>  
> +			aiu: audio-controller@5400 {
> +				compatible = "amlogic,aiu";
> +				#sound-dai-cells = <2>;
> +				sound-name-prefix = "AIU";
> +				reg = <0x5400 0x2ac>;
> +				interrupts = <GIC_SPI 48 IRQ_TYPE_EDGE_RISING>,
> +					     <GIC_SPI 50 IRQ_TYPE_EDGE_RISING>;
> +				interrupt-names = "i2s", "spdif";
> +				status = "disabled";
> +			};
> +
>  			assist: assist@7c00 {
>  				compatible = "amlogic,meson-mx-assist", "syscon";
>  				reg = <0x7c00 0x200>;
> diff --git a/arch/arm/boot/dts/meson8.dtsi b/arch/arm/boot/dts/meson8.dtsi
> index 686c7b7c79d5..f80ddc98d3a2 100644
> --- a/arch/arm/boot/dts/meson8.dtsi
> +++ b/arch/arm/boot/dts/meson8.dtsi
> @@ -317,6 +317,29 @@ mali: gpu@c0000 {
>  	};
>  }; /* end of / */
>  
> +&aiu {
> +	compatible = "amlogic,aiu-meson8", "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 {
>  	pmu: pmu@e0 {
>  		compatible = "amlogic,meson8-pmu", "syscon";
> @@ -340,6 +363,38 @@ gpio_ao: ao-bank@14 {
>  			gpio-ranges = <&pinctrl_aobus 0 0 16>;
>  		};
>  
> +		i2s_am_clk_pins: i2s-am-clk-out {
> +			mux {
> +				groups = "i2s_am_clk_out_ao";
> +				function = "i2s_ao";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_ao_clk_pins: i2s-ao-clk-out {
> +			mux {
> +				groups = "i2s_ao_clk_out_ao";
> +				function = "i2s_ao";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_lr_clk_pins: i2s-lr-clk-out {
> +			mux {
> +				groups = "i2s_lr_clk_out_ao";
> +				function = "i2s_ao";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_ch01_ao_pins: i2s-out-ch01 {
> +			mux {
> +				groups = "i2s_out_ch01_ao";
> +				function = "i2s_ao";
> +				bias-disable;
> +			};
> +		};
> +
>  		uart_ao_a_pins: uart_ao_a {
>  			mux {
>  				groups = "uart_tx_ao_a", "uart_rx_ao_a";
> @@ -460,6 +515,14 @@ mux {
>  			};
>  		};
>  
> +		spdif_out_pins: spdif-out {
> +			mux {
> +				groups = "spdif_out";
> +				function = "spdif";
> +				bias-disable;
> +			};
> +		};
> +
>  		spi_nor_pins: nor {
>  			mux {
>  				groups = "nor_d", "nor_q", "nor_c", "nor_cs";
> diff --git a/arch/arm/boot/dts/meson8b.dtsi b/arch/arm/boot/dts/meson8b.dtsi
> index c02b03cbcdf4..b49b7cbaed4e 100644
> --- a/arch/arm/boot/dts/meson8b.dtsi
> +++ b/arch/arm/boot/dts/meson8b.dtsi
> @@ -279,6 +279,29 @@ mali: gpu@c0000 {
>  	};
>  }; /* end of / */
>  
> +&aiu {
> +	compatible = "amlogic,aiu-meson8b", "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 {
>  	pmu: pmu@e0 {
>  		compatible = "amlogic,meson8b-pmu", "syscon";
> @@ -302,6 +325,46 @@ gpio_ao: ao-bank@14 {
>  			gpio-ranges = <&pinctrl_aobus 0 0 16>;
>  		};
>  
> +		i2s_am_clk_pins: i2s-am-clk-out {
> +			mux {
> +				groups = "i2s_am_clk_out";
> +				function = "i2s";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_ao_clk_pins: i2s-ao-clk-out {
> +			mux {
> +				groups = "i2s_ao_clk_out";
> +				function = "i2s";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_lr_clk_pins: i2s-lr-clk-out {
> +			mux {
> +				groups = "i2s_lr_clk_out";
> +				function = "i2s";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_ch01_ao_pins: i2s-out-ch01 {
> +			mux {
> +				groups = "i2s_out_01";
> +				function = "i2s";
> +				bias-disable;
> +			};
> +		};
> +
> +		spdif_out_1_pins: spdif-out-1 {
> +			mux {
> +				groups = "spdif_out_1";
> +				function = "spdif_1";
> +				bias-disable;
> +			};
> +		};
> +
>  		uart_ao_a_pins: uart_ao_a {
>  			mux {
>  				groups = "uart_tx_ao_a", "uart_rx_ao_a";
> 


Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

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

* Re: [PATCH v2 1/2] ARM: dts: meson: Add the AIU audio controller
@ 2021-07-26  8:00     ` Neil Armstrong
  0 siblings, 0 replies; 18+ messages in thread
From: Neil Armstrong @ 2021-07-26  8:00 UTC (permalink / raw)
  To: Martin Blumenstingl, linux-amlogic
  Cc: khilman, linux-arm-kernel, linux-kernel

On 18/07/2021 01:30, Martin Blumenstingl wrote:
> Add the AIU audio controller to the Amlogic Meson6/8/8b/8m2 SoC DT. This
> provides I2S and SPDIF outputs as well as codec glues for the internal
> HDMI controller.
> Also add the clock inputs and pin mux definitions on Meson8/8b/8m2. On
> Meson6 this is omitted because we neither have a clock nor pin
> controller node there yet.
> 
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>  arch/arm/boot/dts/meson.dtsi   | 12 +++++++
>  arch/arm/boot/dts/meson8.dtsi  | 63 ++++++++++++++++++++++++++++++++++
>  arch/arm/boot/dts/meson8b.dtsi | 63 ++++++++++++++++++++++++++++++++++
>  3 files changed, 138 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/meson.dtsi b/arch/arm/boot/dts/meson.dtsi
> index bd0e864964e9..3be7cba603d5 100644
> --- a/arch/arm/boot/dts/meson.dtsi
> +++ b/arch/arm/boot/dts/meson.dtsi
> @@ -5,6 +5,7 @@
>  
>  #include <dt-bindings/interrupt-controller/irq.h>
>  #include <dt-bindings/interrupt-controller/arm-gic.h>
> +#include <dt-bindings/sound/meson-aiu.h>
>  
>  / {
>  	#address-cells = <1>;
> @@ -36,6 +37,17 @@ hhi: system-controller@4000 {
>  				reg = <0x4000 0x400>;
>  			};
>  
> +			aiu: audio-controller@5400 {
> +				compatible = "amlogic,aiu";
> +				#sound-dai-cells = <2>;
> +				sound-name-prefix = "AIU";
> +				reg = <0x5400 0x2ac>;
> +				interrupts = <GIC_SPI 48 IRQ_TYPE_EDGE_RISING>,
> +					     <GIC_SPI 50 IRQ_TYPE_EDGE_RISING>;
> +				interrupt-names = "i2s", "spdif";
> +				status = "disabled";
> +			};
> +
>  			assist: assist@7c00 {
>  				compatible = "amlogic,meson-mx-assist", "syscon";
>  				reg = <0x7c00 0x200>;
> diff --git a/arch/arm/boot/dts/meson8.dtsi b/arch/arm/boot/dts/meson8.dtsi
> index 686c7b7c79d5..f80ddc98d3a2 100644
> --- a/arch/arm/boot/dts/meson8.dtsi
> +++ b/arch/arm/boot/dts/meson8.dtsi
> @@ -317,6 +317,29 @@ mali: gpu@c0000 {
>  	};
>  }; /* end of / */
>  
> +&aiu {
> +	compatible = "amlogic,aiu-meson8", "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 {
>  	pmu: pmu@e0 {
>  		compatible = "amlogic,meson8-pmu", "syscon";
> @@ -340,6 +363,38 @@ gpio_ao: ao-bank@14 {
>  			gpio-ranges = <&pinctrl_aobus 0 0 16>;
>  		};
>  
> +		i2s_am_clk_pins: i2s-am-clk-out {
> +			mux {
> +				groups = "i2s_am_clk_out_ao";
> +				function = "i2s_ao";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_ao_clk_pins: i2s-ao-clk-out {
> +			mux {
> +				groups = "i2s_ao_clk_out_ao";
> +				function = "i2s_ao";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_lr_clk_pins: i2s-lr-clk-out {
> +			mux {
> +				groups = "i2s_lr_clk_out_ao";
> +				function = "i2s_ao";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_ch01_ao_pins: i2s-out-ch01 {
> +			mux {
> +				groups = "i2s_out_ch01_ao";
> +				function = "i2s_ao";
> +				bias-disable;
> +			};
> +		};
> +
>  		uart_ao_a_pins: uart_ao_a {
>  			mux {
>  				groups = "uart_tx_ao_a", "uart_rx_ao_a";
> @@ -460,6 +515,14 @@ mux {
>  			};
>  		};
>  
> +		spdif_out_pins: spdif-out {
> +			mux {
> +				groups = "spdif_out";
> +				function = "spdif";
> +				bias-disable;
> +			};
> +		};
> +
>  		spi_nor_pins: nor {
>  			mux {
>  				groups = "nor_d", "nor_q", "nor_c", "nor_cs";
> diff --git a/arch/arm/boot/dts/meson8b.dtsi b/arch/arm/boot/dts/meson8b.dtsi
> index c02b03cbcdf4..b49b7cbaed4e 100644
> --- a/arch/arm/boot/dts/meson8b.dtsi
> +++ b/arch/arm/boot/dts/meson8b.dtsi
> @@ -279,6 +279,29 @@ mali: gpu@c0000 {
>  	};
>  }; /* end of / */
>  
> +&aiu {
> +	compatible = "amlogic,aiu-meson8b", "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 {
>  	pmu: pmu@e0 {
>  		compatible = "amlogic,meson8b-pmu", "syscon";
> @@ -302,6 +325,46 @@ gpio_ao: ao-bank@14 {
>  			gpio-ranges = <&pinctrl_aobus 0 0 16>;
>  		};
>  
> +		i2s_am_clk_pins: i2s-am-clk-out {
> +			mux {
> +				groups = "i2s_am_clk_out";
> +				function = "i2s";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_ao_clk_pins: i2s-ao-clk-out {
> +			mux {
> +				groups = "i2s_ao_clk_out";
> +				function = "i2s";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_lr_clk_pins: i2s-lr-clk-out {
> +			mux {
> +				groups = "i2s_lr_clk_out";
> +				function = "i2s";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_ch01_ao_pins: i2s-out-ch01 {
> +			mux {
> +				groups = "i2s_out_01";
> +				function = "i2s";
> +				bias-disable;
> +			};
> +		};
> +
> +		spdif_out_1_pins: spdif-out-1 {
> +			mux {
> +				groups = "spdif_out_1";
> +				function = "spdif_1";
> +				bias-disable;
> +			};
> +		};
> +
>  		uart_ao_a_pins: uart_ao_a {
>  			mux {
>  				groups = "uart_tx_ao_a", "uart_rx_ao_a";
> 


Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 1/2] ARM: dts: meson: Add the AIU audio controller
@ 2021-07-26  8:00     ` Neil Armstrong
  0 siblings, 0 replies; 18+ messages in thread
From: Neil Armstrong @ 2021-07-26  8:00 UTC (permalink / raw)
  To: Martin Blumenstingl, linux-amlogic
  Cc: khilman, linux-arm-kernel, linux-kernel

On 18/07/2021 01:30, Martin Blumenstingl wrote:
> Add the AIU audio controller to the Amlogic Meson6/8/8b/8m2 SoC DT. This
> provides I2S and SPDIF outputs as well as codec glues for the internal
> HDMI controller.
> Also add the clock inputs and pin mux definitions on Meson8/8b/8m2. On
> Meson6 this is omitted because we neither have a clock nor pin
> controller node there yet.
> 
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>  arch/arm/boot/dts/meson.dtsi   | 12 +++++++
>  arch/arm/boot/dts/meson8.dtsi  | 63 ++++++++++++++++++++++++++++++++++
>  arch/arm/boot/dts/meson8b.dtsi | 63 ++++++++++++++++++++++++++++++++++
>  3 files changed, 138 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/meson.dtsi b/arch/arm/boot/dts/meson.dtsi
> index bd0e864964e9..3be7cba603d5 100644
> --- a/arch/arm/boot/dts/meson.dtsi
> +++ b/arch/arm/boot/dts/meson.dtsi
> @@ -5,6 +5,7 @@
>  
>  #include <dt-bindings/interrupt-controller/irq.h>
>  #include <dt-bindings/interrupt-controller/arm-gic.h>
> +#include <dt-bindings/sound/meson-aiu.h>
>  
>  / {
>  	#address-cells = <1>;
> @@ -36,6 +37,17 @@ hhi: system-controller@4000 {
>  				reg = <0x4000 0x400>;
>  			};
>  
> +			aiu: audio-controller@5400 {
> +				compatible = "amlogic,aiu";
> +				#sound-dai-cells = <2>;
> +				sound-name-prefix = "AIU";
> +				reg = <0x5400 0x2ac>;
> +				interrupts = <GIC_SPI 48 IRQ_TYPE_EDGE_RISING>,
> +					     <GIC_SPI 50 IRQ_TYPE_EDGE_RISING>;
> +				interrupt-names = "i2s", "spdif";
> +				status = "disabled";
> +			};
> +
>  			assist: assist@7c00 {
>  				compatible = "amlogic,meson-mx-assist", "syscon";
>  				reg = <0x7c00 0x200>;
> diff --git a/arch/arm/boot/dts/meson8.dtsi b/arch/arm/boot/dts/meson8.dtsi
> index 686c7b7c79d5..f80ddc98d3a2 100644
> --- a/arch/arm/boot/dts/meson8.dtsi
> +++ b/arch/arm/boot/dts/meson8.dtsi
> @@ -317,6 +317,29 @@ mali: gpu@c0000 {
>  	};
>  }; /* end of / */
>  
> +&aiu {
> +	compatible = "amlogic,aiu-meson8", "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 {
>  	pmu: pmu@e0 {
>  		compatible = "amlogic,meson8-pmu", "syscon";
> @@ -340,6 +363,38 @@ gpio_ao: ao-bank@14 {
>  			gpio-ranges = <&pinctrl_aobus 0 0 16>;
>  		};
>  
> +		i2s_am_clk_pins: i2s-am-clk-out {
> +			mux {
> +				groups = "i2s_am_clk_out_ao";
> +				function = "i2s_ao";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_ao_clk_pins: i2s-ao-clk-out {
> +			mux {
> +				groups = "i2s_ao_clk_out_ao";
> +				function = "i2s_ao";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_lr_clk_pins: i2s-lr-clk-out {
> +			mux {
> +				groups = "i2s_lr_clk_out_ao";
> +				function = "i2s_ao";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_ch01_ao_pins: i2s-out-ch01 {
> +			mux {
> +				groups = "i2s_out_ch01_ao";
> +				function = "i2s_ao";
> +				bias-disable;
> +			};
> +		};
> +
>  		uart_ao_a_pins: uart_ao_a {
>  			mux {
>  				groups = "uart_tx_ao_a", "uart_rx_ao_a";
> @@ -460,6 +515,14 @@ mux {
>  			};
>  		};
>  
> +		spdif_out_pins: spdif-out {
> +			mux {
> +				groups = "spdif_out";
> +				function = "spdif";
> +				bias-disable;
> +			};
> +		};
> +
>  		spi_nor_pins: nor {
>  			mux {
>  				groups = "nor_d", "nor_q", "nor_c", "nor_cs";
> diff --git a/arch/arm/boot/dts/meson8b.dtsi b/arch/arm/boot/dts/meson8b.dtsi
> index c02b03cbcdf4..b49b7cbaed4e 100644
> --- a/arch/arm/boot/dts/meson8b.dtsi
> +++ b/arch/arm/boot/dts/meson8b.dtsi
> @@ -279,6 +279,29 @@ mali: gpu@c0000 {
>  	};
>  }; /* end of / */
>  
> +&aiu {
> +	compatible = "amlogic,aiu-meson8b", "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 {
>  	pmu: pmu@e0 {
>  		compatible = "amlogic,meson8b-pmu", "syscon";
> @@ -302,6 +325,46 @@ gpio_ao: ao-bank@14 {
>  			gpio-ranges = <&pinctrl_aobus 0 0 16>;
>  		};
>  
> +		i2s_am_clk_pins: i2s-am-clk-out {
> +			mux {
> +				groups = "i2s_am_clk_out";
> +				function = "i2s";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_ao_clk_pins: i2s-ao-clk-out {
> +			mux {
> +				groups = "i2s_ao_clk_out";
> +				function = "i2s";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_lr_clk_pins: i2s-lr-clk-out {
> +			mux {
> +				groups = "i2s_lr_clk_out";
> +				function = "i2s";
> +				bias-disable;
> +			};
> +		};
> +
> +		i2s_out_ch01_ao_pins: i2s-out-ch01 {
> +			mux {
> +				groups = "i2s_out_01";
> +				function = "i2s";
> +				bias-disable;
> +			};
> +		};
> +
> +		spdif_out_1_pins: spdif-out-1 {
> +			mux {
> +				groups = "spdif_out_1";
> +				function = "spdif_1";
> +				bias-disable;
> +			};
> +		};
> +
>  		uart_ao_a_pins: uart_ao_a {
>  			mux {
>  				groups = "uart_tx_ao_a", "uart_rx_ao_a";
> 


Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v2 2/2] ARM: dts: meson8b: ec100: wire up the RT5640 audio codec
  2021-07-17 23:30   ` Martin Blumenstingl
  (?)
@ 2021-07-26  8:00     ` Neil Armstrong
  -1 siblings, 0 replies; 18+ messages in thread
From: Neil Armstrong @ 2021-07-26  8:00 UTC (permalink / raw)
  To: Martin Blumenstingl, linux-amlogic
  Cc: khilman, linux-arm-kernel, linux-kernel

On 18/07/2021 01:30, Martin Blumenstingl wrote:
> The Realtek RT5640 codec is connected to the SoC's I2S interface.
> Describe this in the .dts together with the codec's LDO1 enable GPIO so
> audio can be played on the Endless Mini.
> While here, add a note about the realtek,ldo1-en-gpios for which the
> EC100 uses GPIO_BSD_EN. Due to driver limitations this pin cannot be
> used currently.
> 
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>  arch/arm/boot/dts/meson8b-ec100.dts | 44 +++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/meson8b-ec100.dts b/arch/arm/boot/dts/meson8b-ec100.dts
> index 8e48ccc6b634..e404bdccdab9 100644
> --- a/arch/arm/boot/dts/meson8b-ec100.dts
> +++ b/arch/arm/boot/dts/meson8b-ec100.dts
> @@ -96,6 +96,32 @@ rtc32k_xtal: rtc32k-xtal-clk {
>  		#clock-cells = <0>;
>  	};
>  
> +	sound {
> +		compatible = "amlogic,gx-sound-card";
> +		model = "M8B-EC100";
> +
> +		assigned-clocks = <&clkc CLKID_MPLL0>,
> +				  <&clkc CLKID_MPLL1>,
> +				  <&clkc CLKID_MPLL2>;
> +		assigned-clock-rates = <270950400>,
> +				       <294912000>,
> +				       <393216000>;
> +
> +		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 = <&rt5640>;
> +			};
> +		};
> +	};
> +
>  	usb_vbus: regulator-usb-vbus {
>  		/*
>  		 * Silergy SY6288CCAC-GP 2A Power Distribution Switch.
> @@ -242,6 +268,14 @@ vddee: regulator-vddee {
>  	};
>  };
>  
> +&aiu {
> +	status = "okay";
> +
> +	pinctrl-0 = <&i2s_am_clk_pins>, <&i2s_out_ao_clk_pins>,
> +		    <&i2s_out_lr_clk_pins>, <&i2s_out_ch01_ao_pins>;
> +	pinctrl-names = "default";
> +};
> +
>  &cpu0 {
>  	cpu-supply = <&vcck>;
>  };
> @@ -283,9 +317,19 @@ &i2c_A {
>  
>  	rt5640: codec@1c {
>  		compatible = "realtek,rt5640";
> +
>  		reg = <0x1c>;
> +
> +		#sound-dai-cells = <0>;
> +
>  		interrupt-parent = <&gpio_intc>;
>  		interrupts = <13 IRQ_TYPE_EDGE_BOTH>; /* GPIOAO_13 */
> +
> +		/*
> +		 * TODO: realtek,ldo1-en-gpios is connected to GPIO_BSD_EN.
> +		 * We currently cannot configure this pin correctly.
> +		 * Luckily for us it's in the "right" state by default.
> +		 */
>  		realtek,in1-differential;
>  	};
>  };
> 

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

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

* Re: [PATCH v2 2/2] ARM: dts: meson8b: ec100: wire up the RT5640 audio codec
@ 2021-07-26  8:00     ` Neil Armstrong
  0 siblings, 0 replies; 18+ messages in thread
From: Neil Armstrong @ 2021-07-26  8:00 UTC (permalink / raw)
  To: Martin Blumenstingl, linux-amlogic
  Cc: khilman, linux-arm-kernel, linux-kernel

On 18/07/2021 01:30, Martin Blumenstingl wrote:
> The Realtek RT5640 codec is connected to the SoC's I2S interface.
> Describe this in the .dts together with the codec's LDO1 enable GPIO so
> audio can be played on the Endless Mini.
> While here, add a note about the realtek,ldo1-en-gpios for which the
> EC100 uses GPIO_BSD_EN. Due to driver limitations this pin cannot be
> used currently.
> 
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>  arch/arm/boot/dts/meson8b-ec100.dts | 44 +++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/meson8b-ec100.dts b/arch/arm/boot/dts/meson8b-ec100.dts
> index 8e48ccc6b634..e404bdccdab9 100644
> --- a/arch/arm/boot/dts/meson8b-ec100.dts
> +++ b/arch/arm/boot/dts/meson8b-ec100.dts
> @@ -96,6 +96,32 @@ rtc32k_xtal: rtc32k-xtal-clk {
>  		#clock-cells = <0>;
>  	};
>  
> +	sound {
> +		compatible = "amlogic,gx-sound-card";
> +		model = "M8B-EC100";
> +
> +		assigned-clocks = <&clkc CLKID_MPLL0>,
> +				  <&clkc CLKID_MPLL1>,
> +				  <&clkc CLKID_MPLL2>;
> +		assigned-clock-rates = <270950400>,
> +				       <294912000>,
> +				       <393216000>;
> +
> +		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 = <&rt5640>;
> +			};
> +		};
> +	};
> +
>  	usb_vbus: regulator-usb-vbus {
>  		/*
>  		 * Silergy SY6288CCAC-GP 2A Power Distribution Switch.
> @@ -242,6 +268,14 @@ vddee: regulator-vddee {
>  	};
>  };
>  
> +&aiu {
> +	status = "okay";
> +
> +	pinctrl-0 = <&i2s_am_clk_pins>, <&i2s_out_ao_clk_pins>,
> +		    <&i2s_out_lr_clk_pins>, <&i2s_out_ch01_ao_pins>;
> +	pinctrl-names = "default";
> +};
> +
>  &cpu0 {
>  	cpu-supply = <&vcck>;
>  };
> @@ -283,9 +317,19 @@ &i2c_A {
>  
>  	rt5640: codec@1c {
>  		compatible = "realtek,rt5640";
> +
>  		reg = <0x1c>;
> +
> +		#sound-dai-cells = <0>;
> +
>  		interrupt-parent = <&gpio_intc>;
>  		interrupts = <13 IRQ_TYPE_EDGE_BOTH>; /* GPIOAO_13 */
> +
> +		/*
> +		 * TODO: realtek,ldo1-en-gpios is connected to GPIO_BSD_EN.
> +		 * We currently cannot configure this pin correctly.
> +		 * Luckily for us it's in the "right" state by default.
> +		 */
>  		realtek,in1-differential;
>  	};
>  };
> 

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 2/2] ARM: dts: meson8b: ec100: wire up the RT5640 audio codec
@ 2021-07-26  8:00     ` Neil Armstrong
  0 siblings, 0 replies; 18+ messages in thread
From: Neil Armstrong @ 2021-07-26  8:00 UTC (permalink / raw)
  To: Martin Blumenstingl, linux-amlogic
  Cc: khilman, linux-arm-kernel, linux-kernel

On 18/07/2021 01:30, Martin Blumenstingl wrote:
> The Realtek RT5640 codec is connected to the SoC's I2S interface.
> Describe this in the .dts together with the codec's LDO1 enable GPIO so
> audio can be played on the Endless Mini.
> While here, add a note about the realtek,ldo1-en-gpios for which the
> EC100 uses GPIO_BSD_EN. Due to driver limitations this pin cannot be
> used currently.
> 
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>  arch/arm/boot/dts/meson8b-ec100.dts | 44 +++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/meson8b-ec100.dts b/arch/arm/boot/dts/meson8b-ec100.dts
> index 8e48ccc6b634..e404bdccdab9 100644
> --- a/arch/arm/boot/dts/meson8b-ec100.dts
> +++ b/arch/arm/boot/dts/meson8b-ec100.dts
> @@ -96,6 +96,32 @@ rtc32k_xtal: rtc32k-xtal-clk {
>  		#clock-cells = <0>;
>  	};
>  
> +	sound {
> +		compatible = "amlogic,gx-sound-card";
> +		model = "M8B-EC100";
> +
> +		assigned-clocks = <&clkc CLKID_MPLL0>,
> +				  <&clkc CLKID_MPLL1>,
> +				  <&clkc CLKID_MPLL2>;
> +		assigned-clock-rates = <270950400>,
> +				       <294912000>,
> +				       <393216000>;
> +
> +		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 = <&rt5640>;
> +			};
> +		};
> +	};
> +
>  	usb_vbus: regulator-usb-vbus {
>  		/*
>  		 * Silergy SY6288CCAC-GP 2A Power Distribution Switch.
> @@ -242,6 +268,14 @@ vddee: regulator-vddee {
>  	};
>  };
>  
> +&aiu {
> +	status = "okay";
> +
> +	pinctrl-0 = <&i2s_am_clk_pins>, <&i2s_out_ao_clk_pins>,
> +		    <&i2s_out_lr_clk_pins>, <&i2s_out_ch01_ao_pins>;
> +	pinctrl-names = "default";
> +};
> +
>  &cpu0 {
>  	cpu-supply = <&vcck>;
>  };
> @@ -283,9 +317,19 @@ &i2c_A {
>  
>  	rt5640: codec@1c {
>  		compatible = "realtek,rt5640";
> +
>  		reg = <0x1c>;
> +
> +		#sound-dai-cells = <0>;
> +
>  		interrupt-parent = <&gpio_intc>;
>  		interrupts = <13 IRQ_TYPE_EDGE_BOTH>; /* GPIOAO_13 */
> +
> +		/*
> +		 * TODO: realtek,ldo1-en-gpios is connected to GPIO_BSD_EN.
> +		 * We currently cannot configure this pin correctly.
> +		 * Luckily for us it's in the "right" state by default.
> +		 */
>  		realtek,in1-differential;
>  	};
>  };
> 

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH v2 0/2] Meson8/Meson8b: sound card support
  2021-07-17 23:30 ` Martin Blumenstingl
  (?)
@ 2021-07-26  8:12   ` Neil Armstrong
  -1 siblings, 0 replies; 18+ messages in thread
From: Neil Armstrong @ 2021-07-26  8:12 UTC (permalink / raw)
  To: linux-amlogic, Martin Blumenstingl
  Cc: Neil Armstrong, linux-arm-kernel, linux-kernel, khilman

Hi,

On Sun, 18 Jul 2021 01:30:28 +0200, Martin Blumenstingl wrote:
> This series adds the AIU audio controller for Meson8 and Meson8b. The
> AIU audio controller has been found to work fine with out-of-tree
> patches for HDMI audio (over I2S). SPDIF output also works (tested with
> a scope).
> Endless Mini (EC-100) has an RT5640 audio codec. The driver for this
> codec can be selected since commit 08c56cab302a05 ("ASoC: rt5640: Make
> codec selectable"), which is part of Linux 5.14-rc1. While support is
> not perfect (due to us lacking proper support for configuring
> GPIO_BSD_EN) audio output still works fine.
> 
> [...]

Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (for-next)

[1/2] ARM: dts: meson: Add the AIU audio controller
      https://git.kernel.org/amlogic/c/4f8ca13df1d5ff1c09e06acbd1bc7d4d8510dfc0
[2/2] ARM: dts: meson8b: ec100: wire up the RT5640 audio codec
      https://git.kernel.org/amlogic/c/0bd475db1a5d0cd89b435ff6bfee083aca5d104a

-- 
Neil

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

* Re: [PATCH v2 0/2] Meson8/Meson8b: sound card support
@ 2021-07-26  8:12   ` Neil Armstrong
  0 siblings, 0 replies; 18+ messages in thread
From: Neil Armstrong @ 2021-07-26  8:12 UTC (permalink / raw)
  To: linux-amlogic, Martin Blumenstingl
  Cc: Neil Armstrong, linux-arm-kernel, linux-kernel, khilman

Hi,

On Sun, 18 Jul 2021 01:30:28 +0200, Martin Blumenstingl wrote:
> This series adds the AIU audio controller for Meson8 and Meson8b. The
> AIU audio controller has been found to work fine with out-of-tree
> patches for HDMI audio (over I2S). SPDIF output also works (tested with
> a scope).
> Endless Mini (EC-100) has an RT5640 audio codec. The driver for this
> codec can be selected since commit 08c56cab302a05 ("ASoC: rt5640: Make
> codec selectable"), which is part of Linux 5.14-rc1. While support is
> not perfect (due to us lacking proper support for configuring
> GPIO_BSD_EN) audio output still works fine.
> 
> [...]

Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (for-next)

[1/2] ARM: dts: meson: Add the AIU audio controller
      https://git.kernel.org/amlogic/c/4f8ca13df1d5ff1c09e06acbd1bc7d4d8510dfc0
[2/2] ARM: dts: meson8b: ec100: wire up the RT5640 audio codec
      https://git.kernel.org/amlogic/c/0bd475db1a5d0cd89b435ff6bfee083aca5d104a

-- 
Neil

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 0/2] Meson8/Meson8b: sound card support
@ 2021-07-26  8:12   ` Neil Armstrong
  0 siblings, 0 replies; 18+ messages in thread
From: Neil Armstrong @ 2021-07-26  8:12 UTC (permalink / raw)
  To: linux-amlogic, Martin Blumenstingl
  Cc: Neil Armstrong, linux-arm-kernel, linux-kernel, khilman

Hi,

On Sun, 18 Jul 2021 01:30:28 +0200, Martin Blumenstingl wrote:
> This series adds the AIU audio controller for Meson8 and Meson8b. The
> AIU audio controller has been found to work fine with out-of-tree
> patches for HDMI audio (over I2S). SPDIF output also works (tested with
> a scope).
> Endless Mini (EC-100) has an RT5640 audio codec. The driver for this
> codec can be selected since commit 08c56cab302a05 ("ASoC: rt5640: Make
> codec selectable"), which is part of Linux 5.14-rc1. While support is
> not perfect (due to us lacking proper support for configuring
> GPIO_BSD_EN) audio output still works fine.
> 
> [...]

Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (for-next)

[1/2] ARM: dts: meson: Add the AIU audio controller
      https://git.kernel.org/amlogic/c/4f8ca13df1d5ff1c09e06acbd1bc7d4d8510dfc0
[2/2] ARM: dts: meson8b: ec100: wire up the RT5640 audio codec
      https://git.kernel.org/amlogic/c/0bd475db1a5d0cd89b435ff6bfee083aca5d104a

-- 
Neil

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

end of thread, other threads:[~2021-07-26  8:22 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-17 23:30 [PATCH v2 0/2] Meson8/Meson8b: sound card support Martin Blumenstingl
2021-07-17 23:30 ` Martin Blumenstingl
2021-07-17 23:30 ` Martin Blumenstingl
2021-07-17 23:30 ` [PATCH v2 1/2] ARM: dts: meson: Add the AIU audio controller Martin Blumenstingl
2021-07-17 23:30   ` Martin Blumenstingl
2021-07-17 23:30   ` Martin Blumenstingl
2021-07-26  8:00   ` Neil Armstrong
2021-07-26  8:00     ` Neil Armstrong
2021-07-26  8:00     ` Neil Armstrong
2021-07-17 23:30 ` [PATCH v2 2/2] ARM: dts: meson8b: ec100: wire up the RT5640 audio codec Martin Blumenstingl
2021-07-17 23:30   ` Martin Blumenstingl
2021-07-17 23:30   ` Martin Blumenstingl
2021-07-26  8:00   ` Neil Armstrong
2021-07-26  8:00     ` Neil Armstrong
2021-07-26  8:00     ` Neil Armstrong
2021-07-26  8:12 ` [PATCH v2 0/2] Meson8/Meson8b: sound card support Neil Armstrong
2021-07-26  8:12   ` Neil Armstrong
2021-07-26  8:12   ` Neil Armstrong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.