summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Ferrieux <alexandre.ferrieux@orange.com>2026-02-11 13:27:32 +0300
committerSasha Levin <sashal@kernel.org>2026-03-04 15:20:42 +0300
commit288311849f8e10bbbe69a4faeaba8697894ef634 (patch)
tree846fd23d5a954a12fd33fca95509541af196d745
parent42dbd7cadc2c639e6b6f98090d3d30f7ec20ccfa (diff)
downloadlinux-288311849f8e10bbbe69a4faeaba8697894ef634.tar.xz
ASoC: codecs: aw88261: Fix erroneous bitmask logic in Awinic init
[ Upstream commit b82fa9b0c26eeb2fde6017f7de2c3c544484efef ] 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: 028a2ae25691 ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--sound/soc/codecs/aw88261.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/codecs/aw88261.c b/sound/soc/codecs/aw88261.c
index fb99871578c5..38f362b022aa 100644
--- a/sound/soc/codecs/aw88261.c
+++ b/sound/soc/codecs/aw88261.c
@@ -423,9 +423,10 @@ static int aw88261_dev_reg_update(struct aw88261 *aw88261,
if (ret)
break;
+ /* keep all three bits from current hw status */
read_val &= (~AW88261_AMPPD_MASK) | (~AW88261_PWDN_MASK) |
(~AW88261_HMUTE_MASK);
- reg_val &= (AW88261_AMPPD_MASK | AW88261_PWDN_MASK | AW88261_HMUTE_MASK);
+ reg_val &= (AW88261_AMPPD_MASK & AW88261_PWDN_MASK & AW88261_HMUTE_MASK);
reg_val |= read_val;
/* enable uls hmute */