diff mbox series

[6/6] mt8395-radxa-nio-12l: Add sound node for headphone

Message ID 20250417-mt8395-audio-sof-v1-6-30587426e5dd@collabora.com (mailing list archive)
State New
Headers show
Series ASoC: mt8195: Add support for MT8395 Radxa NIO 12L with MT6359 codec | expand

Commit Message

Julien Massot April 17, 2025, 8:44 a.m. UTC
- Add memory-region based on mt8390-genio-common
- Enable adsp node
- Enable afe node
- Declare the required pins
- Add sound node for headphone output routing

Signed-off-by: Julien Massot <julien.massot@collabora.com>
---
 .../boot/dts/mediatek/mt8395-radxa-nio-12l.dts     | 58 +++++++++++++++++++++-
 1 file changed, 56 insertions(+), 2 deletions(-)

Comments

AngeloGioacchino Del Regno April 17, 2025, 10:20 a.m. UTC | #1
Il 17/04/25 10:44, Julien Massot ha scritto:
> - Add memory-region based on mt8390-genio-common
> - Enable adsp node
> - Enable afe node
> - Declare the required pins
> - Add sound node for headphone output routing
> 
> Signed-off-by: Julien Massot <julien.massot@collabora.com>

Please stick with the usual prefixes.

arm64: dts: mediatek: mt8395-nio-12l: Enable Audio DSP and sound card

Also, the commit description should not be a list of things, but rather
something that explains what you're doing fluently.

"Add a memory region for xyz, enable the Audio DSP and AFE nodes and
assign them to the newly enabled sound card node along with the required
pin configuration to achieve sound output to the 3.5mm headphone jack
found on this board."

Reword to your liking, that was just an example.

Cheers,
Angelo

> ---
>   .../boot/dts/mediatek/mt8395-radxa-nio-12l.dts     | 58 +++++++++++++++++++++-
>   1 file changed, 56 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
> index f2eb1b683eb76f783f5a13f28a78f6e33238b5f0..329c60cc6a6be0b4be8c0b8bb033b32d35302804 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
> @@ -139,9 +139,21 @@ bl31_secmon_mem: memory@54600000 {
>   			no-map;
>   		};
>   
> -		afe_mem: memory@60000000 {
> +		adsp_mem: memory@60000000 {
>   			compatible = "shared-dma-pool";
> -			reg = <0 0x60000000 0 0x1100000>;
> +			reg = <0 0x60000000 0 0xf00000>;
> +			no-map;
> +		};
> +
> +		afe_dma_mem: memory@60f00000 {
> +			compatible = "shared-dma-pool";
> +			reg = <0 0x60f00000 0 0x100000>;
> +			no-map;
> +		};
> +
> +		adsp_dma_mem: memory@61000000 {
> +			compatible = "shared-dma-pool";
> +			reg = <0 0x61000000 0 0x100000>;
>   			no-map;
>   		};
>   
> @@ -152,6 +164,16 @@ apu_mem: memory@62000000 {
>   	};
>   };
>   
> +&adsp {
> +	memory-region = <&adsp_dma_mem>, <&adsp_mem>;
> +	status = "okay";
> +};
> +
> +&afe {
> +	memory-region = <&afe_dma_mem>;
> +	status = "okay";
> +};
> +
>   &cpu0 {
>   	cpu-supply = <&mt6359_vcore_buck_reg>;
>   };
> @@ -514,6 +536,18 @@ &mt6359_vsram_others_ldo_reg {
>   &pio {
>   	mediatek,rsel-resistance-in-si-unit;
>   
> +	audio_default_pins: audio-default-pins {
> +		pins-cmd-dat {
> +			pinmux = <PINMUX_GPIO70__FUNC_AUD_SYNC_MOSI>,
> +				 <PINMUX_GPIO69__FUNC_AUD_CLK_MOSI>,
> +				 <PINMUX_GPIO71__FUNC_AUD_DAT_MOSI0>,
> +				 <PINMUX_GPIO72__FUNC_AUD_DAT_MOSI1>,
> +				 <PINMUX_GPIO73__FUNC_AUD_DAT_MISO0>,
> +				 <PINMUX_GPIO74__FUNC_AUD_DAT_MISO1>,
> +				 <PINMUX_GPIO75__FUNC_AUD_DAT_MISO2>;
> +		};
> +	};
> +
>   	dsi0_backlight_pins: dsi0-backlight-pins {
>   		pins-backlight-en {
>   			pinmux = <PINMUX_GPIO107__FUNC_GPIO107>;
> @@ -854,6 +888,26 @@ &scp {
>   	status = "okay";
>   };
>   
> +&sound {
> +	compatible = "mediatek,mt8195_mt6359";
> +	model = "mt8395-evk";
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&audio_default_pins>;
> +	audio-routing =
> +		"Headphone", "Headphone L",
> +		"Headphone", "Headphone R";
> +	mediatek,adsp = <&adsp>;
> +	status = "okay";
> +
> +	headphone-dai-link {
> +		link-name = "DL_SRC_BE";
> +
> +		codec {
> +			sound-dai = <&pmic 0>;
> +		};
> +	};
> +};
> +
>   &spi1 {
>   	/* Exposed at 40 pin connector */
>   	pinctrl-0 = <&spi1_pins>;
>
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
index f2eb1b683eb76f783f5a13f28a78f6e33238b5f0..329c60cc6a6be0b4be8c0b8bb033b32d35302804 100644
--- a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
@@ -139,9 +139,21 @@  bl31_secmon_mem: memory@54600000 {
 			no-map;
 		};
 
-		afe_mem: memory@60000000 {
+		adsp_mem: memory@60000000 {
 			compatible = "shared-dma-pool";
-			reg = <0 0x60000000 0 0x1100000>;
+			reg = <0 0x60000000 0 0xf00000>;
+			no-map;
+		};
+
+		afe_dma_mem: memory@60f00000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x60f00000 0 0x100000>;
+			no-map;
+		};
+
+		adsp_dma_mem: memory@61000000 {
+			compatible = "shared-dma-pool";
+			reg = <0 0x61000000 0 0x100000>;
 			no-map;
 		};
 
@@ -152,6 +164,16 @@  apu_mem: memory@62000000 {
 	};
 };
 
+&adsp {
+	memory-region = <&adsp_dma_mem>, <&adsp_mem>;
+	status = "okay";
+};
+
+&afe {
+	memory-region = <&afe_dma_mem>;
+	status = "okay";
+};
+
 &cpu0 {
 	cpu-supply = <&mt6359_vcore_buck_reg>;
 };
@@ -514,6 +536,18 @@  &mt6359_vsram_others_ldo_reg {
 &pio {
 	mediatek,rsel-resistance-in-si-unit;
 
+	audio_default_pins: audio-default-pins {
+		pins-cmd-dat {
+			pinmux = <PINMUX_GPIO70__FUNC_AUD_SYNC_MOSI>,
+				 <PINMUX_GPIO69__FUNC_AUD_CLK_MOSI>,
+				 <PINMUX_GPIO71__FUNC_AUD_DAT_MOSI0>,
+				 <PINMUX_GPIO72__FUNC_AUD_DAT_MOSI1>,
+				 <PINMUX_GPIO73__FUNC_AUD_DAT_MISO0>,
+				 <PINMUX_GPIO74__FUNC_AUD_DAT_MISO1>,
+				 <PINMUX_GPIO75__FUNC_AUD_DAT_MISO2>;
+		};
+	};
+
 	dsi0_backlight_pins: dsi0-backlight-pins {
 		pins-backlight-en {
 			pinmux = <PINMUX_GPIO107__FUNC_GPIO107>;
@@ -854,6 +888,26 @@  &scp {
 	status = "okay";
 };
 
+&sound {
+	compatible = "mediatek,mt8195_mt6359";
+	model = "mt8395-evk";
+	pinctrl-names = "default";
+	pinctrl-0 = <&audio_default_pins>;
+	audio-routing =
+		"Headphone", "Headphone L",
+		"Headphone", "Headphone R";
+	mediatek,adsp = <&adsp>;
+	status = "okay";
+
+	headphone-dai-link {
+		link-name = "DL_SRC_BE";
+
+		codec {
+			sound-dai = <&pmic 0>;
+		};
+	};
+};
+
 &spi1 {
 	/* Exposed at 40 pin connector */
 	pinctrl-0 = <&spi1_pins>;