summaryrefslogtreecommitdiff
path: root/drivers/misc/nct1008.c
diff options
context:
space:
mode:
authorAmit Kamath <akamath@nvidia.com>2012-11-30 14:09:02 +0530
committerSimone Willett <swillett@nvidia.com>2013-01-02 17:53:27 -0800
commit80d74d93b289de458c338f990a6b8b1d0fb3f903 (patch)
tree5c34656c492258652ca82eb083e40664e7b789b5 /drivers/misc/nct1008.c
parenta4f05627fe5734d2b4fe3adf01d3a2ea89a6ec69 (diff)
drivers: misc: nct: add userspace event
Use thermal interface to notify of thermal changes for all thermal trip points using netlink sockets. bug 1042409 Change-Id: Ia8ec1891f74aacbd4eb2692dee89c5b4457a5cf8 Signed-off-by: Amit Kamath <akamath@nvidia.com> Reviewed-on: http://git-master/r/170984 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'drivers/misc/nct1008.c')
-rw-r--r--drivers/misc/nct1008.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/misc/nct1008.c b/drivers/misc/nct1008.c
index a983be187484..5e067c75b206 100644
--- a/drivers/misc/nct1008.c
+++ b/drivers/misc/nct1008.c
@@ -445,6 +445,7 @@ static void nct1008_update(struct nct1008_data *data)
struct thermal_zone_device *thz = data->nct_ext;
long temp, trip_temp, low_temp = 0, high_temp = NCT1008_MAX_TEMP * 1000;
int count;
+ enum events type = 0;
if (!thz)
return;
@@ -457,15 +458,19 @@ static void nct1008_update(struct nct1008_data *data)
for (count = 0; count < thz->trips; count++) {
thz->ops->get_trip_temp(thz, count, &trip_temp);
- if ((trip_temp >= temp) && (trip_temp < high_temp))
+ if ((trip_temp >= temp) && (trip_temp < high_temp)) {
high_temp = trip_temp;
+ type = THERMAL_AUX1;
+ }
if ((trip_temp < temp) && (trip_temp > low_temp)) {
low_temp = trip_temp -
data->plat_data.trips[count].hysteresis;
+ type = THERMAL_AUX0;
}
}
+ thermal_generate_netlink_event(thz->id, type);
nct1008_thermal_set_limits(data, low_temp, high_temp);
}