The previous fix for event generation for custom controls compared the
value already in the register with the value being written, missing the
logic that only applies the value to the register when the control is
already enabled. Fix this, compare the value cached in the driver data
rather than the register.
This should really be an autodisable control rather than open coded.
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220428113221.15326-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
unsigned int sel = ucontrol->value.integer.value[0];
unsigned int val = snd_soc_component_read(component, mc->reg);
unsigned int *select;
+ int change;
switch (mc->reg) {
case M98090_REG_MIC1_INPUT_LEVEL:
if (sel < 0 || sel > mc->max)
return -EINVAL;
+ change = *select != sel;
*select = sel;
/* Setting a volume is only valid if it is already On */
mask << mc->shift,
sel << mc->shift);
- return *select != val;
+ return change;
}
static const char *max98090_perf_pwr_text[] =