Skip to content

Commit 996d5d5

Browse files
stephan-ghdtor
authored andcommitted
Input: pm8xxx-vib - fix handling of separate enable register
Setting the vibrator enable_mask is not implemented correctly: For regmap_update_bits(map, reg, mask, val) we give in either regs->enable_mask or 0 (= no-op) as mask and "val" as value. But "val" actually refers to the vibrator voltage control register, which has nothing to do with the enable_mask. So we usually end up doing nothing when we really wanted to enable the vibrator. We want to set or clear the enable_mask (to enable/disable the vibrator). Therefore, change the call to always modify the enable_mask and set the bits only if we want to enable the vibrator. Fixes: d4c7c5c ("Input: pm8xxx-vib - handle separate enable register") Signed-off-by: Stephan Gerhold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent ba9a103 commit 996d5d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/input/misc/pm8xxx-vibrator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static int pm8xxx_vib_set(struct pm8xxx_vib *vib, bool on)
9090

9191
if (regs->enable_mask)
9292
rc = regmap_update_bits(vib->regmap, regs->enable_addr,
93-
on ? regs->enable_mask : 0, val);
93+
regs->enable_mask, on ? ~0 : 0);
9494

9595
return rc;
9696
}

0 commit comments

Comments
 (0)