From: Bo Shen <voice.shen@atmel.com>
To: Mark Brown <broonie@kernel.org>, nicolas.ferre@atmel.com
Cc: alsa-devel@alsa-project.org, Wolfram Sang <wsa@the-dreams.de>,
Takashi Iwai <tiwai@suse.de>,
linux-kernel@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Bo Shen <voice.shen@atmel.com>,
Boris BREZILLON <b.brezillon@overkiz.com>
Subject: [PATCH 6/8] ASoC: atmel: support CCF based clks
Date: Mon, 17 Mar 2014 17:45:39 +0800 [thread overview]
Message-ID: <1395049541-28128-7-git-send-email-voice.shen@atmel.com> (raw)
In-Reply-To: <1395049541-28128-1-git-send-email-voice.shen@atmel.com>
From: Boris BREZILLON <b.brezillon@overkiz.com>
Provide dev to clk_get function if we're using CCF based clks.
CCF based prog clks support automatic parent selection when asking for a
specific rate: remove the clk32k clk retrieval if we're using these clks.
Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>
[voice.shen@atmel.com: switch to devm manage function]
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Bo Shen <voice.shen@atmel.com>
---
sound/soc/atmel/atmel_wm8904.c | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/sound/soc/atmel/atmel_wm8904.c b/sound/soc/atmel/atmel_wm8904.c
index b4e3690..a797d33 100644
--- a/sound/soc/atmel/atmel_wm8904.c
+++ b/sound/soc/atmel/atmel_wm8904.c
@@ -170,25 +170,26 @@ static int atmel_asoc_wm8904_probe(struct platform_device *pdev)
return ret;
}
- mclk = clk_get(NULL, "pck0");
+ mclk = devm_clk_get(&pdev->dev, "pck0");
if (IS_ERR(mclk)) {
dev_err(&pdev->dev, "failed to get pck0\n");
ret = PTR_ERR(mclk);
goto err_set_audio;
}
- clk_src = clk_get(NULL, "clk32k");
- if (IS_ERR(clk_src)) {
- dev_err(&pdev->dev, "failed to get clk32k\n");
- ret = PTR_ERR(clk_src);
- goto err_set_audio;
- }
+ if (!IS_ENABLED(CONFIG_COMMON_CLK)) {
+ clk_src = devm_clk_get(&pdev->dev, "clk32k");
+ if (IS_ERR(clk_src)) {
+ dev_err(&pdev->dev, "failed to get clk32k\n");
+ ret = PTR_ERR(clk_src);
+ goto err_set_audio;
+ }
- ret = clk_set_parent(mclk, clk_src);
- clk_put(clk_src);
- if (ret != 0) {
- dev_err(&pdev->dev, "failed to set MCLK parent\n");
- goto err_set_audio;
+ ret = clk_set_parent(mclk, clk_src);
+ if (ret != 0) {
+ dev_err(&pdev->dev, "failed to set MCLK parent\n");
+ goto err_set_audio;
+ }
}
dev_info(&pdev->dev, "setting pck0 to %dHz\n", MCLK_RATE);
--
1.8.5.2
next prev parent reply other threads:[~2014-03-17 9:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-17 9:45 [PATCH 0/8] ARM: at91: sama5d3: enable sound support Bo Shen
2014-03-17 9:45 ` Bo Shen [this message]
2014-03-17 9:55 ` [PATCH 6/8] ASoC: atmel: support CCF based clks Bo Shen
2014-03-17 10:31 ` Boris BREZILLON
[not found] ` <1395049541-28128-1-git-send-email-voice.shen-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2014-04-18 20:35 ` [PATCH 0/8] ARM: at91: sama5d3: enable sound support Nicolas Ferre
2014-04-18 20:38 ` Mark Brown
2014-04-18 22:06 ` Boris BREZILLON
2014-04-18 22:11 ` Nicolas Ferre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1395049541-28128-7-git-send-email-voice.shen@atmel.com \
--to=voice.shen@atmel.com \
--cc=alsa-devel@alsa-project.org \
--cc=b.brezillon@overkiz.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.ferre@atmel.com \
--cc=tiwai@suse.de \
--cc=wsa@the-dreams.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox