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

Commit f10a5a3d authored by Siddartha Mohanadoss's avatar Siddartha Mohanadoss
Browse files

thermal: tsens2xxx: Update trip activation



Currently when either INT_MAX or INT_MIN are
sent by thermal core for the set_trip API the
thresholds are not programmed. Update to also
disable monitoring the corresponding trip.

Change-Id: I5732caa9ea43a68c1b5922d8bbf5f409915245d9
Signed-off-by: default avatarSiddartha Mohanadoss <smohanad@codeaurora.org>
parent 727178db
Loading
Loading
Loading
Loading
+18 −2
Original line number Diff line number Diff line
@@ -257,7 +257,15 @@ static int tsens2xxx_set_trip_temp(struct tsens_sensor *tm_sensor,
				THERMAL_TRIP_CONFIGURABLE_HI,
				THERMAL_TRIP_ACTIVATION_ENABLED);
		if (rc) {
			pr_err("Error during trip high activation :%d\n", rc);
			pr_err("trip high enable error :%d\n", rc);
			goto fail;
		}
	} else {
		rc = tsens_tm_activate_trip_type(tm_sensor,
				THERMAL_TRIP_CONFIGURABLE_HI,
				THERMAL_TRIP_ACTIVATION_DISABLED);
		if (rc) {
			pr_err("trip high disable error :%d\n", rc);
			goto fail;
		}
	}
@@ -267,7 +275,15 @@ static int tsens2xxx_set_trip_temp(struct tsens_sensor *tm_sensor,
				THERMAL_TRIP_CONFIGURABLE_LOW,
				THERMAL_TRIP_ACTIVATION_ENABLED);
		if (rc) {
			pr_err("Error during trip low activation :%d\n", rc);
			pr_err("trip low enable activation error :%d\n", rc);
			goto fail;
		}
	} else {
		rc = tsens_tm_activate_trip_type(tm_sensor,
				THERMAL_TRIP_CONFIGURABLE_LOW,
				THERMAL_TRIP_ACTIVATION_DISABLED);
		if (rc) {
			pr_err("trip low disable error :%d\n", rc);
			goto fail;
		}
	}