[PATCH 3/6] power: supply: max77759: disable AUTOIBUS for CHGIN_ILIM

From: André Draszik

Date: Fri Nov 27 2026 - 14:10:07 EST


Programming CHGIN_ILIM in CHG_CNFG_09 leaves hardware automatic input
current limit selection (AUTOIBUS) in whatever state earlier firmware
left it, so the programmed input current limit depends on bootloader
setup. On Pixel 6 the bootloader already leaves CHG_CNFG_09 at 0xbb
with bit 7 set, so there is no behavioural change on the only in-tree
board, but boards whose firmware leaves AUTOIBUS enabled are not
guaranteed to honour CHGIN_ILIM.

set_input_current_limit() updates only CHGIN_ILIM (bits [6:0]) in
CHG_CNFG_09 and never sets bit 7 (NO_AUTOIBUS).

Define MAX77759_CHGR_REG_CHG_CNFG_09_NO_AUTOIBUS (BIT(7)) and set it
together with CHGIN_ILIM whenever programming the input current limit.

Fixes: 70d7dd27f6dc ("power: supply: max77759: add charger driver")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: André Draszik <andre.draszik@xxxxxxxxxx>
---
drivers/power/supply/max77759_charger.c | 5 ++++-
include/linux/mfd/max77759.h | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/power/supply/max77759_charger.c b/drivers/power/supply/max77759_charger.c
index 6876ae0a8188..49ab1766cc5d 100644
--- a/drivers/power/supply/max77759_charger.c
+++ b/drivers/power/supply/max77759_charger.c
@@ -355,8 +355,11 @@ static int set_input_current_limit(struct max77759_charger *chg, int ilim_ua)
linear_range_get_selector_within(chgin_ilim_ranges, ilim_ua, &regval);

return regmap_update_bits(chg->regmap, MAX77759_CHGR_REG_CHG_CNFG_09,
+ MAX77759_CHGR_REG_CHG_CNFG_09_NO_AUTOIBUS |
MAX77759_CHGR_REG_CHG_CNFG_09_CHGIN_ILIM,
- regval);
+ MAX77759_CHGR_REG_CHG_CNFG_09_NO_AUTOIBUS |
+ FIELD_PREP(MAX77759_CHGR_REG_CHG_CNFG_09_CHGIN_ILIM,
+ regval));
}

static const enum power_supply_property max77759_charger_props[] = {
diff --git a/include/linux/mfd/max77759.h b/include/linux/mfd/max77759.h
index 7c0b13219d51..79d248df4c9f 100644
--- a/include/linux/mfd/max77759.h
+++ b/include/linux/mfd/max77759.h
@@ -102,6 +102,7 @@
#define MAX77759_CHGR_REG_CHG_CNFG_07 0xc0
#define MAX77759_CHGR_REG_CHG_CNFG_08 0xc1
#define MAX77759_CHGR_REG_CHG_CNFG_09 0xc2
+#define MAX77759_CHGR_REG_CHG_CNFG_09_NO_AUTOIBUS BIT(7)
#define MAX77759_CHGR_REG_CHG_CNFG_09_CHGIN_ILIM GENMASK(6, 0)
#define MAX77759_CHGR_REG_CHG_CNFG_10 0xc3
#define MAX77759_CHGR_REG_CHG_CNFG_11 0xc4

--
2.56.1.839.g22a8290db9-goog