Skip to contentSkip to conversation

arm64: dts: meson-axg: add audio support

PATCH Superseded Jerome Brunet 3 participants 21 messages Jul 24, 2018 – Jul 26, 2018

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jerome Brunet

author reviewer
#0 lore raw

cover arm64: dts: meson-axg: add audio support

The main purpose of this patchset is to add the audio devices on amlogic's AXG SoCs.

Some codecs require some power supplies. This is why the 3 first patches deal with the S400 power supplies, even if some are not related to audio.

In term of dependency, apart from the clock bindings you have already pulled for your second PR to arm-soc, this patchset requires the ARB reset bindings [0] for patch 5. I don't know if Philip can make it available somewhere ?

Of course, if the dependencies make this patchset too complicated to merge in this cycle, I'll resubmit once the next rc1 is out.

Jerome Brunet (14):
arm64: dts: meson-axg: improve power supplies description
arm64: dts: meson-axg: add vcc 5v regulator on the s400
arm64: dts: meson-axg: add usb power regulator
arm64: dts: meson-axg: add audio arb reset controller
arm64: dts: meson-axg: add audio fifos
arm64: dts: meson-axg: add spdifout
arm64: dts: meson-axg: add tdmin formatters
arm64: dts: meson-axg: add tdmout formatters
arm64: dts: meson-axg: add tdm interfaces
arm64: dts: meson-axg: add linein codec
arm64: dts: meson-axg: add lineout codec
arm64: dts: meson-axg: add spdif-dit codec
arm64: dts: meson-axg: s400: enable audio devices
arm64: dts: meson-axg: add s400 sound card

 .../arm64/boot/dts/amlogic/meson-axg-s400.dts | 237 ++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi    | 216 ++++++++++++++++
 2 files changed, 453 insertions(+)
Signature · 1 line
2.17.1
author reviewer
#1 lore raw

PATCH 1/14 arm64: dts: meson-axg: improve power supplies description

Add the parent supply of the s400 power supplies.
Also add 'regulator-always-on' property on the regulators which can't be disabled

---
 arch/arm64/boot/dts/amlogic/meson-axg-s400.dts | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +9 -0
index fd90fa4a282c..09c7909a78ea 100644
@@ -65,6 +65,7 @@
 		regulator-name = "12V";
 		regulator-min-microvolt = <12000000>;
 		regulator-max-microvolt = <12000000>;
+		regulator-always-on;
 	};
 
 	vddio_boot: regulator-vddio_boot {
@@ -72,6 +73,8 @@
 		regulator-name = "VDDIO_BOOT";
 		regulator-min-microvolt = <1800000>;
 		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vddao_3v3>;
+		regulator-always-on;
 	};
 
 	vddao_3v3: regulator-vddao_3v3 {
@@ -79,6 +82,8 @@
 		regulator-name = "VDDAO_3V3";
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
+		vin-supply = <&main_12v>;
+		regulator-always-on;
 	};
 
 	vddio_ao18: regulator-vddio_ao18 {
@@ -86,6 +91,8 @@
 		regulator-name = "VDDIO_AO18";
 		regulator-min-microvolt = <1800000>;
 		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vddao_3v3>;
+		regulator-always-on;
 	};
 
 	vcc_3v3: regulator-vcc_3v3 {
@@ -93,6 +100,8 @@
 		regulator-name = "VCC_3V3";
 		regulator-min-microvolt = <3300000>;
 		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vddao_3v3>;
+		regulator-always-on;
 	};
 
 	emmc_pwrseq: emmc-pwrseq {
Signature · 1 line
2.17.1
author reviewer
#2 lore raw

PATCH 2/14 arm64: dts: meson-axg: add vcc 5v regulator on the s400

In reply to Jerome Brunet

This regulator is controlled by a GPIO and supplies various devices on the board, such as the lineout codec, the usb supply or the lcd controller.

---
 arch/arm64/boot/dts/amlogic/meson-axg-s400.dts | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +11 -0
index 09c7909a78ea..5937d8c3a6ed 100644
@@ -104,6 +104,17 @@
 		regulator-always-on;
 	};
 
+	vcc_5v: regulator-vcc_5v {
+		compatible = "regulator-fixed";
+		regulator-name = "VCC5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		vin-supply = <&main_12v>;
+
+		gpio = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+
 	emmc_pwrseq: emmc-pwrseq {
 		compatible = "mmc-pwrseq-emmc";
 		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
Signature · 1 line
2.17.1
author reviewer
#3 lore raw

PATCH 3/14 arm64: dts: meson-axg: add usb power regulator

In reply to Jerome Brunet

The usb power regulator is supplied by the vcc 5v regulator and controlled by a GPIO. This will be needed to enable usb.

---
 arch/arm64/boot/dts/amlogic/meson-axg-s400.dts | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +11 -0
index 5937d8c3a6ed..7489b88f27d7 100644
@@ -115,6 +115,17 @@
 		enable-active-high;
 	};
 
+	usb_pwr: regulator-usb_pwr {
+		compatible = "regulator-fixed";
+		regulator-name = "USB_PWR";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		vin-supply = <&vcc_5v>;
+
+		gpio = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+
 	emmc_pwrseq: emmc-pwrseq {
 		compatible = "mmc-pwrseq-emmc";
 		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
Signature · 1 line
2.17.1
author reviewer
#4 lore raw

PATCH 4/14 arm64: dts: meson-axg: add audio arb reset controller

In reply to Jerome Brunet

Add the audio memory arbiter which control the access of the audio fifos to the DDR.

---
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +7 -0
index 6adc8d3dbf0a..3893c630d969 100644
@@ -189,6 +189,13 @@
 
 				resets = <&reset RESET_AUDIO>;
 			};
+
+			arb: reset-controller at 280 {
+				compatible = "amlogic,meson-axg-audio-arb";
+				reg = <0x0 0x280 0x0 0x4>;
+				#reset-cells = <1>;
+				clocks = <&clkc_audio AUD_CLKID_DDR_ARB>;
+			};
 		};
 
 		cbus: bus at ffd00000 {
Signature · 1 line
2.17.1
author reviewer
#5 lore raw

PATCH 5/14 arm64: dts: meson-axg: add audio fifos

In reply to Jerome Brunet

Add TODDR and FRDDR audio fifos of the AXG SoC.
These fifos are the capture and playback memory interfaces of audio subsystem of the AXG.

---

Kevin,

As you will see below, this patch depends on the ARB reset bindings which have been accepted by Philip recently.

Cheers
Jerome

 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 67 ++++++++++++++++++++++
 1 file changed, 67 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +67 -0
index 3893c630d969..a20189844d92 100644
@@ -11,6 +11,7 @@
 #include <dt-bindings/clock/axg-aoclkc.h>
 #include <dt-bindings/gpio/meson-axg-gpio.h>
 #include <dt-bindings/reset/amlogic,meson-axg-reset.h>
+#include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
 
 / {
 	compatible = "amlogic,meson-axg";
@@ -190,6 +191,72 @@
 				resets = <&reset RESET_AUDIO>;
 			};
 
+			toddr_a: audio-controller at 100 {
+				compatible = "amlogic,axg-toddr";
+				reg = <0x0 0x100 0x0 0x1c>;
+				#sound-dai-cells = <0>;
+				sound-name-prefix = "TODDR_A";
+				interrupts = <GIC_SPI 84 IRQ_TYPE_EDGE_RISING>;
+				clocks = <&clkc_audio AUD_CLKID_TODDR_A>;
+				resets = <&arb AXG_ARB_TODDR_A>;
+				status = "disabled";
+			};
+
+			toddr_b: audio-controller at 140 {
+				compatible = "amlogic,axg-toddr";
+				reg = <0x0 0x140 0x0 0x1c>;
+				#sound-dai-cells = <0>;
+				sound-name-prefix = "TODDR_B";
+				interrupts = <GIC_SPI 85 IRQ_TYPE_EDGE_RISING>;
+				clocks = <&clkc_audio AUD_CLKID_TODDR_B>;
+				resets = <&arb AXG_ARB_TODDR_B>;
+				status = "disabled";
+			};
+
+			toddr_c: audio-controller at 180 {
+				compatible = "amlogic,axg-toddr";
+				reg = <0x0 0x180 0x0 0x1c>;
+				#sound-dai-cells = <0>;
+				sound-name-prefix = "TODDR_C";
+				interrupts = <GIC_SPI 86 IRQ_TYPE_EDGE_RISING>;
+				clocks = <&clkc_audio AUD_CLKID_TODDR_C>;
+				resets = <&arb AXG_ARB_TODDR_C>;
+				status = "disabled";
+			};
+
+			frddr_a: audio-controller at 1c0 {
+				compatible = "amlogic,axg-frddr";
+				reg = <0x0 0x1c0 0x0 0x1c>;
+				#sound-dai-cells = <0>;
+				sound-name-prefix = "FRDDR_A";
+				interrupts = <GIC_SPI 88 IRQ_TYPE_EDGE_RISING>;
+				clocks = <&clkc_audio AUD_CLKID_FRDDR_A>;
+				resets = <&arb AXG_ARB_FRDDR_A>;
+				status = "disabled";
+			};
+
+			frddr_b: audio-controller at 200 {
+				compatible = "amlogic,axg-frddr";
+				reg = <0x0 0x200 0x0 0x1c>;
+				#sound-dai-cells = <0>;
+				sound-name-prefix = "FRDDR_B";
+				interrupts = <GIC_SPI 89 IRQ_TYPE_EDGE_RISING>;
+				clocks = <&clkc_audio AUD_CLKID_FRDDR_B>;
+				resets = <&arb AXG_ARB_FRDDR_B>;
+				status = "disabled";
+			};
+
+			frddr_c: audio-controller at 240 {
+				compatible = "amlogic,axg-frddr";
+				reg = <0x0 0x240 0x0 0x1c>;
+				#sound-dai-cells = <0>;
+				sound-name-prefix = "FRDDR_C";
+				interrupts = <GIC_SPI 90 IRQ_TYPE_EDGE_RISING>;
+				clocks = <&clkc_audio AUD_CLKID_FRDDR_C>;
+				resets = <&arb AXG_ARB_FRDDR_C>;
+				status = "disabled";
+			};
+
 			arb: reset-controller at 280 {
 				compatible = "amlogic,meson-axg-audio-arb";
 				reg = <0x0 0x280 0x0 0x4>;
Signature · 1 line
2.17.1
author reviewer
#6 lore raw

PATCH 6/14 arm64: dts: meson-axg: add spdifout

In reply to Jerome Brunet

Add the SPDIF output device of the axg audio subsystem

---
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +11 -0
index a20189844d92..c56016a48cc4 100644
@@ -263,6 +263,17 @@
 				#reset-cells = <1>;
 				clocks = <&clkc_audio AUD_CLKID_DDR_ARB>;
 			};
+
+			spdifout: audio-controller at 480 {
+				compatible = "amlogic,axg-spdifout";
+				reg = <0x0 0x480 0x0 0x50>;
+				#sound-dai-cells = <0>;
+				sound-name-prefix = "SPDIFOUT";
+				clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
+					 <&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
+				clock-names = "pclk", "mclk";
+				status = "disabled";
+			};
 		};
 
 		cbus: bus at ffd00000 {
Signature · 1 line
2.17.1
author reviewer
#7 lore raw

PATCH 7/14 arm64: dts: meson-axg: add tdmin formatters

In reply to Jerome Brunet

Add the tdm devices responsible for decoding the data provided through audio serial interface.

---
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 56 ++++++++++++++++++++++
 1 file changed, 56 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +56 -0
index c56016a48cc4..55e4ac734023 100644
@@ -264,6 +264,62 @@
 				clocks = <&clkc_audio AUD_CLKID_DDR_ARB>;
 			};
 
+			tdmin_a: audio-controller at 300 {
+				compatible = "amlogic,axg-tdmin";
+				reg = <0x0 0x300 0x0 0x40>;
+				sound-name-prefix = "TDMIN_A";
+				clocks = <&clkc_audio AUD_CLKID_TDMIN_A>,
+					 <&clkc_audio AUD_CLKID_TDMIN_A_SCLK>,
+					 <&clkc_audio AUD_CLKID_TDMIN_A_SCLK_SEL>,
+					 <&clkc_audio AUD_CLKID_TDMIN_A_LRCLK>,
+					 <&clkc_audio AUD_CLKID_TDMIN_A_LRCLK>;
+				clock-names = "pclk", "sclk", "sclk_sel",
+					      "lrclk", "lrclk_sel";
+				status = "disabled";
+			};
+
+			tdmin_b: audio-controller at 340 {
+				compatible = "amlogic,axg-tdmin";
+				reg = <0x0 0x340 0x0 0x40>;
+				sound-name-prefix = "TDMIN_B";
+				clocks = <&clkc_audio AUD_CLKID_TDMIN_B>,
+					 <&clkc_audio AUD_CLKID_TDMIN_B_SCLK>,
+					 <&clkc_audio AUD_CLKID_TDMIN_B_SCLK_SEL>,
+					 <&clkc_audio AUD_CLKID_TDMIN_B_LRCLK>,
+					 <&clkc_audio AUD_CLKID_TDMIN_B_LRCLK>;
+				clock-names = "pclk", "sclk", "sclk_sel",
+					      "lrclk", "lrclk_sel";
+				status = "disabled";
+			};
+
+			tdmin_c: audio-controller at 380 {
+				compatible = "amlogic,axg-tdmin";
+				reg = <0x0 0x380 0x0 0x40>;
+				sound-name-prefix = "TDMIN_C";
+				clocks = <&clkc_audio AUD_CLKID_TDMIN_C>,
+					 <&clkc_audio AUD_CLKID_TDMIN_C_SCLK>,
+					 <&clkc_audio AUD_CLKID_TDMIN_C_SCLK_SEL>,
+					 <&clkc_audio AUD_CLKID_TDMIN_C_LRCLK>,
+					 <&clkc_audio AUD_CLKID_TDMIN_C_LRCLK>;
+				clock-names = "pclk", "sclk", "sclk_sel",
+					      "lrclk", "lrclk_sel";
+				status = "disabled";
+			};
+
+			tdmin_lb: audio-controller at 3c0 {
+				compatible = "amlogic,axg-tdmin";
+				reg = <0x0 0x3c0 0x0 0x40>;
+				sound-name-prefix = "TDMIN_LB";
+				clocks = <&clkc_audio AUD_CLKID_TDMIN_LB>,
+					 <&clkc_audio AUD_CLKID_TDMIN_LB_SCLK>,
+					 <&clkc_audio AUD_CLKID_TDMIN_LB_SCLK_SEL>,
+					 <&clkc_audio AUD_CLKID_TDMIN_LB_LRCLK>,
+					 <&clkc_audio AUD_CLKID_TDMIN_LB_LRCLK>;
+				clock-names = "pclk", "sclk", "sclk_sel",
+					      "lrclk", "lrclk_sel";
+				status = "disabled";
+			};
+
 			spdifout: audio-controller at 480 {
 				compatible = "amlogic,axg-spdifout";
 				reg = <0x0 0x480 0x0 0x50>;
Signature · 1 line
2.17.1
author reviewer
#8 lore raw

PATCH 8/14 arm64: dts: meson-axg: add tdmout formatters

In reply to Jerome Brunet

Add the tdm devices responsible for serializing audio samples for i2s/tdm interfaces

---
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 42 ++++++++++++++++++++++
 1 file changed, 42 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +42 -0
index 55e4ac734023..67b6d4ec980e 100644
@@ -330,6 +330,48 @@
 				clock-names = "pclk", "mclk";
 				status = "disabled";
 			};
+
+			tdmout_a: audio-controller at 500 {
+				compatible = "amlogic,axg-tdmout";
+				reg = <0x0 0x500 0x0 0x40>;
+				sound-name-prefix = "TDMOUT_A";
+				clocks = <&clkc_audio AUD_CLKID_TDMOUT_A>,
+					 <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK>,
+					 <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK_SEL>,
+					 <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>,
+					 <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>;
+				clock-names = "pclk", "sclk", "sclk_sel",
+					      "lrclk", "lrclk_sel";
+				status = "disabled";
+			};
+
+			tdmout_b: audio-controller at 540 {
+				compatible = "amlogic,axg-tdmout";
+				reg = <0x0 0x540 0x0 0x40>;
+				sound-name-prefix = "TDMOUT_B";
+				clocks = <&clkc_audio AUD_CLKID_TDMOUT_B>,
+					 <&clkc_audio AUD_CLKID_TDMOUT_B_SCLK>,
+					 <&clkc_audio AUD_CLKID_TDMOUT_B_SCLK_SEL>,
+					 <&clkc_audio AUD_CLKID_TDMOUT_B_LRCLK>,
+					 <&clkc_audio AUD_CLKID_TDMOUT_B_LRCLK>;
+				clock-names = "pclk", "sclk", "sclk_sel",
+					      "lrclk", "lrclk_sel";
+				status = "disabled";
+			};
+
+			tdmout_c: audio-controller at 580 {
+				compatible = "amlogic,axg-tdmout";
+				reg = <0x0 0x580 0x0 0x40>;
+				sound-name-prefix = "TDMOUT_C";
+				clocks = <&clkc_audio AUD_CLKID_TDMOUT_C>,
+					 <&clkc_audio AUD_CLKID_TDMOUT_C_SCLK>,
+					 <&clkc_audio AUD_CLKID_TDMOUT_C_SCLK_SEL>,
+					 <&clkc_audio AUD_CLKID_TDMOUT_C_LRCLK>,
+					 <&clkc_audio AUD_CLKID_TDMOUT_C_LRCLK>;
+				clock-names = "pclk", "sclk", "sclk_sel",
+					      "lrclk", "lrclk_sel";
+				status = "disabled";
+			};
 		};
 
 		cbus: bus at ffd00000 {
Signature · 1 line
2.17.1
author reviewer
#9 lore raw

PATCH 9/14 arm64: dts: meson-axg: add tdm interfaces

In reply to Jerome Brunet

Add the devices reponsible for managing the i2s/tdm clocks and pads

---
 arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 33 ++++++++++++++++++++++
 1 file changed, 33 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg.dtsi +33 -0
index 67b6d4ec980e..32f6dcacc2bc 100644
@@ -93,6 +93,39 @@
 		method = "smc";
 	};
 
+	tdmif_a: audio-controller at 0 {
+		compatible = "amlogic,axg-tdm-iface";
+		#sound-dai-cells = <0>;
+		sound-name-prefix = "TDM_A";
+		clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK>,
+			 <&clkc_audio AUD_CLKID_MST_A_SCLK>,
+			 <&clkc_audio AUD_CLKID_MST_A_LRCLK>;
+		clock-names = "mclk", "sclk", "lrclk";
+		status = "disabled";
+	};
+
+	tdmif_b: audio-controller at 1 {
+		compatible = "amlogic,axg-tdm-iface";
+		#sound-dai-cells = <0>;
+		sound-name-prefix = "TDM_B";
+		clocks = <&clkc_audio AUD_CLKID_MST_B_MCLK>,
+			 <&clkc_audio AUD_CLKID_MST_B_SCLK>,
+			 <&clkc_audio AUD_CLKID_MST_B_LRCLK>;
+		clock-names = "mclk", "sclk", "lrclk";
+		status = "disabled";
+	};
+
+	tdmif_c: audio-controller at 2 {
+		compatible = "amlogic,axg-tdm-iface";
+		#sound-dai-cells = <0>;
+		sound-name-prefix = "TDM_C";
+		clocks = <&clkc_audio AUD_CLKID_MST_C_MCLK>,
+			 <&clkc_audio AUD_CLKID_MST_C_SCLK>,
+			 <&clkc_audio AUD_CLKID_MST_C_LRCLK>;
+		clock-names = "mclk", "sclk", "lrclk";
+		status = "disabled";
+	};
+
 	timer {
 		compatible = "arm,armv8-timer";
 		interrupts = <GIC_PPI 13
Signature · 1 line
2.17.1
author reviewer
#10 lore raw

PATCH 10/14 arm64: dts: meson-axg: add linein codec

In reply to Jerome Brunet

Add the es7241 analog to digital converter which is fed by the lienin jack of the s400

---
 arch/arm64/boot/dts/amlogic/meson-axg-s400.dts | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +10 -0
index 7489b88f27d7..fb101a1c6660 100644
@@ -178,6 +178,16 @@
 			gpios = <&gpio_speaker 2 0>;
 		};
 	};
+
+	linein: audio-codec at 0 {
+		#sound-dai-cells = <0>;
+		compatible = "everest,es7241";
+		VDDA-supply = <&vcc_3v3>;
+		VDDP-supply = <&vcc_3v3>;
+		VDDD-supply = <&vcc_3v3>;
+		status = "okay";
+		sound-name-prefix = "Linein";
+	};
 };
 
 &ethmac {
Signature · 1 line
2.17.1
#11 lore raw

Re: [PATCH 10/14] arm64: dts: meson-axg: add linein codec

Hi Jerome,

Quoted 14 lines · Jerome Brunet

Add the es7241 analog to digital converter which is fed by the lienin jack of the s400

---
 arch/arm64/boot/dts/amlogic/meson-axg-s400.dts | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +0 -0
index 7489b88f27d7..fb101a1c6660 100644

arch/arm64/boot/dts/amlogic/meson-axg-s400.dts line 182

Quoted 5 lines
arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +2 -0
@@ -178,6 +178,16 @@
                        gpios = <&gpio_speaker 2 0>;
                };
        };
+
+       linein: audio-codec at 0 {

there is a unit-address but no reg property - I am wondering if this is allowed? for the regulators we're using regulator-<unique-name> instead of regulator@<unique number>

(this applies to other patches in this series as well)

arch/arm64/boot/dts/amlogic/meson-axg-s400.dts line 189

Quoted 7 lines
arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +7 -0
+               #sound-dai-cells = <0>;
+               compatible = "everest,es7241";
+               VDDA-supply = <&vcc_3v3>;
+               VDDP-supply = <&vcc_3v3>;
+               VDDD-supply = <&vcc_3v3>;
+               status = "okay";
+               sound-name-prefix = "Linein";

SPDIF output uses capital letters "SPDIFOUT"
I am not familiar with the sound subsystem (thus I'm not sure where this shows up) so I am wondering if the naming should be consistent?

Regards
Martin

author reviewer
#12 lore raw

Re: [PATCH 10/14] arm64: dts: meson-axg: add linein codec

Quoted 27 lines · Martin Blumenstingl

Hi Jerome,

Quoted 14 lines · Jerome Brunet

Add the es7241 analog to digital converter which is fed by the lienin jack of the s400

---
 arch/arm64/boot/dts/amlogic/meson-axg-s400.dts | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +0 -0
index 7489b88f27d7..fb101a1c6660 100644

arch/arm64/boot/dts/amlogic/meson-axg-s400.dts line 182

Quoted 5 lines
arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +2 -0
@@ -178,6 +178,16 @@
                        gpios = <&gpio_speaker 2 0>;
                };
        };
+
+       linein: audio-codec at 0 {

there is a unit-address but no reg property - I am wondering if this is allowed? for the regulators we're using regulator-<unique-name> instead of regulator@<unique number>

Quoted 1 line

(this applies to other patches in this series as well)

I did that because I tried to keep node-name generic as described in the DT spec. The idea of numbering the nodes (without a reg property) in such a way came from :
Documentation/devicetree/bindings/sound/simple-card.txt:
=> look at the multi dai link example. I'm doing exactly the same on the axg card's dai-links. Nothing new here.

that being said, section 2.2.1 of the DT specs says:

" If the node has no reg property, the @unit-address must be omitted and the node-name alone differentiates the node from other nodes at the same level in the tree "

So apparently, this is used but not ok ?
I could make 'linein' the node-name instead of the label but that wouldn't be very generic.
We could also have dai-link-2 instead dai-link at 2 (audio-codec-3 instead of audio-codec at 3). I seems to be OK with the spec, but it also looks weird ...

Rob, do you have opinion on this ?

Quoted 9 lines

arch/arm64/boot/dts/amlogic/meson-axg-s400.dts line 189

Quoted 8 lines
arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +7 -0
+               #sound-dai-cells = <0>;
+               compatible = "everest,es7241";
+               VDDA-supply = <&vcc_3v3>;
+               VDDP-supply = <&vcc_3v3>;
+               VDDD-supply = <&vcc_3v3>;
+               status = "okay";
+               sound-name-prefix = "Linein";
Quoted 3 lines

SPDIF output uses capital letters "SPDIFOUT"
I am not familiar with the sound subsystem (thus I'm not sure where this shows up) so I am wondering if the naming should be consistent?

This string is used to prefix the name of the different widgets and controls provided. It is useful when several devices provides component and control with the same names. It happens when several instances of a component are used but also with classic names, such as "Playback"

I don't think there is a rule regarding capitalization.
Some name are all capital in ASoC, some just have the first letter in upper case. It doesn't change anything technically, and I personally don't care.

Quoted 3 lines

Regards
Martin

author reviewer
#13 lore raw

PATCH 11/14 arm64: dts: meson-axg: add lineout codec

In reply to Jerome Brunet

Add the es7154 digital to analog converter which supplies the lienout jack of the s400

---
 arch/arm64/boot/dts/amlogic/meson-axg-s400.dts | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +9 -0
index fb101a1c6660..d318647c86a7 100644
@@ -188,6 +188,15 @@
 		status = "okay";
 		sound-name-prefix = "Linein";
 	};
+
+	lineout: audio-codec at 1 {
+		#sound-dai-cells = <0>;
+		compatible = "everest,es7154";
+		VDD-supply = <&vcc_3v3>;
+		PVDD-supply = <&vcc_5v>;
+		status = "okay";
+		sound-name-prefix = "Lineout";
+	};
 };
 
 &ethmac {
Signature · 1 line
2.17.1
author reviewer
#14 lore raw

PATCH 12/14 arm64: dts: meson-axg: add spdif-dit codec

In reply to Jerome Brunet

Add the SPDIF playback codec to the axg s400 board

---
 arch/arm64/boot/dts/amlogic/meson-axg-s400.dts | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +7 -0
index d318647c86a7..d5c01427a5ca 100644
@@ -197,6 +197,13 @@
 		status = "okay";
 		sound-name-prefix = "Lineout";
 	};
+
+	spdif_dit: audio-codec at 2 {
+		#sound-dai-cells = <0>;
+		compatible = "linux,spdif-dit";
+		status = "okay";
+		sound-name-prefix = "DIT";
+	};
 };
 
 &ethmac {
Signature · 1 line
2.17.1
author reviewer
#15 lore raw

PATCH 13/14 arm64: dts: meson-axg: s400: enable audio devices

In reply to Jerome Brunet

Enable the audio devices on the s400.

---
 .../arm64/boot/dts/amlogic/meson-axg-s400.dts | 72 +++++++++++++++++++
 1 file changed, 72 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +72 -0
index d5c01427a5ca..9f5d81c3ee29 100644
@@ -226,6 +226,18 @@
 	};
 };
 
+&frddr_a {
+	status = "okay";
+};
+
+&frddr_b {
+	status = "okay";
+};
+
+&frddr_c {
+	status = "okay";
+};
+
 &uart_A {
 	status = "okay";
 	pinctrl-0 = <&uart_a_pins>;
@@ -334,3 +346,63 @@
 	status = "okay";
 	vref-supply = <&vddio_ao18>;
 };
+
+&spdifout {
+	pinctrl-0 = <&spdif_out_a20_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&tdmin_a {
+	status = "okay";
+};
+
+&tdmin_b {
+	status = "okay";
+};
+
+&tdmin_c {
+	status = "okay";
+};
+
+&tdmin_lb {
+	status = "okay";
+};
+
+&tdmout_c {
+	status = "okay";
+};
+
+&tdmif_a {
+	pinctrl-0 = <&tdma_sclk_pins>, <&tdma_fs_pins>,
+		    <&tdma_din0_pins>, <&tdma_dout0_x15_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&tdmif_b {
+	pinctrl-0 = <&tdmb_sclk_pins>, <&tdmb_fs_pins>,
+		    <&tdmb_din3_pins>, <&mclk_b_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&tdmif_c {
+	pinctrl-0 = <&tdmc_sclk_pins>, <&tdmc_fs_pins>,
+		    <&tdmc_din1_pins>, <&tdmc_dout2_pins>,
+		    <&mclk_c_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&toddr_a {
+	status = "okay";
+};
+
+&toddr_b {
+	status = "okay";
+};
+
+&toddr_c {
+	status = "okay";
+};
Signature · 1 line
2.17.1
author reviewer
#16 lore raw

PATCH 14/14 arm64: dts: meson-axg: add s400 sound card

In reply to Jerome Brunet

Add the sound card of the s400. With it the following interface should be working:
* Lineout
* Daugther card speaker 1 (same output as lineout)
* Linein
* SPDIF output

---

Compared to what is actually available on the platform, the following is not provided ATM:
* SPDIF input: WIP.
* PDM DMICs: WIP.
* TDM A - BT Codec: missing BT codec.
* TDM B - Speaker analog loopback: missing tlv320adc codec.

 .../arm64/boot/dts/amlogic/meson-axg-s400.dts | 108 ++++++++++++++++++
 1 file changed, 108 insertions(+)
arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +108 -0
index 9f5d81c3ee29..1b89c2cc5414 100644
@@ -204,6 +204,113 @@
 		status = "okay";
 		sound-name-prefix = "DIT";
 	};
+
+	sound {
+		compatible = "amlogic,axg-sound-card";
+		amlogic,name = "AXG-S400";
+		amlogic,aux-devs = <&tdmin_a>, <&tdmin_b>,  <&tdmin_c>,
+				   <&tdmin_lb>, <&tdmout_c>;
+		amlogic,widgets = "Line", "Lineout",
+				  "Line", "Linein",
+				  "Speaker", "Speaker1 Left",
+				  "Speaker", "Speaker1 Right";
+		amlogic,routing = "TDMOUT_C IN 0", "FRDDR_A OUT 2",
+				  "SPDIFOUT IN 0", "FRDDR_A OUT 3",
+				  "TDMOUT_C IN 1", "FRDDR_B OUT 2",
+				  "SPDIFOUT IN 1", "FRDDR_B OUT 3",
+				  "TDMOUT_C IN 2", "FRDDR_C OUT 2",
+				  "SPDIFOUT IN 2", "FRDDR_C OUT 3",
+				  "TDM_C Playback", "TDMOUT_C OUT",
+				  "TDMIN_A IN 2", "TDM_C Capture",
+				  "TDMIN_A IN 5", "TDM_C Loopback",
+				  "TDMIN_B IN 2", "TDM_C Capture",
+				  "TDMIN_B IN 5", "TDM_C Loopback",
+				  "TDMIN_C IN 2", "TDM_C Capture",
+				  "TDMIN_C IN 5", "TDM_C Loopback",
+				  "TDMIN_LB IN 2", "TDM_C Loopback",
+				  "TDMIN_LB IN 5", "TDM_C Capture",
+				  "TODDR_A IN 0", "TDMIN_A OUT",
+				  "TODDR_B IN 0", "TDMIN_A OUT",
+				  "TODDR_C IN 0", "TDMIN_A OUT",
+				  "TODDR_A IN 1", "TDMIN_B OUT",
+				  "TODDR_B IN 1", "TDMIN_B OUT",
+				  "TODDR_C IN 1", "TDMIN_B OUT",
+				  "TODDR_A IN 2", "TDMIN_C OUT",
+				  "TODDR_B IN 2", "TDMIN_C OUT",
+				  "TODDR_C IN 2", "TDMIN_C OUT",
+				  "TODDR_A IN 6", "TDMIN_LB OUT",
+				  "TODDR_B IN 6", "TDMIN_LB OUT",
+				  "TODDR_C IN 6", "TDMIN_LB OUT",
+				  "Lineout", "Lineout AOUTL",
+				  "Lineout", "Lineout AOUTR",
+				  "Speaker1 Left", "SPK1 OUT_A",
+				  "Speaker1 Left", "SPK1 OUT_B",
+				  "Speaker1 Right", "SPK1 OUT_C",
+				  "Speaker1 Right", "SPK1 OUT_D",
+				  "Linein AINL", "Linein",
+				  "Linein AINR", "Linein";
+		assigned-clocks = <&clkc CLKID_HIFI_PLL>,
+				  <&clkc CLKID_MPLL0>,
+				  <&clkc CLKID_MPLL1>;
+		assigned-clock-parents = <0>, <0>, <0>;
+		assigned-clock-rates = <589824000>,
+				       <270950400>,
+				       <393216000>;
+		status = "okay";
+
+		amlogic,dai-link at 0 {
+			sound-dai = <&frddr_a>;
+		};
+
+		amlogic,dai-link at 1 {
+			sound-dai = <&frddr_b>;
+		};
+
+		amlogic,dai-link at 2 {
+			sound-dai = <&frddr_c>;
+		};
+
+		amlogic,dai-link at 3 {
+			sound-dai = <&toddr_a>;
+		};
+
+		amlogic,dai-link at 4 {
+			sound-dai = <&toddr_b>;
+		};
+
+		amlogic,dai-link at 5 {
+			sound-dai = <&toddr_c>;
+		};
+
+		amlogic,dai-link at 6 {
+			sound-dai = <&tdmif_c>;
+			dai-format = "i2s";
+			dai-tdm-slot-tx-mask-2 = <1 1>;
+			dai-tdm-slot-rx-mask-1 = <1 1>;
+			mclk-fs = <256>;
+
+			codec at 0 {
+				sound-dai = <&lineout>;
+			};
+
+			codec at 1 {
+				sound-dai = <&speaker_amp1>;
+			};
+
+			codec at 2 {
+				sound-dai = <&linein>;
+			};
+
+		};
+
+		amlogic,dai-link at 7 {
+			sound-dai = <&spdifout>;
+
+			codec {
+				sound-dai = <&spdif_dit>;
+			};
+		};
+	};
 };
 
 &ethmac {
@@ -272,6 +379,7 @@
 		PVDD_B-supply = <&main_12v>;
 		PVDD_C-supply = <&main_12v>;
 		PVDD_D-supply = <&main_12v>;
+		sound-name-prefix = "SPK1";
 	};
 };
 
Signature · 1 line
2.17.1
#17 lore raw
In reply to Jerome Brunet

Hi Jerome,

Quoted 15 lines · Jerome Brunet

The main purpose of this patchset is to add the audio devices on amlogic's AXG SoCs.

Some codecs require some power supplies. This is why the 3 first patches deal with the S400 power supplies, even if some are not related to audio.

In term of dependency, apart from the clock bindings you have already pulled for your second PR to arm-soc, this patchset requires the ARB reset bindings [0] for patch 5. I don't know if Philip can make it available somewhere ?

Of course, if the dependencies make this patchset too complicated to merge in this cycle, I'll resubmit once the next rc1 is out.

Quoted 15 lines

Jerome Brunet (14):
arm64: dts: meson-axg: improve power supplies description
arm64: dts: meson-axg: add vcc 5v regulator on the s400
arm64: dts: meson-axg: add usb power regulator
arm64: dts: meson-axg: add audio arb reset controller
arm64: dts: meson-axg: add audio fifos
arm64: dts: meson-axg: add spdifout
arm64: dts: meson-axg: add tdmin formatters
arm64: dts: meson-axg: add tdmout formatters
arm64: dts: meson-axg: add tdm interfaces
arm64: dts: meson-axg: add linein codec
arm64: dts: meson-axg: add lineout codec
arm64: dts: meson-axg: add spdif-dit codec
arm64: dts: meson-axg: s400: enable audio devices
arm64: dts: meson-axg: add s400 sound card

nit-pick: one patch uses "arm64: dts: meson-axg: s400" in the subject while other patches that are touching the s400 board aren't if you have to re-send this series: can you please use the "arm64:
dts: meson-axg: s400:" prefix for all patches touching the s400 board?

Thank you!
Regards
Martin

author reviewer
#18 lore raw
Quoted 4 lines · Martin Blumenstingl

nit-pick: one patch uses "arm64: dts: meson-axg: s400" in the subject while other patches that are touching the s400 board aren't if you have to re-send this series: can you please use the "arm64:
dts: meson-axg: s400:" prefix for all patches touching the s400 board?

hum, do we really have such rule, or do you think we should add one ? Kevin, do you have opinion ?

Not that I really mind either way, but prefixes rules are usually there to help maintainer filter the patches. Will such rule help in any way ?

#19 lore raw

Hi Jerome,

Quoted 8 lines · On Wed, Jul 25, 2018 at 11:19 PM <[email protected]> wrote:
Quoted 4 lines · Martin Blumenstingl

nit-pick: one patch uses "arm64: dts: meson-axg: s400" in the subject while other patches that are touching the s400 board aren't if you have to re-send this series: can you please use the "arm64:
dts: meson-axg: s400:" prefix for all patches touching the s400 board?

hum, do we really have such rule, or do you think we should add one ?

looking at the git history in arch/arm64/boot/dts/amlogic: it seems that we don't have a rule yet, even though some (some of your's/Neil's/my) patches were using that naming schema in the past

Quoted 4 lines

Kevin, do you have opinion ?

Not that I really mind either way, but prefixes rules are usually there to help maintainer filter the patches. Will such rule help in any way ?

maybe it's just a problem of a false initial impression
I read "arm64: dts: meson-axg: add usb power regulator" in the cover-letter and came to the conclusion that this patch must be wrong since meson-axg.dtsi should not have any regulators (unless they're built into the SoC). only when looking at the patch itself I realized that it's fine because it patches the s400.dts

Regards
Martin

maintainer
#20 lore raw
Quoted 17 lines · Martin Blumenstingl

Hi Jerome,

Quoted 8 lines · On Wed, Jul 25, 2018 at 11:19 PM <[email protected]> wrote:
Quoted 4 lines · Martin Blumenstingl

nit-pick: one patch uses "arm64: dts: meson-axg: s400" in the subject while other patches that are touching the s400 board aren't if you have to re-send this series: can you please use the "arm64:
dts: meson-axg: s400:" prefix for all patches touching the s400 board?

hum, do we really have such rule, or do you think we should add one ?

looking at the git history in arch/arm64/boot/dts/amlogic: it seems that we don't have a rule yet, even though some (some of your's/Neil's/my) patches were using that naming schema in the past

Quoted 2 lines

Kevin, do you have opinion ?

Quoted 8 lines
Quoted 2 lines

Not that I really mind either way, but prefixes rules are usually there to help maintainer filter the patches. Will such rule help in any way ?

maybe it's just a problem of a false initial impression
I read "arm64: dts: meson-axg: add usb power regulator" in the cover-letter and came to the conclusion that this patch must be wrong since meson-axg.dtsi should not have any regulators (unless they're built into the SoC). only when looking at the patch itself I realized that it's fine because it patches the s400.dts

I actually had the same first impression problem. At first glance, it looks like all the patches are AXG-generic, and only the 2 that mention s400 apply to the board.

So, if this needs a respin, I'd prefer the board name where appropriate, but it's not something I'm going to be picky about.

Kevin