diff mbox series

[07/11] ASoC: mmp-sspa: Prepare/unprepare the clocks

Message ID 20200511210134.1224532-8-lkundrak@v3.sk (mailing list archive)
State New, archived
Headers show
Series Make sound work on DT-based MMP2 machines | expand

Commit Message

Lubomir Rintel May 11, 2020, 9:01 p.m. UTC
The driver enables the clocks without preparing them and disables
without unpreparing afterwards. Fix that.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
 sound/soc/pxa/mmp-sspa.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Mark Brown May 12, 2020, 12:45 p.m. UTC | #1
On Mon, May 11, 2020 at 11:01:30PM +0200, Lubomir Rintel wrote:
> The driver enables the clocks without preparing them and disables
> without unpreparing afterwards. Fix that.

This fix should've been earlier in the series so it could be sent as a
fix.
Lubomir Rintel May 12, 2020, 3:36 p.m. UTC | #2
On Tue, May 12, 2020 at 01:45:20PM +0100, Mark Brown wrote:
> On Mon, May 11, 2020 at 11:01:30PM +0200, Lubomir Rintel wrote:
> > The driver enables the clocks without preparing them and disables
> > without unpreparing afterwards. Fix that.
> 
> This fix should've been earlier in the series so it could be sent as a
> fix.

I'll order it earlier on v2.

However, there's not much of a point in picking this patch alone,
because the driver is certainly not used anywhere and very likely
doesn't even work to any sensible extent without the rest of the
series.

Lubo
Mark Brown May 12, 2020, 4:29 p.m. UTC | #3
On Tue, May 12, 2020 at 05:36:54PM +0200, Lubomir Rintel wrote:
> On Tue, May 12, 2020 at 01:45:20PM +0100, Mark Brown wrote:

> > This fix should've been earlier in the series so it could be sent as a
> > fix.

> I'll order it earlier on v2.

> However, there's not much of a point in picking this patch alone,
> because the driver is certainly not used anywhere and very likely
> doesn't even work to any sensible extent without the rest of the
> series.

Well, I've already applied everything except the DT patches for that
reason - it's just worth pointing out for future reference.
diff mbox series

Patch

diff --git a/sound/soc/pxa/mmp-sspa.c b/sound/soc/pxa/mmp-sspa.c
index 7a706b1d2588..a66e594b1072 100644
--- a/sound/soc/pxa/mmp-sspa.c
+++ b/sound/soc/pxa/mmp-sspa.c
@@ -92,8 +92,8 @@  static int mmp_sspa_startup(struct snd_pcm_substream *substream,
 {
 	struct sspa_priv *sspa = snd_soc_dai_get_drvdata(dai);
 
-	clk_enable(sspa->sysclk);
-	clk_enable(sspa->clk);
+	clk_prepare_enable(sspa->sysclk);
+	clk_prepare_enable(sspa->clk);
 
 	return 0;
 }
@@ -103,8 +103,8 @@  static void mmp_sspa_shutdown(struct snd_pcm_substream *substream,
 {
 	struct sspa_priv *sspa = snd_soc_dai_get_drvdata(dai);
 
-	clk_disable(sspa->clk);
-	clk_disable(sspa->sysclk);
+	clk_disable_unprepare(sspa->clk);
+	clk_disable_unprepare(sspa->sysclk);
 
 }
 
@@ -458,7 +458,7 @@  static int asoc_mmp_sspa_probe(struct platform_device *pdev)
 		clk_put(sspa->audio_clk);
 		return PTR_ERR(sspa->sysclk);
 	}
-	clk_enable(sspa->audio_clk);
+	clk_prepare_enable(sspa->audio_clk);
 	sspa->dai_fmt = (unsigned int) -1;
 	platform_set_drvdata(pdev, sspa);
 
@@ -485,7 +485,7 @@  static int asoc_mmp_sspa_remove(struct platform_device *pdev)
 {
 	struct sspa_priv *sspa = platform_get_drvdata(pdev);
 
-	clk_disable(sspa->audio_clk);
+	clk_disable_unprepare(sspa->audio_clk);
 	clk_put(sspa->audio_clk);
 	clk_put(sspa->sysclk);
 	return 0;