summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-07-21 20:16:08 +0100
committerMark Brown <broonie@kernel.org>2026-07-21 20:16:08 +0100
commitbeb41b8b14fd96d97f328fb8d0544bfac3a00a78 (patch)
treedb0f7907e6cc97d3dc53c05be1fef07d8221de8a
parent18a44e70450a22d479c5ccce33dffa8a65bf30d9 (diff)
parent7a8073fe03bbc77aa6adf71ec8c76cf6ad03c498 (diff)
downloadlinux-next-beb41b8b14fd96d97f328fb8d0544bfac3a00a78.tar.gz
linux-next-beb41b8b14fd96d97f328fb8d0544bfac3a00a78.zip
ASoC: mediatek: preparation for Card capsuling
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> says: I will post Card capsuling patch. To makes its review easy, tidyup mediatek drivers to reduce un-related diff as preparation. No functional change, but is preparation for cleanup driver. Link: https://patch.msgid.link/8733xdjfdq.wl-kuninori.morimoto.gx@renesas.com
-rw-r--r--sound/soc/mediatek/common/mtk-dsp-sof-common.c7
-rw-r--r--sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c12
-rw-r--r--sound/soc/mediatek/mt8196/mt8196-nau8825.c2
-rw-r--r--sound/soc/mediatek/mt8365/mt8365-mt6357.c1
4 files changed, 10 insertions, 12 deletions
diff --git a/sound/soc/mediatek/common/mtk-dsp-sof-common.c b/sound/soc/mediatek/common/mtk-dsp-sof-common.c
index 17b9ea6be604..adefbed5bbe7 100644
--- a/sound/soc/mediatek/common/mtk-dsp-sof-common.c
+++ b/sound/soc/mediatek/common/mtk-dsp-sof-common.c
@@ -232,6 +232,7 @@ int mtk_sof_dailink_parse_of(struct device *dev, struct snd_soc_card *card,
const char *propname)
{
struct device_node *np = dev->of_node;
+ struct snd_soc_dai_link *dai_link;
struct snd_soc_dai_link *parsed_dai_link;
const char *dai_name = NULL;
int i, j, ret, num_links, parsed_num_links = 0;
@@ -254,9 +255,9 @@ int mtk_sof_dailink_parse_of(struct device *dev, struct snd_soc_card *card,
return ret;
}
dev_dbg(dev, "ASoC: Property get dai_name:%s\n", dai_name);
- for (j = 0; j < card->num_links; j++) {
- if (!strcmp(dai_name, card->dai_link[j].name)) {
- memcpy(&parsed_dai_link[parsed_num_links++], &card->dai_link[j],
+ for_each_card_prelinks(card, j, dai_link) {
+ if (!strcmp(dai_name, dai_link->name)) {
+ memcpy(&parsed_dai_link[parsed_num_links++], dai_link,
sizeof(struct snd_soc_dai_link));
break;
}
diff --git a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
index 91c57765ab57..864b4d7228f5 100644
--- a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
+++ b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c
@@ -1019,7 +1019,7 @@ static struct snd_soc_card mt8192_mt6359_rt1015p_rt5682x_card = {
.num_dapm_routes = ARRAY_SIZE(mt8192_mt6359_rt1015p_rt5682x_routes),
};
-static int mt8192_mt6359_card_set_be_link(struct snd_soc_card *card,
+static int mt8192_mt6359_card_set_be_link(struct device *dev,
struct snd_soc_dai_link *link,
struct device_node *node,
char *link_name)
@@ -1027,9 +1027,9 @@ static int mt8192_mt6359_card_set_be_link(struct snd_soc_card *card,
int ret;
if (node && strcmp(link->name, link_name) == 0) {
- ret = snd_soc_of_get_dai_link_codecs(card->dev, node, link);
+ ret = snd_soc_of_get_dai_link_codecs(dev, node, link);
if (ret < 0) {
- dev_err_probe(card->dev, ret, "get dai link codecs fail\n");
+ dev_err_probe(dev, ret, "get dai link codecs fail\n");
return ret;
}
}
@@ -1065,21 +1065,21 @@ static int mt8192_mt6359_legacy_probe(struct mtk_soc_card_data *soc_card_data)
}
for_each_card_prelinks(card, i, dai_link) {
- ret = mt8192_mt6359_card_set_be_link(card, dai_link, speaker_codec, "I2S3");
+ ret = mt8192_mt6359_card_set_be_link(dev, dai_link, speaker_codec, "I2S3");
if (ret) {
dev_err_probe(dev, ret, "%s set speaker_codec fail\n",
dai_link->name);
break;
}
- ret = mt8192_mt6359_card_set_be_link(card, dai_link, headset_codec, "I2S8");
+ ret = mt8192_mt6359_card_set_be_link(dev, dai_link, headset_codec, "I2S8");
if (ret) {
dev_err_probe(dev, ret, "%s set headset_codec fail\n",
dai_link->name);
break;
}
- ret = mt8192_mt6359_card_set_be_link(card, dai_link, headset_codec, "I2S9");
+ ret = mt8192_mt6359_card_set_be_link(dev, dai_link, headset_codec, "I2S9");
if (ret) {
dev_err_probe(dev, ret, "%s set headset_codec fail\n",
dai_link->name);
diff --git a/sound/soc/mediatek/mt8196/mt8196-nau8825.c b/sound/soc/mediatek/mt8196/mt8196-nau8825.c
index c9424786c53d..8303ab960f80 100644
--- a/sound/soc/mediatek/mt8196/mt8196-nau8825.c
+++ b/sound/soc/mediatek/mt8196/mt8196-nau8825.c
@@ -104,8 +104,6 @@ static const struct snd_kcontrol_new mt8196_nau8825_controls[] = {
#define EXT_SPK_AMP_W_NAME "Ext_Speaker_Amp"
-static struct snd_soc_card mt8196_nau8825_soc_card;
-
static const struct snd_soc_dapm_widget mt8196_nau8825_card_widgets[] = {
/* SOF Uplink */
SND_SOC_DAPM_MIXER("SOF_DMA_UL0", SND_SOC_NOPM, 0, 0, NULL, 0),
diff --git a/sound/soc/mediatek/mt8365/mt8365-mt6357.c b/sound/soc/mediatek/mt8365/mt8365-mt6357.c
index 4339f45ee115..dceee837c67d 100644
--- a/sound/soc/mediatek/mt8365/mt8365-mt6357.c
+++ b/sound/soc/mediatek/mt8365/mt8365-mt6357.c
@@ -297,7 +297,6 @@ static int mt8365_mt6357_dev_probe(struct mtk_soc_card_data *soc_card_data, bool
struct mt8365_mt6357_priv *mach_priv;
int ret;
- card->dev = dev;
ret = parse_dai_link_info(card);
if (ret)
goto err;