diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2023-03-22 02:12:24 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-03-22 14:17:38 +0100 |
commit | dcf084247e376b35c139c922d30917f4ff716a4c (patch) | |
tree | baf015e8ffe4c9236a45c0fcb752dda2141e0eb4 /sound/soc/generic/simple-card.c | |
parent | ASoC: Intel: sof_rt5682: Remove conditional dpcm_capture setting (diff) | |
download | linux-dcf084247e376b35c139c922d30917f4ff716a4c.tar.xz linux-dcf084247e376b35c139c922d30917f4ff716a4c.zip |
ASoC: simple-card: add comment to indicate don't remove platforms
Basically CPU and Platform are different Component, but if CPU is using
soc-generic-dmaengine-pcm, same dev will be shared between CPU and
Platform, and Simple Card had been supporting it.
When we focus to clean up Simple Card driver, we tend to remove platforms
if no Platform was selected, but it is wrong because of above reasons.
This patch adds comment why we shouldn't remove platforms.
In case of CPU is not using soc-generic-dmaengine-pcm, CPU and Platform
will be duplicated, but it will be ignored by snd_soc_rtd_add_component().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875yattwqv.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/generic/simple-card.c')
-rw-r--r-- | sound/soc/generic/simple-card.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index e98932c16754..fcd6c44f89f6 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -509,10 +509,25 @@ static int simple_count_noml(struct asoc_simple_priv *priv, return -EINVAL; } + /* + * DON'T REMOVE platforms + * + * Some CPU might be using soc-generic-dmaengine-pcm. This means CPU and Platform + * are different Component, but are sharing same component->dev. + * Simple Card had been supported it without special Platform selection. + * We need platforms here. + * + * In case of no Platform, it will be Platform == CPU, but Platform will be + * ignored by snd_soc_rtd_add_component(). + * + * see + * simple-card-utils.c :: asoc_simple_canonicalize_platform() + */ li->num[li->link].cpus = 1; - li->num[li->link].codecs = 1; li->num[li->link].platforms = 1; + li->num[li->link].codecs = 1; + li->link += 1; return 0; @@ -531,6 +546,11 @@ static int simple_count_dpcm(struct asoc_simple_priv *priv, } if (li->cpu) { + /* + * DON'T REMOVE platforms + * see + * simple_count_noml() + */ li->num[li->link].cpus = 1; li->num[li->link].platforms = 1; |