summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorHermes Zhang <chenhuiz@axis.com>2023-01-10 03:47:46 +0100
committerSebastian Reichel <sebastian.reichel@collabora.com>2023-02-03 13:32:01 +0100
commit4651b6b72934e602202def29c88813d95716f7c7 (patch)
treecbe30a34ffab04b22d01b975f9bf5e3db39e30e1 /drivers/power
parentpower: supply: collie_battery: Convert to GPIO descriptors (part 2) (diff)
downloadlinux-4651b6b72934e602202def29c88813d95716f7c7.tar.xz
linux-4651b6b72934e602202def29c88813d95716f7c7.zip
power: supply: bq256xx: Init ichg/vbat value with chip default value
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> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/bq256xx_charger.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/power/supply/bq256xx_charger.c b/drivers/power/supply/bq256xx_charger.c
index db13e288e439..9cf4936440c9 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;