diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-11-07 11:08:28 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-11-09 12:20:40 -0500 |
commit | 1fb8510cdb5b7befe8a59f533c7fc12ef0dac73e (patch) | |
tree | b44569425ea7683d02893cfd145081a11d7677f1 /sound/soc/atmel | |
parent | 31584ed18c073176a7ad96ddbfd09765e21e813d (diff) |
ALSA: pcm: Add snd_pcm_stop_xrun() helper
Add a new helper function snd_pcm_stop_xrun() to the standard sequnce
lock/snd_pcm_stop(XRUN)/unlock by a single call, and replace the
existing open codes with this helper.
The function checks the PCM running state to prevent setting the wrong
state, too, for more safety.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/soc/atmel')
-rw-r--r-- | sound/soc/atmel/atmel-pcm-dma.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/soc/atmel/atmel-pcm-dma.c b/sound/soc/atmel/atmel-pcm-dma.c index b79a2a864513..33fb3bb133df 100644 --- a/sound/soc/atmel/atmel-pcm-dma.c +++ b/sound/soc/atmel/atmel-pcm-dma.c | |||
@@ -80,9 +80,7 @@ static void atmel_pcm_dma_irq(u32 ssc_sr, | |||
80 | 80 | ||
81 | /* stop RX and capture: will be enabled again at restart */ | 81 | /* stop RX and capture: will be enabled again at restart */ |
82 | ssc_writex(prtd->ssc->regs, SSC_CR, prtd->mask->ssc_disable); | 82 | ssc_writex(prtd->ssc->regs, SSC_CR, prtd->mask->ssc_disable); |
83 | snd_pcm_stream_lock(substream); | 83 | snd_pcm_stop_xrun(substream); |
84 | snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); | ||
85 | snd_pcm_stream_unlock(substream); | ||
86 | 84 | ||
87 | /* now drain RHR and read status to remove xrun condition */ | 85 | /* now drain RHR and read status to remove xrun condition */ |
88 | ssc_readx(prtd->ssc->regs, SSC_RHR); | 86 | ssc_readx(prtd->ssc->regs, SSC_RHR); |