Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e2c8bd7 authored by Yauhen Kharuzhy's avatar Yauhen Kharuzhy Committed by Greg Kroah-Hartman
Browse files

power: bq25890: Enable continuous conversion for ADC at charging



[ Upstream commit 80211be1b9dec04cc2805d3d81e2091ecac289a1 ]

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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent f16a5bce
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -531,12 +531,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;
	}