summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2016-07-19 02:53:13 +0000
committerMark Brown <broonie@kernel.org>2016-08-05 12:31:37 +0100
commit28abd99b6e40741cd0e75be20817f23a3044d338 (patch)
tree8ad7ab7dda8f2b8de8ce8ad8d62a41303862ce3e /sound/soc
parente7ca8fcd15049b1e48ae2ef1434a68a51ef0ead5 (diff)
ASoC: simple-card: use asoc_simple_card_parse_clk()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/generic/simple-card.c35
1 files changed, 10 insertions, 25 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 43295f024982..b37c81b09203 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -244,8 +244,6 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
int *args_count)
{
struct of_phandle_args args;
- struct clk *clk;
- u32 val;
int ret;
if (!np)
@@ -282,29 +280,6 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
if (ret)
return ret;
- /*
- * Parse dai->sysclk come from "clocks = <&xxx>"
- * (if system has common clock)
- * or "system-clock-frequency = <xxx>"
- * or device's module clock.
- */
- if (of_property_read_bool(np, "clocks")) {
- clk = of_clk_get(np, 0);
- if (IS_ERR(clk)) {
- ret = PTR_ERR(clk);
- return ret;
- }
-
- dai->sysclk = clk_get_rate(clk);
- dai->clk = clk;
- } else if (!of_property_read_u32(np, "system-clock-frequency", &val)) {
- dai->sysclk = val;
- } else {
- clk = of_clk_get(args.np, 0);
- if (!IS_ERR(clk))
- dai->sysclk = clk_get_rate(clk);
- }
-
return 0;
}
@@ -316,6 +291,8 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
struct device *dev = simple_priv_to_dev(priv);
struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, idx);
struct simple_dai_props *dai_props = simple_priv_to_props(priv, idx);
+ struct asoc_simple_dai *cpu_dai = &dai_props->cpu_dai;
+ struct asoc_simple_dai *codec_dai = &dai_props->codec_dai;
struct device_node *cpu = NULL;
struct device_node *plat = NULL;
struct device_node *codec = NULL;
@@ -370,6 +347,14 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
if (ret < 0)
goto dai_link_of_err;
+ ret = asoc_simple_card_parse_clk_cpu(cpu, dai_link, cpu_dai);
+ if (ret < 0)
+ goto dai_link_of_err;
+
+ ret = asoc_simple_card_parse_clk_codec(codec, dai_link, codec_dai);
+ if (ret < 0)
+ goto dai_link_of_err;
+
if (!dai_link->cpu_dai_name || !dai_link->codec_dai_name) {
ret = -EINVAL;
goto dai_link_of_err;