Skip to content

Commit

Permalink
ASoC: Ux500: Fixup use of clocks
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Ulf Hansson authored and Mark Brown committed Oct 22, 2012
1 parent 6f0c058 commit fe36a0b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions sound/soc/ux500/ux500_msp_dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand Down

0 comments on commit fe36a0b

Please sign in to comment.