From f5f76777192bc5591fb005f067de501705d68fd7 Mon Sep 17 00:00:00 2001 From: Derek Chen Date: Wed, 10 May 2017 17:16:38 -0400 Subject: [PATCH] ASoC: msm: qdsp6v2: set voc type according to stream type Set voc path type according to stream type during routing preparation for voice session to fix uninitialized voc path type causing voc device port configuration failure. CRs-fixed: 2045461 Change-Id: I4983ba55b1854879680b6d13c33904a522092eb0 Signed-off-by: Derek Chen --- sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c b/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c index 0f63fd6bbd00..d2cd318b0e8c 100644 --- a/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c +++ b/sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c @@ -14270,10 +14270,10 @@ static int msm_pcm_routing_prepare(struct snd_pcm_substream *substream) pr_debug("%s voice session_id: 0x%x\n", __func__, session_id); - if (session_type == SESSION_TYPE_TX) - voc_path_type = TX_PATH; - else + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) voc_path_type = RX_PATH; + else + voc_path_type = TX_PATH; voc_set_route_flag(session_id, voc_path_type, 1);