mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] power: supply: bq256xx: Init ichg/vbat value with chip default value
@ 2023-01-10  2:47 Hermes Zhang
  2023-02-03 12:33 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Hermes Zhang @ 2023-01-10  2:47 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: kernel, Hermes Zhang, linux-pm, linux-kernel

Init the ichg/vbat reg with chip default value instead of the max value
used now. The max value set in driver will result an unsafe case (e.g.
battery is over charging when in a hot environment) if no user space
update the value later.

Signed-off-by: Hermes Zhang <chenhuiz@axis.com>
---

Notes:
    V2

 drivers/power/supply/bq256xx_charger.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/supply/bq256xx_charger.c b/drivers/power/supply/bq256xx_charger.c
index 01ad84fd147c..6b5435bf2ed4 100644
--- a/drivers/power/supply/bq256xx_charger.c
+++ b/drivers/power/supply/bq256xx_charger.c
@@ -1563,7 +1563,7 @@ static int bq256xx_hw_init(struct bq256xx_device *bq)
 		return ret;
 
 	ret = bq->chip_info->bq256xx_set_ichg(bq,
-				bat_info->constant_charge_current_max_ua);
+				bq->chip_info->bq256xx_def_ichg);
 	if (ret)
 		return ret;
 
@@ -1573,7 +1573,7 @@ static int bq256xx_hw_init(struct bq256xx_device *bq)
 		return ret;
 
 	ret = bq->chip_info->bq256xx_set_vbatreg(bq,
-				bat_info->constant_charge_voltage_max_uv);
+				bq->chip_info->bq256xx_def_vbatreg);
 	if (ret)
 		return ret;
 
-- 
2.30.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] power: supply: bq256xx: Init ichg/vbat value with chip default value
  2023-01-10  2:47 [PATCH v2] power: supply: bq256xx: Init ichg/vbat value with chip default value Hermes Zhang
@ 2023-02-03 12:33 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2023-02-03 12:33 UTC (permalink / raw)
  To: Hermes Zhang; +Cc: kernel, linux-pm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1373 bytes --]

Hi,

On Tue, Jan 10, 2023 at 10:47:46AM +0800, Hermes Zhang wrote:
> Init the ichg/vbat reg with chip default value instead of the max value
> used now. The max value set in driver will result an unsafe case (e.g.
> battery is over charging when in a hot environment) if no user space
> update the value later.
> 
> Signed-off-by: Hermes Zhang <chenhuiz@axis.com>
> ---

Thanks, queued.

-- Sebastian

> 
> Notes:
>     V2
> 
>  drivers/power/supply/bq256xx_charger.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/power/supply/bq256xx_charger.c b/drivers/power/supply/bq256xx_charger.c
> index 01ad84fd147c..6b5435bf2ed4 100644
> --- a/drivers/power/supply/bq256xx_charger.c
> +++ b/drivers/power/supply/bq256xx_charger.c
> @@ -1563,7 +1563,7 @@ static int bq256xx_hw_init(struct bq256xx_device *bq)
>  		return ret;
>  
>  	ret = bq->chip_info->bq256xx_set_ichg(bq,
> -				bat_info->constant_charge_current_max_ua);
> +				bq->chip_info->bq256xx_def_ichg);
>  	if (ret)
>  		return ret;
>  
> @@ -1573,7 +1573,7 @@ static int bq256xx_hw_init(struct bq256xx_device *bq)
>  		return ret;
>  
>  	ret = bq->chip_info->bq256xx_set_vbatreg(bq,
> -				bat_info->constant_charge_voltage_max_uv);
> +				bq->chip_info->bq256xx_def_vbatreg);
>  	if (ret)
>  		return ret;
>  
> -- 
> 2.30.2
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-03 12:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-10  2:47 [PATCH v2] power: supply: bq256xx: Init ichg/vbat value with chip default value Hermes Zhang
2023-02-03 12:33 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®