Skip to content

Commit

Permalink
charger: bq25180: reuse bq25180_set_charge_current for the initial set
Browse files Browse the repository at this point in the history
Reuse bq25180_set_charge_current for the initial setting of the charging
current.

Signed-off-by: Fabio Baltieri <[email protected]>
  • Loading branch information
fabiobaltieri authored and MaureenHelm committed Jan 31, 2024
1 parent 13a357b commit 63cdde1
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/charger/charger_bq25180.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,7 @@ static int bq25180_init(const struct device *dev)
}

if (cfg->initial_current_microamp > 0) {
ret = bq25180_ma_to_ichg(cfg->initial_current_microamp / 1000, &val);
if (ret < 0) {
return ret;
}

ret = i2c_reg_update_byte_dt(&cfg->i2c, BQ25180_ICHG_CTRL,
BQ25180_ICHG_MSK, val);
bq25180_set_charge_current(dev, cfg->initial_current_microamp);
if (ret < 0) {
return ret;
}
Expand Down

0 comments on commit 63cdde1

Please sign in to comment.