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

Commit b81add24 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 0bcae799 3397343b
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -637,6 +637,7 @@ static void handle_thermal_trip(struct thermal_zone_device *tz,
	struct thermal_zone_device *zone;
	struct __thermal_zone *data = tz->devdata;
	struct list_head *head;
	bool notify = false;

	head = &data->senps->first_tz;
	list_for_each_entry(data, head, list) {
@@ -649,10 +650,19 @@ static void handle_thermal_trip(struct thermal_zone_device *tz,
		} 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(tz, THERMAL_EVENT_UNSPECIFIED,
				trip_temp);
}

/*