VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   55 Tags
author: carter.li <carter.li@starfivetech.com> 2023-07-27 17:38:23 +0800 committer: carter.li <carter.li@starfivetech.com> 2023-08-14 15:19:04 +0800 commit: 4e78e41d8b913388728b04244f55b049754b107d parent: b488ec5f626dbcd50de8aba3322dd081a02562c2
Commit Summary:
sound:simple card: fix cannot register pwmdac and hdmi snd card
Diffstat:
3 files changed, 11 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 8e6dd8a257c5..e76077e41e06 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -651,6 +651,8 @@ struct snd_soc_dai_link {
 	struct snd_soc_dai_link_component *platforms;
 	unsigned int num_platforms;
 
+	unsigned int no_plat;
+
 	int id;	/* optional ID for machine driver link identification */
 
 	const struct snd_soc_pcm_stream *params;
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index a3a7990b5cb6..7d09a0d29146 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -289,6 +289,12 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv,
 	if (ret < 0)
 		goto dai_link_of_err;
 
+	if (!plat) {
+		dai_link->no_plat = 1;
+	} else {
+		dai_link->no_plat = 0;
+	}
+
 	ret = asoc_simple_parse_dai(plat, platforms, NULL);
 	if (ret < 0)
 		goto dai_link_of_err;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 80ca260595fd..759a90c880bc 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1805,6 +1805,9 @@ match:
 			dev_dbg(card->dev, "info: override BE DAI link %s\n",
 				card->dai_link[i].name);
 
+			if (dai_link->no_plat)
+				continue;
+
 			/* override platform component */
 			if (!dai_link->platforms) {
 				dev_err(card->dev, "init platform error");