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

Val Packett posted 1 patch 3 weeks ago
There is a newer version of this series
drivers/power/supply/qcom_battmgr.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] power: supply: qcom_battmgr: Recognize "LiP" as lithium-polymer
Posted by Val Packett 3 weeks ago
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")
Signed-off-by: Val Packett <val@packett.cool>
---
 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 c8028606bba0..80e701c66434 100644
--- a/drivers/power/supply/qcom_battmgr.c
+++ b/drivers/power/supply/qcom_battmgr.c
@@ -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);
-- 
2.51.2
Re: [PATCH] power: supply: qcom_battmgr: Recognize "LiP" as lithium-polymer
Posted by Dmitry Baryshkov 2 weeks, 6 days ago
On Sat, Jan 17, 2026 at 06:09:24PM -0300, Val Packett wrote:
> 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")
> Signed-off-by: Val Packett <val@packett.cool>
> ---
>  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 c8028606bba0..80e701c66434 100644
> --- a/drivers/power/supply/qcom_battmgr.c
> +++ b/drivers/power/supply/qcom_battmgr.c
> @@ -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)))

Why do you have extra brackets around the second strncmp?

>  		return POWER_SUPPLY_TECHNOLOGY_LIPO;
>  
>  	pr_err("Unknown battery technology '%s'\n", chemistry);
> -- 
> 2.51.2
> 

-- 
With best wishes
Dmitry
Re: [PATCH] power: supply: qcom_battmgr: Recognize "LiP" as lithium-polymer
Posted by Val Packett 2 weeks, 4 days ago
On 1/19/26 3:38 AM, Dmitry Baryshkov wrote:
> On Sat, Jan 17, 2026 at 06:09:24PM -0300, Val Packett wrote:
>> 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")
>> Signed-off-by: Val Packett <val@packett.cool>
>> ---
>>   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 c8028606bba0..80e701c66434 100644
>> --- a/drivers/power/supply/qcom_battmgr.c
>> +++ b/drivers/power/supply/qcom_battmgr.c
>> @@ -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)))
> Why do you have extra brackets around the second strncmp?

Copy-pasted from the line above (the "OOI" one) :) Didn't see that the 
first one in this expression doesn't have them.

Feel free to edit this when applying

~val
Re: [PATCH] power: supply: qcom_battmgr: Recognize "LiP" as lithium-polymer
Posted by Dmitry Baryshkov 2 weeks, 4 days ago
On Tue, Jan 20, 2026 at 08:14:12PM -0300, Val Packett wrote:
> 
> On 1/19/26 3:38 AM, Dmitry Baryshkov wrote:
> > On Sat, Jan 17, 2026 at 06:09:24PM -0300, Val Packett wrote:
> > > 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")
> > > Signed-off-by: Val Packett <val@packett.cool>
> > > ---
> > >   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 c8028606bba0..80e701c66434 100644
> > > --- a/drivers/power/supply/qcom_battmgr.c
> > > +++ b/drivers/power/supply/qcom_battmgr.c
> > > @@ -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)))
> > Why do you have extra brackets around the second strncmp?
> 
> Copy-pasted from the line above (the "OOI" one) :) Didn't see that the first
> one in this expression doesn't have them.
> 
> Feel free to edit this when applying

It depends on Sebastian, but I'd kindly suggest sending v2.

-- 
With best wishes
Dmitry