summaryrefslogtreecommitdiff
path: root/sound/soc/generic/simple-card-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/generic/simple-card-utils.c')
-rw-r--r--sound/soc/generic/simple-card-utils.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 56552a616f21..467edd96eae5 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -562,12 +562,12 @@ static int asoc_simple_init_for_codec2codec(struct snd_soc_pcm_runtime *rtd,
{
struct snd_soc_dai_link *dai_link = rtd->dai_link;
struct snd_soc_component *component;
- struct snd_soc_pcm_stream *params;
+ struct snd_soc_pcm_stream *c2c_params;
struct snd_pcm_hardware hw;
int i, ret, stream;
/* Do nothing if it already has Codec2Codec settings */
- if (dai_link->params)
+ if (dai_link->c2c_params)
return 0;
/* Do nothing if it was DPCM :: BE */
@@ -592,19 +592,19 @@ static int asoc_simple_init_for_codec2codec(struct snd_soc_pcm_runtime *rtd,
return ret;
}
- params = devm_kzalloc(rtd->dev, sizeof(*params), GFP_KERNEL);
- if (!params)
+ c2c_params = devm_kzalloc(rtd->dev, sizeof(*c2c_params), GFP_KERNEL);
+ if (!c2c_params)
return -ENOMEM;
- params->formats = hw.formats;
- params->rates = hw.rates;
- params->rate_min = hw.rate_min;
- params->rate_max = hw.rate_max;
- params->channels_min = hw.channels_min;
- params->channels_max = hw.channels_max;
+ c2c_params->formats = hw.formats;
+ c2c_params->rates = hw.rates;
+ c2c_params->rate_min = hw.rate_min;
+ c2c_params->rate_max = hw.rate_max;
+ c2c_params->channels_min = hw.channels_min;
+ c2c_params->channels_max = hw.channels_max;
- dai_link->params = params;
- dai_link->num_params = 1;
+ dai_link->c2c_params = c2c_params;
+ dai_link->num_c2c_params = 1;
return 0;
}
@@ -638,7 +638,16 @@ EXPORT_SYMBOL_GPL(asoc_simple_dai_init);
void asoc_simple_canonicalize_platform(struct snd_soc_dai_link_component *platforms,
struct snd_soc_dai_link_component *cpus)
{
- /* Assumes platform == cpu */
+ /*
+ * Assumes Platform == CPU
+ *
+ * Some CPU might be using soc-generic-dmaengine-pcm. This means CPU and Platform
+ * are different Component, but are sharing same component->dev.
+ *
+ * Let's assume Platform is same as CPU if it doesn't identify Platform on DT.
+ * see
+ * simple-card.c :: simple_count_noml()
+ */
if (!platforms->of_node)
platforms->of_node = cpus->of_node;
}