[PATCH] power: supply: mt6360_charger: Set the input voltage limit in CHG_CTRL6

Rui Cao via B4 Relay devnull+i.udp0.com at kernel.org
Sat Nov 7 03:09:36 PST 2026


From: Rui Cao <i at udp0.com>

mt6360_charger_set_mivr() updates the MIVR field (bits 7:1) of
CHG_CTRL3, but MIVR lives in CHG_CTRL6, where mt6360_charger_get_mivr()
reads it and MediaTek's own MT6360 charger driver writes it. CHG_CTRL3
holds the input current limit (AICR, bits 7:2) instead.

Writing input_voltage_limit therefore never changed the voltage limit
and replaced the input current limit with the MIVR selector: 4.5 V, for
example, set AICR to 250 mA.

Write the MIVR field of CHG_CTRL6.

Tested on a Redmi Note 13 5G (MT6833 with an MT6360): with this change,
writing 4.6 V to input_voltage_limit only moves CHG_CTRL6 from 0x0d to
0x0f and reads back as 4.6 V, while CHG_CTRL3 stays at 0x72 and
input_current_limit at 1.5 A.

Fixes: 0402e8ebb8b8 ("power: supply: mt6360_charger: add MT6360 charger support")
Cc: stable at vger.kernel.org
Signed-off-by: Rui Cao <i at udp0.com>
---
 drivers/power/supply/mt6360_charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/mt6360_charger.c b/drivers/power/supply/mt6360_charger.c
index b4d46234315..ccd5c200629 100644
--- a/drivers/power/supply/mt6360_charger.c
+++ b/drivers/power/supply/mt6360_charger.c
@@ -414,7 +414,7 @@ static int mt6360_charger_set_mivr(struct mt6360_chg_info *mci,
 
 	linear_range_get_selector_within(&mt6360_chg_range[MT6360_RANGE_VMIVR], val->intval, &sel);
 	return regmap_update_bits(mci->regmap,
-				  MT6360_PMU_CHG_CTRL3,
+				  MT6360_PMU_CHG_CTRL6,
 				  MT6360_VMIVR_MASK,
 				  sel << MT6360_VMIVR_SHFT);
 }

---
base-commit: d48723711bae9b8cdc56719c448ba42fef28cbee
change-id: 20261107-mt6360-charger-mivr-3d9e7ce66fd2

Best regards,
--  
Rui Cao <i at udp0.com>





More information about the Linux-mediatek mailing list