From: Hermes Zhang <chenhuiz@axis.com>
To: Sebastian Reichel <sre@kernel.org>
Cc: <kernel@axis.com>, Hermes Zhang <chenhuiz@axis.com>,
<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] power: supply: bq256xx: Remove init ichg/vbat with max value
Date: Tue, 29 Nov 2022 17:01:12 +0800 [thread overview]
Message-ID: <20221129090112.3451501-1-chenhuiz@axis.com> (raw)
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
next reply other threads:[~2022-11-29 9:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-29 9:01 Hermes Zhang [this message]
2022-11-29 15:27 ` [PATCH] power: supply: bq256xx: Remove init ichg/vbat with max value 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221129090112.3451501-1-chenhuiz@axis.com \
--to=chenhuiz@axis.com \
--cc=kernel@axis.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox