All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bo Shen <voice.shen@atmel.com>
To: Mark Brown <broonie@kernel.org>, nicolas.ferre@atmel.com
Cc: Boris BREZILLON <b.brezillon@overkiz.com>,
	Bo Shen <voice.shen@atmel.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>,
	Linus Walleij <linus.walleij@linaro.org>,
	Wolfram Sang <wsa@the-dreams.de>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
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


WARNING: multiple messages have this Message-ID (diff)
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

  parent reply	other threads:[~2014-03-17  9:48 UTC|newest]

Thread overview: 73+ 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
2014-03-17  9:45 ` Bo Shen
2014-03-17  9:45 ` [PATCH 1/8] ARM: at91: sama5d3: add DMA property for SSC devices Bo Shen
2014-03-17  9:45   ` Bo Shen
2014-04-18 20:47   ` Nicolas Ferre
2014-04-18 20:47     ` Nicolas Ferre
2014-04-18 20:47     ` Nicolas Ferre
2014-03-17  9:45 ` [PATCH 2/8] ARM: at91: sama5d3: disable sound by default Bo Shen
2014-03-17  9:45   ` Bo Shen
2014-03-17  9:45   ` Bo Shen
2014-04-18 20:49   ` Nicolas Ferre
2014-04-18 20:49     ` Nicolas Ferre
2014-04-18 20:49     ` Nicolas Ferre
2014-03-17  9:45 ` [PATCH 3/8] ARM: at91: sama5d3: correct the sound compatible string Bo Shen
2014-03-17  9:45   ` Bo Shen
2014-03-17  9:45   ` Bo Shen
2014-04-18 20:49   ` Nicolas Ferre
2014-04-18 20:49     ` Nicolas Ferre
2014-04-18 20:49     ` Nicolas Ferre
2014-03-17  9:45 ` [PATCH 4/8] ARM: at91: sama5d3: add the missing property Bo Shen
2014-03-17  9:45   ` Bo Shen
2014-04-18 20:50   ` Nicolas Ferre
2014-04-18 20:50     ` Nicolas Ferre
2014-04-18 20:50     ` Nicolas Ferre
2014-03-17  9:45 ` [PATCH 5/8] ARM: at91: sama5d3: clock for ssc from rk pin Bo Shen
2014-03-17  9:45   ` Bo Shen
2014-04-18 20:50   ` Nicolas Ferre
2014-04-18 20:50     ` Nicolas Ferre
2014-04-18 20:50     ` Nicolas Ferre
2014-03-17  9:45 ` Bo Shen [this message]
2014-03-17  9:45   ` [PATCH 6/8] ASoC: atmel: support CCF based clks Bo Shen
2014-03-17  9:55   ` Bo Shen
2014-03-17  9:55     ` Bo Shen
2014-03-17 10:31   ` Boris BREZILLON
2014-03-17  9:45 ` [PATCH 7/8] ASoC: atmel: document clock properties of the wm8904 driver Bo Shen
2014-03-17  9:54   ` Bo Shen
2014-03-17  9:54     ` Bo Shen
2014-03-17 10:02   ` Mark Rutland
2014-03-17 10:18     ` boris brezillon
2014-03-17 10:18       ` boris brezillon
2014-03-17 10:48       ` Mark Rutland
2014-03-17 11:24         ` Boris BREZILLON
2014-03-17 11:30           ` Mark Rutland
2014-03-17 11:55   ` Mark Brown
2014-03-17 13:44     ` Boris BREZILLON
2014-03-17 15:28       ` Mark Brown
2014-03-19  5:57     ` Bo Shen
2014-03-19  5:57       ` Bo Shen
2014-03-19 10:28       ` Mark Brown
2014-03-19 10:28         ` Mark Brown
2014-03-20  2:37         ` Bo Shen
2014-03-20  2:37           ` Bo Shen
2014-03-20 13:47           ` Mark Brown
2014-03-20 13:47             ` Mark Brown
2014-03-21  2:48             ` Bo Shen
2014-03-21  2:48               ` Bo Shen
2014-03-17  9:45 ` [PATCH 8/8] ARM: at91/dt: add clock properties to the wm8904 codec node Bo Shen
2014-03-17  9:45   ` Bo Shen
2014-03-17  9:55   ` Bo Shen
2014-03-17  9:55     ` Bo Shen
2014-03-17  9:55     ` Bo Shen
2014-04-18 20:35 ` [PATCH 0/8] ARM: at91: sama5d3: enable sound support Nicolas Ferre
2014-04-18 20:35   ` Nicolas Ferre
2014-04-18 20:35   ` Nicolas Ferre
2014-04-18 20:38   ` Mark Brown
2014-04-18 20:38     ` Mark Brown
2014-04-18 20:38     ` Mark Brown
2014-04-18 22:06   ` Boris BREZILLON
2014-04-18 22:06     ` Boris BREZILLON
2014-04-18 22:11     ` Nicolas Ferre
2014-04-18 22:11       ` Nicolas Ferre
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=perex@perex.cz \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.