summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@freescale.com>2015-03-03 17:27:48 +0800
committerNitin Garg <nitin.garg@freescale.com>2015-04-14 14:02:35 -0500
commitac8d624015b32e4ec02d396fd7d058fcfe3eff36 (patch)
treefd4fd81cceb43a4aee015e3a80149b94fbbc326d /sound
parent7a1003e6d4aa8f6d5271b2891b1727b63663d4a2 (diff)
MLK-10359: ASoC: fsl_ssi: move pm runtime enable/disable to trigger function
When ssi is inactive, the pm runtime should be disabled for save power Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com> (cherry picked from commit 8d8916001f675aa6aa094f5b45cea1fcad11cea6)
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_ssi.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 00d0e5b84436..feca76b30f95 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -623,8 +623,6 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream,
if (ret)
return ret;
- pm_runtime_get_sync(dai->dev);
-
/* When using dual fifo mode, it is safer to ensure an even period
* size. If appearing to an odd number while DMA always starts its
* task from fifo0, fifo1 would be neglected at the end of each
@@ -648,8 +646,6 @@ static void fsl_ssi_shutdown(struct snd_pcm_substream *substream,
struct fsl_ssi_private *ssi_private =
snd_soc_dai_get_drvdata(rtd->cpu_dai);
- pm_runtime_put_sync(dai->dev);
-
clk_disable_unprepare(ssi_private->clk);
}
@@ -1093,6 +1089,7 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+ pm_runtime_get_sync(dai->dev);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
fsl_ssi_tx_config(ssi_private, true);
else
@@ -1106,6 +1103,7 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
fsl_ssi_tx_config(ssi_private, false);
else
fsl_ssi_rx_config(ssi_private, false);
+ pm_runtime_put_sync(dai->dev);
break;
default: