summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaqar Hameed <waqar.hameed@axis.com>2026-06-29 17:44:59 +0200
committerSebastian Reichel <sebastian.reichel@collabora.com>2026-07-22 02:27:34 +0200
commit50ffe6eedbd8d1ff8fbc2b451bbade8ca3063487 (patch)
tree4c19a8c209058274bf1c54cdacd0212af738d8b7
parent0e2a6f7c0fa69293fa6f53dcf3406a9d7a1b1816 (diff)
downloadlinux-next-50ffe6eedbd8d1ff8fbc2b451bbade8ca3063487.tar.gz
linux-next-50ffe6eedbd8d1ff8fbc2b451bbade8ca3063487.zip
power: supply: bq24190: Disable watchdog with bq24190_write_mask()
The watchdog is disabled by updating the register field with a `bq24190_read()` and `bq24190_write()`. Combine this instead with `bq24190_write_mask(..., 0)`. Signed-off-by: Waqar Hameed <waqar.hameed@axis.com> Link: https://patch.msgid.link/efa4524aa6879fd4452807f747a9e522183246a1.1782746851.git.waqar.hameed@axis.com Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-rw-r--r--drivers/power/supply/bq24190_charger.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/power/supply/bq24190_charger.c b/drivers/power/supply/bq24190_charger.c
index 19f5c61a2986..906b572c708f 100644
--- a/drivers/power/supply/bq24190_charger.c
+++ b/drivers/power/supply/bq24190_charger.c
@@ -751,10 +751,6 @@ static int bq24190_set_config(struct bq24190_dev_info *bdi)
int ret;
u8 v;
- ret = bq24190_read(bdi, BQ24190_REG_CTTC, &v);
- if (ret < 0)
- return ret;
-
/*
* According to the "Host Mode and default Mode" section of the
* manual, a write to any register causes the bq24190 to switch
@@ -763,9 +759,9 @@ static int bq24190_set_config(struct bq24190_dev_info *bdi)
* So, by simply turning off the WDT, we accomplish both with the
* same write.
*/
- v &= ~BQ24190_REG_CTTC_WATCHDOG_MASK;
-
- ret = bq24190_write(bdi, BQ24190_REG_CTTC, v);
+ ret = bq24190_write_mask(bdi, BQ24190_REG_CTTC,
+ BQ24190_REG_CTTC_WATCHDOG_MASK,
+ BQ24190_REG_CTTC_WATCHDOG_SHIFT, 0);
if (ret < 0)
return ret;