charger: bq25180: reuse bq25180_set_charge_current for the initial set
Reuse bq25180_set_charge_current for the initial setting of the charging current. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
parent
13a357b019
commit
63cdde10d3
|
@ -188,13 +188,7 @@ static int bq25180_init(const struct device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg->initial_current_microamp > 0) {
|
if (cfg->initial_current_microamp > 0) {
|
||||||
ret = bq25180_ma_to_ichg(cfg->initial_current_microamp / 1000, &val);
|
bq25180_set_charge_current(dev, cfg->initial_current_microamp);
|
||||||
if (ret < 0) {
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = i2c_reg_update_byte_dt(&cfg->i2c, BQ25180_ICHG_CTRL,
|
|
||||||
BQ25180_ICHG_MSK, val);
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue