mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
Merge "ASoC: pcm: QGKI startup sequence for playback and capture"
This commit is contained in:
commit
e1bdeb4100
1 changed files with 9 additions and 1 deletions
|
|
@ -801,11 +801,12 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
|
|||
|
||||
mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass);
|
||||
|
||||
#ifdef CONFIG_AUDIO_QGKI
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
|
||||
snd_soc_dapm_stream_event(rtd,
|
||||
SNDRV_PCM_STREAM_PLAYBACK,
|
||||
SND_SOC_DAPM_STREAM_START);
|
||||
|
||||
#endif
|
||||
if (rtd->dai_link->ops->prepare) {
|
||||
ret = rtd->dai_link->ops->prepare(substream);
|
||||
if (ret < 0) {
|
||||
|
|
@ -850,6 +851,7 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
|
|||
cancel_delayed_work(&rtd->delayed_work);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_AUDIO_QGKI
|
||||
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
|
||||
for (i = 0; i < rtd->num_codecs; i++) {
|
||||
codec_dai = rtd->codec_dais[i];
|
||||
|
|
@ -859,6 +861,10 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
|
|||
SND_SOC_DAPM_STREAM_START);
|
||||
}
|
||||
}
|
||||
#else
|
||||
snd_soc_dapm_stream_event(rtd, substream->stream,
|
||||
SND_SOC_DAPM_STREAM_START);
|
||||
#endif
|
||||
|
||||
for_each_rtd_codec_dai(rtd, i, codec_dai)
|
||||
snd_soc_dai_digital_mute(codec_dai, 0,
|
||||
|
|
@ -866,6 +872,7 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
|
|||
snd_soc_dai_digital_mute(cpu_dai, 0, substream->stream);
|
||||
|
||||
out:
|
||||
#ifdef CONFIG_AUDIO_QGKI
|
||||
if (ret < 0 && substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
||||
pr_err("%s: Issue stop stream for codec_dai due to op failure %d = ret\n",
|
||||
__func__, ret);
|
||||
|
|
@ -873,6 +880,7 @@ out:
|
|||
SNDRV_PCM_STREAM_PLAYBACK,
|
||||
SND_SOC_DAPM_STREAM_STOP);
|
||||
}
|
||||
#endif
|
||||
mutex_unlock(&rtd->card->pcm_mutex);
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in a new issue