static int pcm_disable(int mode) { if (mode & CODEC_WMODE) { __pcm_disable_transmit_dma(); __pcm_disable_replay(); } if (mode & CODEC_RMODE) { __pcm_disable_receive_dma(); __pcm_disable_record(); } __pcm_disable(); __pcm_clock_disable(); return 0; }
static void jz_pcm_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct jz_pcm *jz_pcm = dev_get_drvdata(dai->dev); struct device *dev = dai->dev; PCM_DEBUG_MSG("enter %s, substream = %s\n", __func__, (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? "playback" : "capture"); jz_pcm_stop_substream(substream, dai); if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) jz_pcm->pcm_mode &= ~PCM_WRITE; else jz_pcm->pcm_mode &= ~PCM_READ; if (!jz_pcm->pcm_mode) { __pcm_disable(dev); __pcm_clock_disable(dev); clk_disable(jz_pcm->clk_gate); } return; }