[PATCH] power: supply: qcom_battmgr: Add lithium-polymer entry

Abel Vesa posted 1 patch 7 months ago
drivers/power/supply/qcom_battmgr.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH] power: supply: qcom_battmgr: Add lithium-polymer entry
Posted by Abel Vesa 7 months ago
On some Dell XPS 13 (9345) variants, the battery used is lithium-polymer
based. Currently, this is reported as unknown technology due to the entry
missing.

[ 4083.135325] Unknown battery technology 'LIP'

Add another check for lithium-polymer in the technology parsing callback
and return that instead of unknown.

Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
---
 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 fe27676fbc7cd12292caa6fb3b5b46a18c426e6d..32c85939b8973422ee417c3f1552f2355658cf06 100644
--- a/drivers/power/supply/qcom_battmgr.c
+++ b/drivers/power/supply/qcom_battmgr.c
@@ -981,6 +981,8 @@ static unsigned int qcom_battmgr_sc8280xp_parse_technology(const char *chemistry
 {
 	if (!strncmp(chemistry, "LIO", BATTMGR_CHEMISTRY_LEN))
 		return POWER_SUPPLY_TECHNOLOGY_LION;
+	else if (!strncmp(chemistry, "LIP", BATTMGR_CHEMISTRY_LEN))
+		return POWER_SUPPLY_TECHNOLOGY_LIPO;
 
 	pr_err("Unknown battery technology '%s'\n", chemistry);
 	return POWER_SUPPLY_TECHNOLOGY_UNKNOWN;

---
base-commit: 176e917e010cb7dcc605f11d2bc33f304292482b
change-id: 20250523-psy-qcom-battmgr-add-lipo-entry-e75b3be303b6

Best regards,
-- 
Abel Vesa <abel.vesa@linaro.org>
Re: [PATCH] power: supply: qcom_battmgr: Add lithium-polymer entry
Posted by Sebastian Reichel 6 months ago
On Fri, 23 May 2025 13:14:22 +0300, Abel Vesa wrote:
> On some Dell XPS 13 (9345) variants, the battery used is lithium-polymer
> based. Currently, this is reported as unknown technology due to the entry
> missing.
> 
> [ 4083.135325] Unknown battery technology 'LIP'
> 
> Add another check for lithium-polymer in the technology parsing callback
> and return that instead of unknown.
> 
> [...]

Applied, thanks!

[1/1] power: supply: qcom_battmgr: Add lithium-polymer entry
      commit: 202ac22b8e2e015e6c196fd8113f3d2a62dd1afc

Best regards,
-- 
Sebastian Reichel <sebastian.reichel@collabora.com>
Re: [PATCH] power: supply: qcom_battmgr: Add lithium-polymer entry
Posted by Dmitry Baryshkov 7 months ago
On Fri, May 23, 2025 at 01:14:22PM +0300, Abel Vesa wrote:
> On some Dell XPS 13 (9345) variants, the battery used is lithium-polymer
> based. Currently, this is reported as unknown technology due to the entry
> missing.
> 
> [ 4083.135325] Unknown battery technology 'LIP'
> 
> Add another check for lithium-polymer in the technology parsing callback
> and return that instead of unknown.
> 
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> ---
>  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 fe27676fbc7cd12292caa6fb3b5b46a18c426e6d..32c85939b8973422ee417c3f1552f2355658cf06 100644
> --- a/drivers/power/supply/qcom_battmgr.c
> +++ b/drivers/power/supply/qcom_battmgr.c
> @@ -981,6 +981,8 @@ static unsigned int qcom_battmgr_sc8280xp_parse_technology(const char *chemistry
>  {
>  	if (!strncmp(chemistry, "LIO", BATTMGR_CHEMISTRY_LEN))
>  		return POWER_SUPPLY_TECHNOLOGY_LION;
> +	else if (!strncmp(chemistry, "LIP", BATTMGR_CHEMISTRY_LEN))

no need for 'else'.

With that fixed:

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>


> +		return POWER_SUPPLY_TECHNOLOGY_LIPO;
>  
>  	pr_err("Unknown battery technology '%s'\n", chemistry);
>  	return POWER_SUPPLY_TECHNOLOGY_UNKNOWN;
> 
> ---
> base-commit: 176e917e010cb7dcc605f11d2bc33f304292482b
> change-id: 20250523-psy-qcom-battmgr-add-lipo-entry-e75b3be303b6
> 
> Best regards,
> -- 
> Abel Vesa <abel.vesa@linaro.org>
> 

-- 
With best wishes
Dmitry
Re: [PATCH] power: supply: qcom_battmgr: Add lithium-polymer entry
Posted by Sebastian Reichel 6 months ago
Hi,

On Fri, May 23, 2025 at 01:44:09PM +0300, Dmitry Baryshkov wrote:
> On Fri, May 23, 2025 at 01:14:22PM +0300, Abel Vesa wrote:
> > On some Dell XPS 13 (9345) variants, the battery used is lithium-polymer
> > based. Currently, this is reported as unknown technology due to the entry
> > missing.
> > 
> > [ 4083.135325] Unknown battery technology 'LIP'
> > 
> > Add another check for lithium-polymer in the technology parsing callback
> > and return that instead of unknown.
> > 
> > Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> > ---
> >  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 fe27676fbc7cd12292caa6fb3b5b46a18c426e6d..32c85939b8973422ee417c3f1552f2355658cf06 100644
> > --- a/drivers/power/supply/qcom_battmgr.c
> > +++ b/drivers/power/supply/qcom_battmgr.c
> > @@ -981,6 +981,8 @@ static unsigned int qcom_battmgr_sc8280xp_parse_technology(const char *chemistry
> >  {
> >  	if (!strncmp(chemistry, "LIO", BATTMGR_CHEMISTRY_LEN))
> >  		return POWER_SUPPLY_TECHNOLOGY_LION;
> > +	else if (!strncmp(chemistry, "LIP", BATTMGR_CHEMISTRY_LEN))
> 
> no need for 'else'.

I fixed that up while applying.

Greetings,

-- Sebastian

> 
> With that fixed:
> 
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> 
> 
> > +		return POWER_SUPPLY_TECHNOLOGY_LIPO;
> >  
> >  	pr_err("Unknown battery technology '%s'\n", chemistry);
> >  	return POWER_SUPPLY_TECHNOLOGY_UNKNOWN;
> > 
> > ---
> > base-commit: 176e917e010cb7dcc605f11d2bc33f304292482b
> > change-id: 20250523-psy-qcom-battmgr-add-lipo-entry-e75b3be303b6
> > 
> > Best regards,
> > -- 
> > Abel Vesa <abel.vesa@linaro.org>
> > 
> 
> -- 
> With best wishes
> Dmitry