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

Commit f5d43b7a authored by Eduardo Valentin's avatar Eduardo Valentin Committed by Greg Kroah-Hartman
Browse files

staging: ti-soc-thermal: fix condition to apply hyst



While updating talert thresholds, threshold cold must
always be lower than threshold hot. This patch fixes
the function ti_bandgap_update_alert_threshold to only
change the thresholds by applying a hysteresis when
they violate this condition.

Signed-off-by: default avatarEduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 61603af3
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -406,7 +406,7 @@ static int ti_bandgap_update_alert_threshold(struct ti_bandgap *bgp, int id,
	else
	else
		t_cold = val;
		t_cold = val;


	if (t_cold < t_hot) {
	if (t_cold > t_hot) {
		if (hot)
		if (hot)
			err = ti_bandgap_add_hyst(bgp, t_hot,
			err = ti_bandgap_add_hyst(bgp, t_hot,
						  -ts_data->hyst_val,
						  -ts_data->hyst_val,