Skip to contentSkip to conversation

power: supply: qcom_battmgr: Recognize "LiP" as lithium-polymer

PATCH Applied Val Packett 4 participants 4 messages Jan 20 – Jan 30

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 power: supply: qcom_battmgr: Recognize "LiP" as lithium-polymer

On the Dell Latitude 7455, the firmware uses "LiP" with a lowercase 'i' for the battery chemistry type, but only all-uppercase "LIP" was being recognized. Add the CamelCase variant to the check to fix the "Unknown battery technology" warning.

Fixes 202ac22b8e2e ("power: supply: qcom_battmgr: Add lithium-polymer entry")

---
v2: removed extra parentheses
v1: https://lore.kernel.org/all/[email protected]/

 drivers/power/supply/qcom_battmgr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/power/supply/qcom_battmgr.c +2 -1
index c8028606bba0..80572ee945b4 100644
@@ -1240,7 +1240,8 @@ static unsigned int qcom_battmgr_sc8280xp_parse_technology(const char *chemistry
 	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))
+	if (!strncmp(chemistry, "LIP", BATTMGR_CHEMISTRY_LEN) ||
+	    !strncmp(chemistry, "LiP", BATTMGR_CHEMISTRY_LEN))
 		return POWER_SUPPLY_TECHNOLOGY_LIPO;
 
 	pr_err("Unknown battery technology '%s'\n", chemistry);
Signature · 1 line
2.51.2
Reviewed-by on v2 1/1
#1 lore raw
Quoted 5 lines · Val Packett

On the Dell Latitude 7455, the firmware uses "LiP" with a lowercase 'i' for the battery chemistry type, but only all-uppercase "LIP" was being recognized. Add the CamelCase variant to the check to fix the "Unknown battery technology" warning.

Quoted 9 lines
Fixes 202ac22b8e2e ("power: supply: qcom_battmgr: Add lithium-polymer entry")

---
v2: removed extra parentheses
v1: https://lore.kernel.org/all/[email protected]/

 drivers/power/supply/qcom_battmgr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Thanks!

Signature · 2 lines
With best wishes
Dmitry
Reviewed-by on v2 1/1
#2 lore raw
In reply to Val Packett
Quoted 8 lines · Val Packett

On the Dell Latitude 7455, the firmware uses "LiP" with a lowercase 'i' for the battery chemistry type, but only all-uppercase "LIP" was being recognized. Add the CamelCase variant to the check to fix the "Unknown battery technology" warning.

Fixes 202ac22b8e2e ("power: supply: qcom_battmgr: Add lithium-polymer entry")

---

FYI I *think* this data comes from vendors so this list may end up growing and growing..

Konrad

#3 lore raw
In reply to Val Packett
Quoted 6 lines · Val Packett

On the Dell Latitude 7455, the firmware uses "LiP" with a lowercase 'i' for the battery chemistry type, but only all-uppercase "LIP" was being recognized. Add the CamelCase variant to the check to fix the "Unknown battery technology" warning.

Applied, thanks!

[1/1] power: supply: qcom_battmgr: Recognize "LiP" as lithium-polymer

      commit: c655f45480637aee326b5bd96488d35ab90db2b0

Best regards,

Signature · 1 line
Sebastian Reichel <[email protected]>