static void omap_mcpdm_dai_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); int tx = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); int stream1 = tx ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE; int stream2 = tx ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK; mutex_lock(&mcpdm->mutex); if (!dai->active) { if (omap_mcpdm_active(mcpdm)) { omap_mcpdm_stop(mcpdm); omap_mcpdm_close_streams(mcpdm); mcpdm->config[0].link_mask = 0; mcpdm->config[1].link_mask = 0; } } if (mcpdm->latency[stream2]) pm_qos_update_request(&mcpdm->pm_qos_req, mcpdm->latency[stream2]); else if (mcpdm->latency[stream1]) pm_qos_remove_request(&mcpdm->pm_qos_req); mcpdm->latency[stream1] = 0; mutex_unlock(&mcpdm->mutex); }
static int omap_mcpdm_suspend(struct snd_soc_dai *dai) { struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); if (dai->active) { omap_mcpdm_stop(mcpdm); omap_mcpdm_close_streams(mcpdm); } mcpdm->pm_active_count = 0; while (pm_runtime_active(mcpdm->dev)) { pm_runtime_put_sync(mcpdm->dev); mcpdm->pm_active_count++; } return 0; }
static void omap_mcpdm_dai_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); mutex_lock(&mcpdm->mutex); if (!dai->active) { if (omap_mcpdm_active(mcpdm)) { omap_mcpdm_stop(mcpdm); omap_mcpdm_close_streams(mcpdm); mcpdm->config[0].link_mask = 0; mcpdm->config[1].link_mask = 0; } } mutex_unlock(&mcpdm->mutex); }