Skip to content

Commit 22ad4f9

Browse files
jwrdegoedesre
authored andcommitted
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>
1 parent d01363d commit 22ad4f9

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/power/supply/bq25890_charger.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -682,16 +682,16 @@ static int bq25890_hw_init(struct bq25890_device *bq)
682682
}
683683
}
684684

685-
/* Configure ADC for continuous conversions when charging */
686-
ret = bq25890_field_write(bq, F_CONV_RATE, !!bq->state.online);
685+
ret = bq25890_get_chip_state(bq, &bq->state);
687686
if (ret < 0) {
688-
dev_dbg(bq->dev, "Config ADC failed %d\n", ret);
687+
dev_dbg(bq->dev, "Get state failed %d\n", ret);
689688
return ret;
690689
}
691690

692-
ret = bq25890_get_chip_state(bq, &bq->state);
691+
/* Configure ADC for continuous conversions when charging */
692+
ret = bq25890_field_write(bq, F_CONV_RATE, !!bq->state.online);
693693
if (ret < 0) {
694-
dev_dbg(bq->dev, "Get state failed %d\n", ret);
694+
dev_dbg(bq->dev, "Config ADC failed %d\n", ret);
695695
return ret;
696696
}
697697

0 commit comments

Comments
 (0)