summaryrefslogtreecommitdiff
path: root/sound/soc/generic/simple-card-utils.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-06-06 13:07:35 +0900
committerMark Brown <broonie@kernel.org>2019-06-06 21:22:17 +0100
commitf107294c6422e772773b53dbf802186175b6289e (patch)
treea041d47f5b2e3cc99383b15d07ad3f70d7948919 /sound/soc/generic/simple-card-utils.c
parent08a5841e3a109f9ea7bfa9c64109aefa95a318c7 (diff)
ASoC: simple-card: support snd_soc_dai_link_component style for cpu
ASoC supports modern style dai_link (= snd_soc_dai_link_component) for CPU. legacy style dai_link (= cpu_dai_name, cpu_name, cpu_of_node) are no longer needed. This patch switches to modern style. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/generic/simple-card-utils.c')
-rw-r--r--sound/soc/generic/simple-card-utils.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index f4c6375d11c7..ac8678fe55ff 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -159,24 +159,13 @@ static void asoc_simple_clk_disable(struct asoc_simple_dai *dai)
int asoc_simple_parse_clk(struct device *dev,
struct device_node *node,
- struct device_node *dai_of_node,
struct asoc_simple_dai *simple_dai,
- const char *dai_name,
struct snd_soc_dai_link_component *dlc)
{
struct clk *clk;
u32 val;
/*
- * Use snd_soc_dai_link_component instead of legacy style.
- * It is only for codec, but cpu will be supported in the future.
- * see
- * soc-core.c :: snd_soc_init_multicodec()
- */
- if (dlc)
- dai_of_node = dlc->of_node;
-
- /*
* Parse dai->sysclk come from "clocks = <&xxx>"
* (if system has common clock)
* or "system-clock-frequency = <xxx>"
@@ -190,7 +179,7 @@ int asoc_simple_parse_clk(struct device *dev,
} else if (!of_property_read_u32(node, "system-clock-frequency", &val)) {
simple_dai->sysclk = val;
} else {
- clk = devm_get_clk_from_child(dev, dai_of_node, NULL);
+ clk = devm_get_clk_from_child(dev, dlc->of_node, NULL);
if (!IS_ERR(clk))
simple_dai->sysclk = clk_get_rate(clk);
}
@@ -359,7 +348,7 @@ void asoc_simple_canonicalize_platform(struct snd_soc_dai_link *dai_link)
{
/* Assumes platform == cpu */
if (!dai_link->platforms->of_node)
- dai_link->platforms->of_node = dai_link->cpu_of_node;
+ dai_link->platforms->of_node = dai_link->cpus->of_node;
}
EXPORT_SYMBOL_GPL(asoc_simple_canonicalize_platform);
@@ -376,7 +365,7 @@ void asoc_simple_canonicalize_cpu(struct snd_soc_dai_link *dai_link,
* fmt_multiple_name()
*/
if (is_single_links)
- dai_link->cpu_dai_name = NULL;
+ dai_link->cpus->dai_name = NULL;
}
EXPORT_SYMBOL_GPL(asoc_simple_canonicalize_cpu);
@@ -386,7 +375,7 @@ int asoc_simple_clean_reference(struct snd_soc_card *card)
int i;
for_each_card_prelinks(card, i, dai_link) {
- of_node_put(dai_link->cpu_of_node);
+ of_node_put(dai_link->cpus->of_node);
of_node_put(dai_link->codecs->of_node);
}
return 0;
@@ -576,6 +565,8 @@ int asoc_simple_init_priv(struct asoc_simple_priv *priv,
* simple-card-utils.c :: asoc_simple_canonicalize_platform()
*/
for (i = 0; i < li->link; i++) {
+ dai_link[i].cpus = &dai_props[i].cpus;
+ dai_link[i].num_cpus = 1;
dai_link[i].codecs = &dai_props[i].codecs;
dai_link[i].num_codecs = 1;
dai_link[i].platforms = &dai_props[i].platforms;