asoc: adapt channel mixer usage to tinymix

Tinymix set the array value of the mixer control one by one. The
channel number validation check here will cause failure in tinymix.
Allow 0 value here is fine because the parameters will be checked
before they are set at runtime.

Change-Id: I49c23f84aa081550434696dde96d2800e90390fb
Signed-off-by: Erin Yan <xinyey@codeaurora.org>
This commit is contained in:
Erin Yan 2019-04-29 13:42:57 +08:00 • committed by Gerrit - the friendly Code Review server
commit 2f81be27d8
2 changed files with 5 additions and 5 deletions

View file

@ -4738,9 +4738,9 @@ static int msm_compr_channel_mixer_cfg_ctl_put(struct snd_kcontrol *kcontrol,
chmixer_pspd->output_channel = ucontrol->value.integer.value[3];
chmixer_pspd->port_idx = ucontrol->value.integer.value[4];
if (chmixer_pspd->input_channel <= 0 ||
if (chmixer_pspd->input_channel < 0 ||
chmixer_pspd->input_channel > PCM_FORMAT_MAX_NUM_CHANNEL_V8 ||
chmixer_pspd->output_channel <= 0 ||
chmixer_pspd->output_channel < 0 ||
chmixer_pspd->output_channel > PCM_FORMAT_MAX_NUM_CHANNEL_V8) {
pr_err("%s: Invalid channels, in %d, out %d\n",
__func__, chmixer_pspd->input_channel,
@ -4795,7 +4795,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;
ret = msm_pcm_routing_set_channel_mixer_runtime(be_id,
msm_pcm_routing_set_channel_mixer_runtime(be_id,
stream_id, session_type, chmixer_pspd);
}
}

View file

@ -1934,9 +1934,9 @@ static int msm_pcm_channel_mixer_cfg_ctl_put(struct snd_kcontrol *kcontrol,
chmixer_pspd->output_channel = ucontrol->value.integer.value[3];
chmixer_pspd->port_idx = ucontrol->value.integer.value[4];
if (chmixer_pspd->input_channel <= 0 ||
if (chmixer_pspd->input_channel < 0 ||
chmixer_pspd->input_channel > PCM_FORMAT_MAX_NUM_CHANNEL_V8 ||
chmixer_pspd->output_channel <= 0 ||
chmixer_pspd->output_channel < 0 ||
chmixer_pspd->output_channel > PCM_FORMAT_MAX_NUM_CHANNEL_V8) {
pr_err("%s: Invalid channels, in %d, out %d\n",
__func__, chmixer_pspd->input_channel,