From: Christopher Ruehl chris.ruehl@gtsys.com.hk
[ Upstream commit fee0904441325d83e7578ca457ec65a9d3f21264 ]
The ASUS S15 xElite model report the Li-ion battery with an OOI, hence this update the detection and return the appropriate type.
Signed-off-by: Christopher Ruehl chris.ruehl@gtsys.com.hk Reviewed-by: Dmitry Baryshkov dmitry.baryshkov@oss.qualcomm.com Signed-off-by: Sebastian Reichel sebastian.reichel@collabora.com Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES – this patch is a focused bug fix that lets the Qualcomm battery manager report the correct technology for hardware already supported by stable kernels.
- `drivers/power/supply/qcom_battmgr.c:986` broadens the existing Li-ion match to accept the firmware string `OOI`, which the ASUS S15 xElite uses for its Li-ion pack; without this, the driver falls through to the error path. - Because the fallback logs `pr_err("Unknown battery technology '%s'")` at `drivers/power/supply/qcom_battmgr.c:990`, affected systems currently emit misleading kernel errors and expose `POWER_SUPPLY_PROP_TECHNOLOGY` as `UNKNOWN`, confusing user space (see the assignment at `drivers/power/supply/qcom_battmgr.c:1039`). - The change mirrors the earlier `LIP` support that was already accepted upstream for another device, touches only a single helper, and has no dependencies, so it is safe to integrate into older stable trees that already ship this driver. - Risk is minimal: it simply recognizes an existing firmware identifier and maps it to the already-supported `POWER_SUPPLY_TECHNOLOGY_LION` value, with no architectural impact or behavioral change for other devices.
Natural next step: 1) Queue for the stable trees that include `drivers/power/supply/qcom_battmgr.c` so ASUS S15 xElite users stop seeing bogus error logs and get the correct battery technology reported.
drivers/power/supply/qcom_battmgr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/power/supply/qcom_battmgr.c b/drivers/power/supply/qcom_battmgr.c index 99808ea9851f6..fdb2d1b883fc5 100644 --- a/drivers/power/supply/qcom_battmgr.c +++ b/drivers/power/supply/qcom_battmgr.c @@ -982,7 +982,8 @@ static void qcom_battmgr_sc8280xp_strcpy(char *dest, const char *src)
static unsigned int qcom_battmgr_sc8280xp_parse_technology(const char *chemistry) { - if (!strncmp(chemistry, "LIO", BATTMGR_CHEMISTRY_LEN)) + if ((!strncmp(chemistry, "LIO", BATTMGR_CHEMISTRY_LEN)) || + (!strncmp(chemistry, "OOI", BATTMGR_CHEMISTRY_LEN))) return POWER_SUPPLY_TECHNOLOGY_LION; if (!strncmp(chemistry, "LIP", BATTMGR_CHEMISTRY_LEN)) return POWER_SUPPLY_TECHNOLOGY_LIPO;