Skip to content

Commit

Permalink
ASoC: audio-graph: respawn Platform Support
Browse files Browse the repository at this point in the history
[ Upstream commit 5f939f4 ]

commit 63f2f9c ("ASoC: audio-graph: remove Platform support")
removed Platform support from audio-graph, because it doesn't have
"plat" support on DT (simple-card has).
But, Platform support is needed if user is using
snd_dmaengine_pcm_register() which adds generic DMA as Platform.
And this Platform dev is using CPU dev.

Without this patch, at least STM32MP15 audio sound card is no more
functional (v5.13 or later). This patch respawn Platform Support on
audio-graph again.

Reported-by: Olivier MOYSAN <olivier.moysan@foss.st.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Olivier MOYSAN <olivier.moysan@foss.st.com>
Link: https://lore.kernel.org/r/878s0jzrpf.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
morimoto authored and gregkh committed Sep 26, 2021
1 parent 0a96c97 commit 417cd31
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sound/soc/generic/audio-graph-card.c
Expand Up @@ -285,6 +285,7 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
if (li->cpu) {
struct snd_soc_card *card = simple_priv_to_card(priv);
struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
int is_single_links = 0;

/* Codec is dummy */
Expand Down Expand Up @@ -313,6 +314,7 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
dai_link->no_pcm = 1;

asoc_simple_canonicalize_cpu(cpus, is_single_links);
asoc_simple_canonicalize_platform(platforms, cpus);
} else {
struct snd_soc_codec_conf *cconf = simple_props_to_codec_conf(dai_props, 0);
struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
Expand Down Expand Up @@ -366,6 +368,7 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link);
struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
char dai_name[64];
int ret, is_single_links = 0;

Expand All @@ -383,6 +386,7 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
"%s-%s", cpus->dai_name, codecs->dai_name);

asoc_simple_canonicalize_cpu(cpus, is_single_links);
asoc_simple_canonicalize_platform(platforms, cpus);

ret = graph_link_init(priv, cpu_ep, codec_ep, li, dai_name);
if (ret < 0)
Expand Down Expand Up @@ -608,6 +612,7 @@ static int graph_count_noml(struct asoc_simple_priv *priv,

li->num[li->link].cpus = 1;
li->num[li->link].codecs = 1;
li->num[li->link].platforms = 1;

li->link += 1; /* 1xCPU-Codec */

Expand All @@ -630,6 +635,7 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv,

if (li->cpu) {
li->num[li->link].cpus = 1;
li->num[li->link].platforms = 1;

li->link++; /* 1xCPU-dummy */
} else {
Expand Down

0 comments on commit 417cd31

Please sign in to comment.