select SND_SOC_MT6359
select SND_SOC_RT1015P
select SND_SOC_RT5682_I2C
+ select SND_SOC_RT5682S
select SND_SOC_DMIC
select SND_SOC_HDMI_CODEC
help
select SND_SOC_MT6359
select SND_SOC_RT1011
select SND_SOC_RT5682_I2C
+ select SND_SOC_RT5682S
select SND_SOC_DMIC
select SND_SOC_HDMI_CODEC
help
#define RT5682_CODEC_DAI "rt5682-aif1"
#define RT5682_DEV0_NAME "rt5682.2-001a"
+#define RT5682S_CODEC_DAI "rt5682s-aif1"
+#define RT5682S_DEV0_NAME "rt5682s.2-001a"
+
struct mt8195_mt6359_rt1011_rt5682_priv {
struct device_node *platform_node;
struct device_node *hdmi_node;
SND_SOC_DAILINK_DEFS(ETDM2_IN_BE,
DAILINK_COMP_ARRAY(COMP_CPU("ETDM2_IN")),
- DAILINK_COMP_ARRAY(COMP_CODEC(RT5682_DEV0_NAME,
- RT5682_CODEC_DAI)),
+ DAILINK_COMP_ARRAY(COMP_DUMMY()),
DAILINK_COMP_ARRAY(COMP_EMPTY()));
SND_SOC_DAILINK_DEFS(ETDM1_OUT_BE,
DAILINK_COMP_ARRAY(COMP_CPU("ETDM1_OUT")),
- DAILINK_COMP_ARRAY(COMP_CODEC(RT5682_DEV0_NAME,
- RT5682_CODEC_DAI)),
+ DAILINK_COMP_ARRAY(COMP_DUMMY()),
DAILINK_COMP_ARRAY(COMP_EMPTY()));
SND_SOC_DAILINK_DEFS(ETDM2_OUT_BE,
struct snd_soc_card *card = &mt8195_mt6359_rt1011_rt5682_soc_card;
struct snd_soc_dai_link *dai_link;
struct mt8195_mt6359_rt1011_rt5682_priv *priv;
+ int is5682s = 0;
int ret, i;
card->dev = &pdev->dev;
+ ret = snd_soc_of_parse_card_name(card, "model");
+ if (ret) {
+ dev_err(&pdev->dev, "%s new card name parsing error %d\n",
+ __func__, ret);
+ return ret;
+ }
+
+ if (strstr(card->name, "_5682s"))
+ is5682s = 1;
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
dai_link->codecs->dai_name = "i2s-hifi";
dai_link->init = mt8195_dptx_codec_init;
}
- }
-
- if (strcmp(dai_link->name, "ETDM3_OUT_BE") == 0) {
+ } else if (strcmp(dai_link->name, "ETDM3_OUT_BE") == 0) {
priv->hdmi_node =
of_parse_phandle(pdev->dev.of_node,
"mediatek,hdmi-codec", 0);
dai_link->codecs->dai_name = "i2s-hifi";
dai_link->init = mt8195_hdmi_codec_init;
}
+ } else if (strcmp(dai_link->name, "ETDM1_OUT_BE") == 0 ||
+ strcmp(dai_link->name, "ETDM2_IN_BE") == 0) {
+ dai_link->codecs->name =
+ is5682s ? RT5682S_DEV0_NAME : RT5682_DEV0_NAME;
+ dai_link->codecs->dai_name =
+ is5682s ? RT5682S_CODEC_DAI : RT5682_CODEC_DAI;
}
}
#define RT5682_CODEC_DAI "rt5682-aif1"
#define RT5682_DEV0_NAME "rt5682.2-001a"
+#define RT5682S_CODEC_DAI "rt5682s-aif1"
+#define RT5682S_DEV0_NAME "rt5682s.2-001a"
+
struct mt8195_mt6359_rt1019_rt5682_priv {
struct device_node *platform_node;
struct device_node *hdmi_node;
SND_SOC_DAILINK_DEFS(ETDM2_IN_BE,
DAILINK_COMP_ARRAY(COMP_CPU("ETDM2_IN")),
- DAILINK_COMP_ARRAY(COMP_CODEC(RT5682_DEV0_NAME,
- RT5682_CODEC_DAI)),
+ DAILINK_COMP_ARRAY(COMP_DUMMY()),
DAILINK_COMP_ARRAY(COMP_EMPTY()));
SND_SOC_DAILINK_DEFS(ETDM1_OUT_BE,
DAILINK_COMP_ARRAY(COMP_CPU("ETDM1_OUT")),
- DAILINK_COMP_ARRAY(COMP_CODEC(RT5682_DEV0_NAME,
- RT5682_CODEC_DAI)),
+ DAILINK_COMP_ARRAY(COMP_DUMMY()),
DAILINK_COMP_ARRAY(COMP_EMPTY()));
SND_SOC_DAILINK_DEFS(ETDM2_OUT_BE,
struct snd_soc_card *card = &mt8195_mt6359_rt1019_rt5682_soc_card;
struct snd_soc_dai_link *dai_link;
struct mt8195_mt6359_rt1019_rt5682_priv *priv;
+ int is5682s = 0;
int ret, i;
card->dev = &pdev->dev;
+ ret = snd_soc_of_parse_card_name(card, "model");
+ if (ret) {
+ dev_err(&pdev->dev, "%s new card name parsing error %d\n",
+ __func__, ret);
+ return ret;
+ }
+
+ if (strstr(card->name, "_5682s"))
+ is5682s = 1;
+
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
dai_link->codecs->dai_name = "i2s-hifi";
dai_link->init = mt8195_dptx_codec_init;
}
- }
-
- if (strcmp(dai_link->name, "ETDM3_OUT_BE") == 0) {
+ } else if (strcmp(dai_link->name, "ETDM3_OUT_BE") == 0) {
priv->hdmi_node =
of_parse_phandle(pdev->dev.of_node,
"mediatek,hdmi-codec", 0);
dai_link->codecs->dai_name = "i2s-hifi";
dai_link->init = mt8195_hdmi_codec_init;
}
+ } else if (strcmp(dai_link->name, "ETDM1_OUT_BE") == 0 ||
+ strcmp(dai_link->name, "ETDM2_IN_BE") == 0) {
+ dai_link->codecs->name =
+ is5682s ? RT5682S_DEV0_NAME : RT5682_DEV0_NAME;
+ dai_link->codecs->dai_name =
+ is5682s ? RT5682S_CODEC_DAI : RT5682_CODEC_DAI;
}
}