mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 07:13:34 +00:00
power: bq25890: Enable continuous conversion for ADC at charging
[ Upstream commit 80211be1b9
]
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: Yauhen Kharuzhy <jekhor@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
00d65478a0
commit
a5eae259db
1 changed files with 2 additions and 2 deletions
|
@ -521,12 +521,12 @@ static void bq25890_handle_state_change(struct bq25890_device *bq,
|
|||
|
||||
if (!new_state->online) { /* power removed */
|
||||
/* disable ADC */
|
||||
ret = bq25890_field_write(bq, F_CONV_START, 0);
|
||||
ret = bq25890_field_write(bq, F_CONV_RATE, 0);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
} else if (!old_state.online) { /* power inserted */
|
||||
/* 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)
|
||||
goto error;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue