Merge "ASoC: msm: Loopback Driver Reg Stream in Prepare Stage"
This commit is contained in:
commit
74b6b84c4a
1 changed files with 18 additions and 14 deletions
|
@ -246,7 +246,6 @@ static int msm_pcm_open(struct snd_pcm_substream *substream)
|
|||
struct msm_pcm_loopback *pcm = NULL;
|
||||
int ret = 0;
|
||||
uint16_t bits_per_sample = 16;
|
||||
struct msm_pcm_routing_evt event;
|
||||
struct asm_session_mtmx_strtr_param_window_v2_t asm_mtmx_strtr_window;
|
||||
uint32_t param_id;
|
||||
struct msm_pcm_pdata *pdata;
|
||||
|
@ -268,10 +267,6 @@ static int msm_pcm_open(struct snd_pcm_substream *substream)
|
|||
dev_dbg(rtd->platform->dev, "%s: pcm out open: %d,%d\n", __func__,
|
||||
pcm->instance, substream->stream);
|
||||
if (pcm->instance == 2) {
|
||||
struct snd_soc_pcm_runtime *soc_pcm_rx =
|
||||
pcm->playback_substream->private_data;
|
||||
struct snd_soc_pcm_runtime *soc_pcm_tx =
|
||||
pcm->capture_substream->private_data;
|
||||
if (pcm->audio_client != NULL)
|
||||
stop_pcm(pcm);
|
||||
|
||||
|
@ -303,15 +298,6 @@ static int msm_pcm_open(struct snd_pcm_substream *substream)
|
|||
mutex_unlock(&pcm->lock);
|
||||
return -ENOMEM;
|
||||
}
|
||||
event.event_func = msm_pcm_route_event_handler;
|
||||
event.priv_data = (void *) pcm;
|
||||
msm_pcm_routing_reg_phy_stream(soc_pcm_tx->dai_link->be_id,
|
||||
pcm->audio_client->perf_mode,
|
||||
pcm->session_id, pcm->capture_substream->stream);
|
||||
msm_pcm_routing_reg_phy_stream_v2(soc_pcm_rx->dai_link->be_id,
|
||||
pcm->audio_client->perf_mode,
|
||||
pcm->session_id, pcm->playback_substream->stream,
|
||||
event);
|
||||
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
|
||||
pcm->playback_substream = substream;
|
||||
ret = pcm_loopback_set_volume(pcm, pcm->volume);
|
||||
|
@ -422,6 +408,7 @@ static int msm_pcm_prepare(struct snd_pcm_substream *substream)
|
|||
struct snd_pcm_runtime *runtime = substream->runtime;
|
||||
struct msm_pcm_loopback *pcm = runtime->private_data;
|
||||
struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
|
||||
struct msm_pcm_routing_evt event;
|
||||
|
||||
mutex_lock(&pcm->lock);
|
||||
|
||||
|
@ -434,6 +421,23 @@ static int msm_pcm_prepare(struct snd_pcm_substream *substream)
|
|||
if (!pcm->capture_start)
|
||||
pcm->capture_start = 1;
|
||||
}
|
||||
|
||||
if (pcm->instance == 2) {
|
||||
struct snd_soc_pcm_runtime *soc_pcm_rx =
|
||||
pcm->playback_substream->private_data;
|
||||
struct snd_soc_pcm_runtime *soc_pcm_tx =
|
||||
pcm->capture_substream->private_data;
|
||||
event.event_func = msm_pcm_route_event_handler;
|
||||
event.priv_data = (void *) pcm;
|
||||
msm_pcm_routing_reg_phy_stream(soc_pcm_tx->dai_link->be_id,
|
||||
pcm->audio_client->perf_mode,
|
||||
pcm->session_id, pcm->capture_substream->stream);
|
||||
msm_pcm_routing_reg_phy_stream_v2(soc_pcm_rx->dai_link->be_id,
|
||||
pcm->audio_client->perf_mode,
|
||||
pcm->session_id, pcm->playback_substream->stream,
|
||||
event);
|
||||
}
|
||||
|
||||
mutex_unlock(&pcm->lock);
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Reference in a new issue