Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f81be27 authored by Erin Yan's avatar Erin Yan Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarErin Yan <xinyey@codeaurora.org>
parent c63ec8cd
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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);
		}
	}
+2 −2
Original line number Diff line number Diff line
@@ -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,