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

Commit 2dfc4214 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 3760c869 748067ae
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -655,6 +655,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) {
@@ -667,10 +668,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);
}

/*