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

Commit 18ce7564 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drivers: thermal: notify at least one thermal zone if no trips are violated"

parents 3d81a8ff 9c1e47be
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -732,6 +732,7 @@ static void handle_thermal_trip(struct device *dev,
	struct __thermal_zone *data = tzd->devdata;
	int idx = 0;
	struct __sensor_param *sens_param = NULL;
	bool notify = false;

	idx = find_sensor_index(dev, data);
	if (idx < 0)
@@ -750,10 +751,19 @@ static void handle_thermal_trip(struct device *dev,
		} else {
			if (!of_thermal_is_trips_triggered(zone, trip_temp))
				continue;
			notify = true;
			thermal_zone_device_update_temp(zone,
				THERMAL_EVENT_UNSPECIFIED, trip_temp);
		}
	}

	/*
	 * It is better to notify at least one thermal zone if trip is violated
	 * for none.
	 */
	if (temp_valid && !notify)
		thermal_zone_device_update_temp(tzd, THERMAL_EVENT_UNSPECIFIED,
				trip_temp);
}

/*