Il 19/10/23 04:11, xiazhengqiao ha scritto:
To use RT5650 as the codec and the amp, add a new
sound card named mt8186_rt5650.
Signed-off-by: xiazhengqiao <xiazhengqiao@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
---
sound/soc/mediatek/Kconfig | 1 +
.../mt8186/mt8186-mt6366-rt1019-rt5682s.c | 45 ++++++++++++++++++-
2 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig
index 43c8fea00439..b93d455744ab 100644
--- a/sound/soc/mediatek/Kconfig
+++ b/sound/soc/mediatek/Kconfig
@@ -210,6 +210,7 @@ config SND_SOC_MT8186_MT6366_RT1019_RT5682S
select SND_SOC_MAX98357A
select SND_SOC_RT1015P
select SND_SOC_RT5682S
+ select SND_SOC_RT5645
select SND_SOC_BT_SCO
select SND_SOC_DMIC
select SND_SOC_HDMI_CODEC
diff --git a/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c b/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c
index 4684bfd89ecd..8c534c338f0e 100644
--- a/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c
+++ b/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c
@@ -170,6 +170,7 @@ static int mt8186_rt5682s_init(struct snd_soc_pcm_runtime *rtd)
struct snd_soc_component *cmpnt_codec =
snd_soc_rtd_to_codec(rtd, 0)->component;
int ret;
+ int type;
ret = mt8186_dai_i2s_set_share(afe, "I2S1", "I2S0");
if (ret) {
@@ -193,7 +194,8 @@ static int mt8186_rt5682s_init(struct snd_soc_pcm_runtime *rtd)
snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
- return snd_soc_component_set_jack(cmpnt_codec, jack, NULL);
+ type = SND_JACK_HEADSET | SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2 | SND_JACK_BTN_3;
+ return snd_soc_component_set_jack(cmpnt_codec, jack, (void *)&type);
}
static int mt8186_rt5682s_i2s_hw_params(struct snd_pcm_substream *substream,
@@ -1058,6 +1060,28 @@ mt8186_mt6366_rt1019_rt5682s_routes[] = {
{"DSP_DL2_VIRT", NULL, SOF_DMA_DL2},
};
+static const struct snd_soc_dapm_route
+mt8186_mt6366_rt5650_routes[] = {
This fits in one line, please fix.
After which,
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>