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

Commit 94c6e235 authored by Ram Chandrasekar's avatar Ram Chandrasekar Committed by Gerrit - the friendly Code Review server
Browse files

thermal_core: Add sysfs notification support for userspace



Add support to notify the userspace through sysfs
notification when a userspace threshold is crossed.

Change-Id: Ifdea7f15f288d1dca5365aedad16d1bdbc80be6c
Signed-off-by: default avatarRam Chandrasekar <rkumbako@codeaurora.org>
parent 27bcfc79
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@

#include "thermal_core.h"

#define THERMAL_UEVENT_DATA "type"

MODULE_AUTHOR("Zhang Rui");
MODULE_DESCRIPTION("Generic thermal management sysfs support");
MODULE_LICENSE("GPL v2");
@@ -315,6 +317,10 @@ int thermal_sensor_trip(struct thermal_zone_device *tz,
			((trip == THERMAL_TRIP_CONFIGURABLE_HI) &&
				(pos->temp >= tz->sensor.threshold_max) &&
				(pos->temp <= temp))) {
			if ((pos == &tz->tz_threshold[0])
				|| (pos == &tz->tz_threshold[1]))
				sysfs_notify(&tz->device.kobj, NULL,
					THERMAL_UEVENT_DATA);
			pos->active = 0;
			pos->notify(trip, temp, pos->data);
		}