]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
arm64: dts: mediatek: mt8395-nio-12l: Enable Audio DSP and sound card
authorJulien Massot <julien.massot@collabora.com>
Wed, 23 Apr 2025 08:53:13 +0000 (10:53 +0200)
committerAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Wed, 23 Apr 2025 10:19:21 +0000 (12:19 +0200)
Add memory regions for the Audio DSP (ADSP) and Audio Front-End (AFE),
and enable both components in the device tree.

Also, define the required pin configuration and add a sound card node
configured to use the ADSP. This enables audio output through the 3.5mm
headphone jack available on the board.

Signed-off-by: Julien Massot <julien.massot@collabora.com>
Link: https://lore.kernel.org/r/20250423-mt8395-audio-sof-v2-1-5e6dc7fba0fc@collabora.com
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts

index f2eb1b683eb76f783f5a13f28a78f6e33238b5f0..329c60cc6a6be0b4be8c0b8bb033b32d35302804 100644 (file)
                        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;
                };
 
        };
 };
 
+&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>;
 };
 &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>;
        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>;