Skip to content

Commit b82fa9b

Browse files
ferrieuxbroonie
authored andcommitted
ASoC: codecs: aw88261: Fix erroneous bitmask logic in Awinic init
The aw88261_dev_reg_update() function sets the Awinic registers in a rather nonuniform way: - most registers get directly overwritten from the firmware blob - but a handful of them need more delicate logic to preserve some bits from their current value, according to a register- specific mask For the latter, the logic is basically NEW = (OLD & MASK) | (VAL & ~MASK) However, the ~MASK value is hand-computed, and in the specific case of the SYSCTRL register, in a buggy way. This patch restores the proper ~MASK value. Fixes: 028a2ae ("ASoC: codecs: Add aw88261 amplifier driver") Signed-off-by: Alexandre Ferrieux <alexandre.ferrieux@orange.com> Link: https://patch.msgid.link/20260211-aw88261-fwname-v1-1-e24e833a019d@fairphone.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 42a9a5c commit b82fa9b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sound/soc/codecs/aw88261.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,10 @@ static int aw88261_dev_reg_update(struct aw88261 *aw88261,
424424
if (ret)
425425
break;
426426

427+
/* keep all three bits from current hw status */
427428
read_val &= (~AW88261_AMPPD_MASK) | (~AW88261_PWDN_MASK) |
428429
(~AW88261_HMUTE_MASK);
429-
reg_val &= (AW88261_AMPPD_MASK | AW88261_PWDN_MASK | AW88261_HMUTE_MASK);
430+
reg_val &= (AW88261_AMPPD_MASK & AW88261_PWDN_MASK & AW88261_HMUTE_MASK);
430431
reg_val |= read_val;
431432

432433
/* enable uls hmute */

0 commit comments

Comments
 (0)