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 v2] power: supply: bq256xx: Init ichg/vbat value with chip default value
Date: Tue, 10 Jan 2023 10:47:46 +0800 [thread overview]
Message-ID: <20230110024746.2701738-1-chenhuiz@axis.com> (raw)
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
next reply other threads:[~2023-01-10 2:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-10 2:47 Hermes Zhang [this message]
2023-02-03 12:33 ` Sebastian Reichel
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=20230110024746.2701738-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
all inboxes | Powered by JetHome®