Commit 80211be1 authored by Yauhen Kharuzhy's avatar Yauhen Kharuzhy Committed by Sebastian Reichel

power: bq25890: Enable continuous conversion for ADC at charging

Instead of one shot run of ADC at beginning of charging, run continuous
conversion to ensure that all charging-related values are monitored
properly (input voltage, input current, themperature etc.).
Signed-off-by: default avatarYauhen Kharuzhy <jekhor@gmail.com>
Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 51c7b6a0
...@@ -581,12 +581,12 @@ static irqreturn_t __bq25890_handle_irq(struct bq25890_device *bq) ...@@ -581,12 +581,12 @@ static irqreturn_t __bq25890_handle_irq(struct bq25890_device *bq)
if (!new_state.online && bq->state.online) { /* power removed */ if (!new_state.online && bq->state.online) { /* power removed */
/* disable ADC */ /* disable ADC */
ret = bq25890_field_write(bq, F_CONV_START, 0); ret = bq25890_field_write(bq, F_CONV_RATE, 0);
if (ret < 0) if (ret < 0)
goto error; goto error;
} else if (new_state.online && !bq->state.online) { /* power inserted */ } else if (new_state.online && !bq->state.online) { /* power inserted */
/* enable ADC, to have control of charge current/voltage */ /* enable ADC, to have control of charge current/voltage */
ret = bq25890_field_write(bq, F_CONV_START, 1); ret = bq25890_field_write(bq, F_CONV_RATE, 1);
if (ret < 0) if (ret < 0)
goto error; goto error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment