ASoC: msm: get CoPP index based on FE id

Get the CoPP idx based on FE id before sending the channel
mixer settings during runtime.

Signed-off-by: Manoj Kumar N D <quic_mnd@quicinc.com>
Change-Id: I2a0fc517bf3e53523679e3108ca6849d2f96e79d
(cherry picked from commit e9c96f97eda6069576731984a146343ccb32d900)
(cherry picked from commit d6d824a975955075d02e2ed3b51f8ef4d6f202b7)
This commit is contained in:
Manoj Kumar N D 2023-09-14 18:14:02 +05:30
commit eb8bc3afa1
5 changed files with 14 additions and 7 deletions

View file

@ -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);
}
}

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);