[PATCH 0/3] power: supply: qcom_battmgr: fix SM8350/SM8550 units, acks, and negative temp

From: Alexandru Andrieș via B4 Relay

Date: Wed Nov 18 2026 - 18:17:37 EST


Fix three issues in qcom_battmgr encountered while bringing up PMIC GLINK
battery reporting on a Xiaomi MIX 4 (xiaomi-odin, SM8350):

1. Set battmgr->unit to QCOM_BATTMGR_UNIT_mAh on SM8350 and SM8550 so
charge_full and charge_full_design stop returning -ENODATA.
2. Complete &battmgr->ack on invalid payload length errors in both
callbacks so callers receive -ENODATA immediately instead of stalling
for 1s with -ETIMEDOUT and aborting power_supply_uevent().
3. Change status.temperature and qcom_battmgr_sc8280xp_convert_temp() to
int and cast SM8350 BATT_TEMP values to s32 before dividing by 10 so
sub-zero temperatures do not wrap into large positive values.

Testing:
- Built warning-free (W=1) on arm64 against commit 97d73c825122.
- Tested on a Xiaomi MIX 4 (xiaomi-odin, SM8350) with UPower 1.91.0.
- The SM8550 variant in patch 1, the SC8280XP paths in patches 2 and 3,
and sub-zero battery temperatures (< 0 C) in patch 3 were not
hardware-tested.

AI disclosure:
- Debugged and drafted with assistance from Gemini 4 Carbon
(Antigravity), and reviewed and tested on hardware by the submitter.

---
Alexandru Andrieș (3):
power: supply: qcom_battmgr: set mAh unit for SM8350 and SM8550
power: supply: qcom_battmgr: complete ack on callback payload errors
power: supply: qcom_battmgr: fix negative temperature values

drivers/power/supply/qcom_battmgr.c | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
---
base-commit: 97d73c8251226cf27cc6656b4c542869bb8c69fa
change-id: 20261119-upstream-qcom-battmgr-fixes-v1-004f34587c42

Best regards,
--
Alexandru Andrieș <alex.andries.aa@xxxxxxxxx>