Skip to content

Commit

Permalink
power: supply: bq256xx: Init ichg/vbat value with chip default value
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hermes Zhang authored and Sebastian Reichel committed Feb 3, 2023
1 parent fccd2b7 commit 4651b6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/power/supply/bq256xx_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down

0 comments on commit 4651b6b

Please sign in to comment.