Commit 300aa286 authored by Srinivas Kandagatla's avatar Srinivas Kandagatla Committed by Zheng Zengkai
Browse files

ASoC: codecs: wcd934x: return correct value from mixer put

stable inclusion
from stable-v5.10.85
commit 4458938b297ee88732cbf639c88bb81fa1f05463
bugzilla: 186032 https://gitee.com/openeuler/kernel/issues/I4QVI4

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4458938b297ee88732cbf639c88bb81fa1f05463



--------------------------------

commit d9be0ff4 upstream.

wcd934x_compander_set() currently returns zero eventhough it changes the value.
Fix this, so that change notifications are sent correctly.

Fixes: 1cde8b82 ("ASoC: wcd934x: add basic controls")
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211130160507.22180-4-srinivas.kandagatla@linaro.org


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 1ca683ce
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -2470,6 +2470,9 @@ static int wcd934x_compander_set(struct snd_kcontrol *kc,
	int value = ucontrol->value.integer.value[0];
	int sel;

	if (wcd->comp_enabled[comp] == value)
		return 0;

	wcd->comp_enabled[comp] = value;
	sel = value ? WCD934X_HPH_GAIN_SRC_SEL_COMPANDER :
		WCD934X_HPH_GAIN_SRC_SEL_REGISTER;
@@ -2493,10 +2496,10 @@ static int wcd934x_compander_set(struct snd_kcontrol *kc,
	case COMPANDER_8:
		break;
	default:
		break;
		return 0;
	}

	return 0;
	return 1;
}

static int wcd934x_rx_hph_mode_get(struct snd_kcontrol *kc,