diff --git a/asoc/msm-compress-q6-v2.c b/asoc/msm-compress-q6-v2.c index 745ff4771efd..70c34d5bdd7a 100644 --- a/asoc/msm-compress-q6-v2.c +++ b/asoc/msm-compress-q6-v2.c @@ -5218,7 +5218,7 @@ static int msm_compr_channel_mixer_cfg_ctl_put(struct snd_kcontrol *kcontrol, if (prtd && prtd->audio_client) { stream_id = prtd->audio_client->session; be_id = chmixer_pspd->port_idx; - msm_pcm_routing_set_channel_mixer_runtime(be_id, + msm_pcm_routing_set_channel_mixer_runtime(fe_id, be_id, stream_id, session_type, chmixer_pspd); } } diff --git a/asoc/msm-pcm-loopback-v2.c b/asoc/msm-pcm-loopback-v2.c index 0746ffd0c349..33a5661ccbe5 100644 --- a/asoc/msm-pcm-loopback-v2.c +++ b/asoc/msm-pcm-loopback-v2.c @@ -1022,7 +1022,7 @@ static int msm_pcm_channel_mixer_cfg_ctl_put(struct snd_kcontrol *kcontrol, if (prtd->audio_client) { stream_id = prtd->audio_client->session; be_id = chmixer_pspd->port_idx; - msm_pcm_routing_set_channel_mixer_runtime(be_id, + msm_pcm_routing_set_channel_mixer_runtime(fe_id, be_id, stream_id, session_type, chmixer_pspd); diff --git a/asoc/msm-pcm-q6-v2.c b/asoc/msm-pcm-q6-v2.c index bb19c4b7d386..5f764a2b36fd 100644 --- a/asoc/msm-pcm-q6-v2.c +++ b/asoc/msm-pcm-q6-v2.c @@ -2681,7 +2681,7 @@ static int msm_pcm_channel_mixer_cfg_ctl_put(struct snd_kcontrol *kcontrol, if (chmixer_pspd->enable && prtd && prtd->audio_client) { stream_id = prtd->audio_client->session; be_id = chmixer_pspd->port_idx; - msm_pcm_routing_set_channel_mixer_runtime(be_id, + msm_pcm_routing_set_channel_mixer_runtime(fe_id, be_id, stream_id, session_type, chmixer_pspd); diff --git a/asoc/msm-pcm-routing-auto.c b/asoc/msm-pcm-routing-auto.c index 14114c820b29..93340557082a 100644 --- a/asoc/msm-pcm-routing-auto.c +++ b/asoc/msm-pcm-routing-auto.c @@ -2361,6 +2361,7 @@ static int msm_pcm_routing_channel_mixer(int fe_id, bool perf_mode, * msm_pcm_routing_set_channel_mixer_runtime - apply channel mixer * setting during runtime. * + * @fe_id: frontend index * @be_id: backend index * @session_id: session index * @session_type: session type @@ -2368,12 +2369,13 @@ static int msm_pcm_routing_channel_mixer(int fe_id, bool perf_mode, * * Retuen: 0 for success, else error */ -int msm_pcm_routing_set_channel_mixer_runtime(int be_id, int session_id, +int msm_pcm_routing_set_channel_mixer_runtime(int fe_id, int be_id, int session_id, int session_type, struct msm_pcm_channel_mixer *params) { int rc = 0; int port_id, copp_idx = 0; + bool tmp = false; be_id--; if (be_id < 0 || be_id >= MSM_BACKEND_DAI_MAX) { @@ -2382,8 +2384,13 @@ int msm_pcm_routing_set_channel_mixer_runtime(int be_id, int session_id, return -EINVAL; } - port_id = msm_bedais[be_id].port_id; - copp_idx = adm_get_default_copp_idx(port_id); + tmp = msm_pcm_routing_get_portid_copp_idx(fe_id, session_type, &port_id, &copp_idx); + + if(!tmp){ + pr_err("%s: Could not find copp_idx for fe_id: %d, will use default copp_idx\n", + __func__, fe_id); + copp_idx = adm_get_default_copp_idx(port_id); + } pr_debug("%s: port_id - %d, copp_idx %d session id - %d\n", __func__, port_id, copp_idx, session_id); diff --git a/asoc/msm-pcm-routing-v2.h b/asoc/msm-pcm-routing-v2.h index d57851b7bec4..40c0045284c7 100644 --- a/asoc/msm-pcm-routing-v2.h +++ b/asoc/msm-pcm-routing-v2.h @@ -819,7 +819,7 @@ int msm_pcm_routing_set_channel_mixer_cfg( struct msm_pcm_channel_mixer *params); int msm_pcm_routing_set_channel_mixer_runtime( - int be_id, int session_id, + int fe_id, int be_id, int session_id, int session_type, struct msm_pcm_channel_mixer *params);