From 2f81be27d8e30cf71e49d33a1cc3d49c1d21ed4d Mon Sep 17 00:00:00 2001 From: Erin Yan Date: Mon, 29 Apr 2019 13:42:57 +0800 Subject: [PATCH] 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 --- asoc/msm-compress-q6-v2.c | 6 +++--- asoc/msm-pcm-q6-v2.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/asoc/msm-compress-q6-v2.c b/asoc/msm-compress-q6-v2.c index d9e0927bc034..a3618caa5e73 100644 --- a/asoc/msm-compress-q6-v2.c +++ b/asoc/msm-compress-q6-v2.c @@ -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); } } diff --git a/asoc/msm-pcm-q6-v2.c b/asoc/msm-pcm-q6-v2.c index 3b20ecc84570..af158432630f 100644 --- a/asoc/msm-pcm-q6-v2.c +++ b/asoc/msm-pcm-q6-v2.c @@ -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,