Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: ad5398: Fix incorrect power down bit mask

AD5398_SW_POWER_DOWN was defined with a bit position outside the valid
range of the device's 16-bit register. The bitwise operation with an
unsigned short would always evaluate to 0, making the power down check
ineffective.

Update AD5398_SW_POWER_DOWN to use a valid bit position within the
16-bit range of the register.

Fixes: 19d022d67d73 ("regulator: ad5398: change enable bit name to improve readibility")
Signed-off-by: Dheeraj Reddy Jonnalagadda <dheeraj.linuxdev@gmail.com>
Link: https://patch.msgid.link/20250206103153.59114-1-dheeraj.linuxdev@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Dheeraj Reddy Jonnalagadda and committed by
Mark Brown
0a7c85b5 3c32a438

+1 -1
+1 -1
drivers/regulator/ad5398.c
··· 16 16 #include <linux/regulator/machine.h> 17 17 #include <linux/regulator/of_regulator.h> 18 18 19 - #define AD5398_SW_POWER_DOWN BIT(16) 19 + #define AD5398_SW_POWER_DOWN BIT(15) 20 20 21 21 struct ad5398_chip_info { 22 22 struct i2c_client *client;