[PATCH 1/3] power: supply: qcom_battmgr: set mAh unit for SM8350 and SM8550
From: Alexandru Andrieș via B4 Relay
Date: Wed Nov 18 2026 - 18:17:29 EST
From: Alexandru Andrieș <alex.andries.aa@xxxxxxxxx>
battmgr->unit is only populated by BATTMGR_BAT_INFO on SC8280XP and
X1E80100, remaining QCOM_BATTMGR_UNIT_mWh (0) on SM8350 and SM8550 where
firmware reports BATT_CHG_FULL and BATT_CHG_FULL_DESIGN in uAh via
BATTMGR_BAT_PROPERTY_GET. Consequently, charge_full and
charge_full_design always return -ENODATA, preventing UPower from
computing battery energy and health.
Set battmgr->unit to QCOM_BATTMGR_UNIT_mAh when probing SM8350 and
SM8550.
Tested on a Xiaomi MIX 4 (SM8350): charge_full (4256000) and
charge_full_design (4360000) are now reported. SM8550 shares the same
property path and was not tested.
Fixes: 29e8142b5623 ("power: supply: Introduce Qualcomm PMIC GLINK power supply")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Alexandru Andrieș <alex.andries.aa@xxxxxxxxx>
---
drivers/power/supply/qcom_battmgr.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/power/supply/qcom_battmgr.c b/drivers/power/supply/qcom_battmgr.c
index 58e238e6fb2a..c07e2db8f242 100644
--- a/drivers/power/supply/qcom_battmgr.c
+++ b/drivers/power/supply/qcom_battmgr.c
@@ -1717,6 +1717,8 @@ static int qcom_battmgr_probe(struct auxiliary_device *adev,
return dev_err_probe(dev, PTR_ERR(battmgr->wls_psy),
"failed to register wireless charing power supply\n");
} else {
+ battmgr->unit = QCOM_BATTMGR_UNIT_mAh;
+
if (battmgr->variant == QCOM_BATTMGR_SM8550)
psy_desc = &sm8550_bat_psy_desc;
else
--
2.56.1