diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2015-11-05 08:51:15 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-11-16 10:09:29 +0000 |
commit | 68a550248e295ba548e30c876ccdec351e286eee (patch) | |
tree | 42bf8747ba28ba3681539f58fd9966b7d72265f9 /sound/soc/sh/rcar/adg.c | |
parent | 81ad174db5ca8f372da6dc31a4ca25d52f9bec5f (diff) | |
download | linux-stable-68a550248e295ba548e30c876ccdec351e286eee.tar.gz linux-stable-68a550248e295ba548e30c876ccdec351e286eee.tar.bz2 linux-stable-68a550248e295ba548e30c876ccdec351e286eee.zip |
ASoC: rsnd: call clk_prepare()/clk_enable() for AUDIO_CLKx
ADG can output AUDIO_CLKOUTx, and these are generated from
AUDIO_CLKx. Thus we need to call clk_prepare()/clk_enable()
for AUDIO_CLKx.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sh/rcar/adg.c')
-rw-r--r-- | sound/soc/sh/rcar/adg.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c index b123734f9fbd..1946ce8baf2e 100644 --- a/sound/soc/sh/rcar/adg.c +++ b/sound/soc/sh/rcar/adg.c @@ -418,15 +418,20 @@ static void rsnd_adg_get_clkin(struct rsnd_priv *priv, [CLKC] = "clk_c", [CLKI] = "clk_i", }; - int i; + int i, ret; for (i = 0; i < CLKMAX; i++) { clk = devm_clk_get(dev, clk_name[i]); adg->clk[i] = IS_ERR(clk) ? NULL : clk; } - for_each_rsnd_clk(clk, adg, i) + for_each_rsnd_clk(clk, adg, i) { + ret = clk_prepare_enable(clk); + if (ret < 0) + dev_warn(dev, "can't use clk %d\n", i); + dev_dbg(dev, "clk %d : %p : %ld\n", i, clk, clk_get_rate(clk)); + } } static void rsnd_adg_get_clkout(struct rsnd_priv *priv, @@ -600,3 +605,15 @@ int rsnd_adg_probe(struct platform_device *pdev, return 0; } + +void rsnd_adg_remove(struct platform_device *pdev, + struct rsnd_priv *priv) +{ + struct rsnd_adg *adg = rsnd_priv_to_adg(priv); + struct clk *clk; + int i; + + for_each_rsnd_clk(clk, adg, i) { + clk_disable_unprepare(clk); + } +} |