mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-06 14:05:39 +00:00
power: supply: bq25890: Fix initial setting of the F_CONV_RATE field
The code doing the initial setting of the F_CONV_RATE field based on the bq->state.online flag. In order for this to work properly, this must be done after the initial bq25890_get_chip_state() call. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
d01363da53
commit
22ad4f99f6
@ -682,6 +682,12 @@ static int bq25890_hw_init(struct bq25890_device *bq)
|
||||
}
|
||||
}
|
||||
|
||||
ret = bq25890_get_chip_state(bq, &bq->state);
|
||||
if (ret < 0) {
|
||||
dev_dbg(bq->dev, "Get state failed %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Configure ADC for continuous conversions when charging */
|
||||
ret = bq25890_field_write(bq, F_CONV_RATE, !!bq->state.online);
|
||||
if (ret < 0) {
|
||||
@ -689,12 +695,6 @@ static int bq25890_hw_init(struct bq25890_device *bq)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = bq25890_get_chip_state(bq, &bq->state);
|
||||
if (ret < 0) {
|
||||
dev_dbg(bq->dev, "Get state failed %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user