aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2014-05-23 01:38:56 -0400
committerMark Brown <broonie@linaro.org>2014-05-26 09:24:24 -0400
commitb20e53a826a7adc3bfd2772bd49a83b6f21b4cce (patch)
treeaaef37175d291de2259ed542673c55a4b99c452f /sound/soc/fsl
parentee9daad4953418ecf28a6b0b920f982fe0c24814 (diff)
ASoC: fsl_ssi: Add suspend/resume support
Doing a suspend/resume sequence while playing an audio track in the backgroung causes broken audio right after resume: root@freescale /$ aplay clarinet.wav & root@freescale /home$ Playing WAVE 'clarinet.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono root@freescale /home$ echo mem > /sys/power/state PM: Syncing filesystems ... done. Freezing user space processes ... (elapsed 0.002 seconds) done. Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done. Suspending console(s) (use no_console_suspend to debug) PM: suspend of devices complete after 37.082 msecs PM: suspend devices took 0.040 seconds PM: late suspend of devices complete after 4.234 msecs PM: noirq suspend of devices complete after 4.618 msecs Disabling non-boot CPUs ... PM: noirq resume of devices complete after 4.013 msecs PM: early resume of devices complete after 4.000 msecs PM: resume of devices complete after 68.907 msecs PM: resume devices took 0.070 seconds Restarting tasks ... Suspended. Trying resume. Failed. Restarting stream. Done. Suspended. Trying resume. Failed. Restarting stream. Done. Suspended. Trying resume. Failed. Restarting stream. Done. Suspended. Trying resume. Failed. Restarting stream. Done. Suspended. Trying resume. Failed. Restarting stream. Done. Suspended. Trying resume. Failed. Restarting stream. Done. Suspended. Trying resume. Failed. Restarting stream. Done. .... Add SNDRV_PCM_TRIGGER_RESUME/SUSPEND cases so that we can gracefully handle system suspend/resume. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Shawn Guo <shawn.guo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r--sound/soc/fsl/fsl_ssi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index e5d8819cf19f..ef504257e105 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -873,6 +873,7 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
873 873
874 switch (cmd) { 874 switch (cmd) {
875 case SNDRV_PCM_TRIGGER_START: 875 case SNDRV_PCM_TRIGGER_START:
876 case SNDRV_PCM_TRIGGER_RESUME:
876 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 877 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
877 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 878 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
878 fsl_ssi_tx_config(ssi_private, true); 879 fsl_ssi_tx_config(ssi_private, true);
@@ -881,6 +882,7 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
881 break; 882 break;
882 883
883 case SNDRV_PCM_TRIGGER_STOP: 884 case SNDRV_PCM_TRIGGER_STOP:
885 case SNDRV_PCM_TRIGGER_SUSPEND:
884 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 886 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
885 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 887 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
886 fsl_ssi_tx_config(ssi_private, false); 888 fsl_ssi_tx_config(ssi_private, false);