Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: mt8195: Add support for MT8395 Radxa NIO 12L

Merge series from Julien Massot <julien.massot@collabora.com>:

This patch series adds support for audio playback on the MT8395-based Radxa NIO 12L platform, which uses the integrated MT6359 codec via internal DAI links.

Key additions:
- Support for a new `mediatek,mt8195_mt6359` card configuration that does not rely on external codecs like rt5682.
- Proper memory region declarations and pinctrl setup for the audio front-end (AFE) and audio DSP (ADSP).
- A device tree sound node for headphone audio routing using `DL_SRC_BE` and `AIF1`.
- Enhancements to the DT bindings to document the new compatible string, missing link-name, and additional audio routes (Headphone L/R).

+36 -7
+4
Documentation/devicetree/bindings/sound/mt8195-mt6359.yaml
··· 21 21 - mediatek,mt8195_mt6359_rt1019_rt5682 22 22 - mediatek,mt8195_mt6359_rt1011_rt5682 23 23 - mediatek,mt8195_mt6359_max98390_rt5682 24 + - mediatek,mt8195_mt6359 24 25 25 26 model: 26 27 $ref: /schemas/types.yaml#/definitions/string ··· 45 44 - Right Spk 46 45 47 46 # Sources 47 + - Headphone L 48 + - Headphone R 48 49 - Headset Mic 49 50 - HPOL 50 51 - HPOR ··· 91 88 link-name: 92 89 description: Indicates dai-link name and PCM stream name 93 90 enum: 91 + - DL_SRC_BE 94 92 - DPTX_BE 95 93 - ETDM1_IN_BE 96 94 - ETDM2_IN_BE
+32 -7
sound/soc/mediatek/mt8195/mt8195-mt6359.c
··· 92 92 }; 93 93 94 94 static const struct snd_soc_dapm_route mt8195_mt6359_routes[] = { 95 - /* headset */ 96 - { "Headphone", NULL, "HPOL" }, 97 - { "Headphone", NULL, "HPOR" }, 98 - { "IN1P", NULL, "Headset Mic" }, 99 95 /* SOF Uplink */ 100 96 {SOF_DMA_UL4, NULL, "O034"}, 101 97 {SOF_DMA_UL4, NULL, "O035"}, ··· 125 129 126 130 static const struct snd_kcontrol_new mt8195_speaker_controls[] = { 127 131 SOC_DAPM_PIN_SWITCH("Ext Spk"), 132 + }; 133 + 134 + static const struct snd_soc_dapm_route mt8195_rt5682_routes[] = { 135 + /* headset */ 136 + { "Headphone", NULL, "HPOL" }, 137 + { "Headphone", NULL, "HPOR" }, 138 + { "IN1P", NULL, "Headset Mic" }, 128 139 }; 129 140 130 141 static const struct snd_soc_dapm_route mt8195_rt1011_routes[] = { ··· 450 447 snd_soc_rtdcom_lookup(rtd, AFE_PCM_NAME); 451 448 struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt_afe); 452 449 struct mt8195_afe_private *afe_priv = afe->platform_priv; 450 + struct snd_soc_card *card = rtd->card; 453 451 int ret; 454 452 455 453 priv->i2so1_mclk = afe_priv->clk[MT8195_CLK_TOP_APLL12_DIV2]; ··· 477 473 return ret; 478 474 } 479 475 480 - return 0; 476 + ret = snd_soc_dapm_add_routes(&card->dapm, mt8195_rt5682_routes, 477 + ARRAY_SIZE(mt8195_rt5682_routes)); 478 + if (ret) 479 + dev_err(rtd->dev, "unable to add dapm routes, ret %d\n", ret); 480 + 481 + return ret; 481 482 }; 482 483 483 484 static int mt8195_rt1011_etdm_hw_params(struct snd_pcm_substream *substream, ··· 831 822 832 823 SND_SOC_DAILINK_DEFS(ETDM2_IN_BE, 833 824 DAILINK_COMP_ARRAY(COMP_CPU("ETDM2_IN")), 834 - DAILINK_COMP_ARRAY(COMP_EMPTY()), 825 + DAILINK_COMP_ARRAY(COMP_DUMMY()), 835 826 DAILINK_COMP_ARRAY(COMP_EMPTY())); 836 827 837 828 SND_SOC_DAILINK_DEFS(ETDM1_OUT_BE, 838 829 DAILINK_COMP_ARRAY(COMP_CPU("ETDM1_OUT")), 839 - DAILINK_COMP_ARRAY(COMP_EMPTY()), 830 + DAILINK_COMP_ARRAY(COMP_DUMMY()), 840 831 DAILINK_COMP_ARRAY(COMP_EMPTY())); 841 832 842 833 SND_SOC_DAILINK_DEFS(ETDM2_OUT_BE, ··· 1524 1515 .soc_probe = mt8195_mt6359_soc_card_probe 1525 1516 }; 1526 1517 1518 + static const struct mtk_soundcard_pdata mt8195_mt6359_card = { 1519 + .card_name = "mt8195_mt6359", 1520 + .card_data = &(struct mtk_platform_card_data) { 1521 + .card = &mt8195_mt6359_soc_card, 1522 + .num_jacks = MT8195_JACK_MAX, 1523 + .pcm_constraints = mt8195_pcm_constraints, 1524 + .num_pcm_constraints = ARRAY_SIZE(mt8195_pcm_constraints), 1525 + }, 1526 + .sof_priv = &mt8195_sof_priv, 1527 + .soc_probe = mt8195_mt6359_soc_card_probe 1528 + }; 1529 + 1527 1530 static const struct of_device_id mt8195_mt6359_dt_match[] = { 1528 1531 { 1529 1532 .compatible = "mediatek,mt8195_mt6359_rt1019_rt5682", ··· 1548 1527 { 1549 1528 .compatible = "mediatek,mt8195_mt6359_max98390_rt5682", 1550 1529 .data = &mt8195_mt6359_max98390_rt5682_card, 1530 + }, 1531 + { 1532 + .compatible = "mediatek,mt8195_mt6359", 1533 + .data = &mt8195_mt6359_card, 1551 1534 }, 1552 1535 {}, 1553 1536 };