diff mbox

[1/2] ASoC: Ux500: Fixup use of clocks

Message ID 1350909125-20189-1-git-send-email-ulf.hansson@stericsson.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ulf Hansson Oct. 22, 2012, 12:32 p.m. UTC
From: Ulf Hansson <ulf.hansson@linaro.org>

Make sure clocks are being prepared and unprepared as well
as enabled and disabled.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 sound/soc/ux500/ux500_msp_dai.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Comments

Linus Walleij Oct. 22, 2012, 1:19 p.m. UTC | #1
On Mon, Oct 22, 2012 at 2:32 PM, Ulf Hansson <ulf.hansson@stericsson.com> wrote:

> From: Ulf Hansson <ulf.hansson@linaro.org>
>
> Make sure clocks are being prepared and unprepared as well
> as enabled and disabled.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Thanks,
Linus Walleij
Mark Brown Oct. 22, 2012, 1:30 p.m. UTC | #2
On Mon, Oct 22, 2012 at 02:32:04PM +0200, Ulf Hansson wrote:
> From: Ulf Hansson <ulf.hansson@linaro.org>
> 
> Make sure clocks are being prepared and unprepared as well
> as enabled and disabled.

Applied, thanks.
Ulf Hansson Nov. 5, 2012, 2:27 p.m. UTC | #3
On 22 October 2012 15:30, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Mon, Oct 22, 2012 at 02:32:04PM +0200, Ulf Hansson wrote:
>> From: Ulf Hansson <ulf.hansson@linaro.org>
>>
>> Make sure clocks are being prepared and unprepared as well
>> as enabled and disabled.
>
> Applied, thanks.

I can not find this patch on any "next-tree" yet. Same goes for:
"[PATCH 2/2] ASoC: Ux500: Control apb clock".

Maybe I should be more patient, but thought it make sense to send a
ping on this. :-)

Kind regards
Ulf Hansson
Mark Brown Nov. 6, 2012, 8:26 a.m. UTC | #4
On Mon, Nov 05, 2012 at 03:27:08PM +0100, Ulf Hansson wrote:

> I can not find this patch on any "next-tree" yet. Same goes for:
> "[PATCH 2/2] ASoC: Ux500: Control apb clock".

> Maybe I should be more patient, but thought it make sense to send a
> ping on this. :-)

As I've had to tell you before pings are pointless, don't do this - to
repeat, if you think something has been missed resend it.
diff mbox

Patch

diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c
index be94bf9..e11187f 100644
--- a/sound/soc/ux500/ux500_msp_dai.c
+++ b/sound/soc/ux500/ux500_msp_dai.c
@@ -398,11 +398,13 @@  static int ux500_msp_dai_startup(struct snd_pcm_substream *substream,
 		return ret;
 	}
 
-	/* Enable clock */
+	/* Prepare and enable clock */
 	dev_dbg(dai->dev, "%s: Enabling MSP-clock.\n", __func__);
-	clk_enable(drvdata->clk);
+	ret = clk_prepare_enable(drvdata->clk);
+	if (ret)
+		regulator_disable(drvdata->reg_vape);
 
-	return 0;
+	return ret;
 }
 
 static void ux500_msp_dai_shutdown(struct snd_pcm_substream *substream,
@@ -428,8 +430,8 @@  static void ux500_msp_dai_shutdown(struct snd_pcm_substream *substream,
 			__func__, dai->id, snd_pcm_stream_str(substream));
 	}
 
-	/* Disable clock */
-	clk_disable(drvdata->clk);
+	/* Disable and unprepare clock */
+	clk_disable_unprepare(drvdata->clk);
 
 	/* Disable regulator */
 	ret = regulator_disable(drvdata->reg_vape);