Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH] power: supply: bq256xx: Remove init ichg/vbat with max value
@ 2022-11-29  9:01 Hermes Zhang
  2022-11-29 15:27 ` Sebastian Reichel
  0 siblings, 1 reply; 6+ messages in thread
From: Hermes Zhang @ 2022-11-29  9:01 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: kernel, Hermes Zhang, linux-pm, linux-kernel

Init the ichg and vbat reg with max value is not good. First the chip
already has a default value for ichg and vbat (small value). Init these
two reg with max value will result an unsafe case (e.g. battery is over
charging in a hot environment) if no user space change them later.

Signed-off-by: Hermes Zhang <chenhuiz@axis.com>
---
 drivers/power/supply/bq256xx_charger.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/power/supply/bq256xx_charger.c b/drivers/power/supply/bq256xx_charger.c
index 01ad84fd147c..d1aa92c10c22 100644
--- a/drivers/power/supply/bq256xx_charger.c
+++ b/drivers/power/supply/bq256xx_charger.c
@@ -1562,21 +1562,11 @@ static int bq256xx_hw_init(struct bq256xx_device *bq)
 	if (ret)
 		return ret;
 
-	ret = bq->chip_info->bq256xx_set_ichg(bq,
-				bat_info->constant_charge_current_max_ua);
-	if (ret)
-		return ret;
-
 	ret = bq->chip_info->bq256xx_set_iprechg(bq,
 				bat_info->precharge_current_ua);
 	if (ret)
 		return ret;
 
-	ret = bq->chip_info->bq256xx_set_vbatreg(bq,
-				bat_info->constant_charge_voltage_max_uv);
-	if (ret)
-		return ret;
-
 	ret = bq->chip_info->bq256xx_set_iterm(bq,
 				bat_info->charge_term_current_ua);
 	if (ret)
-- 
2.30.2


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

end of thread, other threads:[~2022-12-07  2:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-29  9:01 [PATCH] power: supply: bq256xx: Remove init ichg/vbat with max value Hermes Zhang
2022-11-29 15:27 ` Sebastian Reichel
2022-11-30  9:27   ` Hermes Zhang
2022-12-03  1:03     ` Sebastian Reichel
     [not found]       ` <cf37715e-8bff-b38c-cee9-fdcc3b1d3a6b@axis.com>
2022-12-05 21:21         ` Sebastian Reichel
2022-12-07  2:53           ` Hermes Zhang

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