summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHyungwoo Yang <hyungwooy@nvidia.com>2013-01-02 19:51:53 -0500
committerNicolin Chen <nicolinc@nvidia.com>2017-08-14 21:38:52 -0400
commite7ebdf7eee0366c986bb4264ce03daf2cf7d15a3 (patch)
tree2ffcf12477aca07732bba8cfe40a8c8fb3c9ca6d
parentddac309b0749be578488f33d070f42e6a37dfabc (diff)
drivers: misc: therm_est: enable run-time trip point change
Enabled trip point change through sysFs during run-time. Change-Id: Ibbdd8759cf24033575eda1d5f49b4d736060dab5 Signed-off-by: Hyungwoo Yang <hyungwooy@nvidia.com> Reviewed-on: http://git-master/r/188136
-rw-r--r--drivers/misc/therm_est.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/misc/therm_est.c b/drivers/misc/therm_est.c
index 654b0f675..553764d66 100644
--- a/drivers/misc/therm_est.c
+++ b/drivers/misc/therm_est.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * drivers/misc/therm_est.c 2 * drivers/misc/therm_est.c
3 * 3 *
4 * Copyright (C) 2010-2012 NVIDIA Corporation. 4 * Copyright (C) 2010-2013 NVIDIA Corporation.
5 * 5 *
6 * This software is licensed under the terms of the GNU General Public 6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and 7 * License version 2, as published by the Free Software Foundation, and
@@ -129,6 +129,17 @@ static int therm_est_get_trip_temp(struct thermal_zone_device *thz,
129 return 0; 129 return 0;
130} 130}
131 131
132static int therm_est_set_trip_temp(struct thermal_zone_device *thz,
133 int trip,
134 unsigned long temp)
135{
136 struct therm_estimator *est = thz->devdata;
137
138 est->trip_temp = temp;
139
140 return 0;
141}
142
132static int therm_est_get_temp(struct thermal_zone_device *thz, 143static int therm_est_get_temp(struct thermal_zone_device *thz,
133 unsigned long *temp) 144 unsigned long *temp)
134{ 145{
@@ -142,6 +153,7 @@ static struct thermal_zone_device_ops therm_est_ops = {
142 .unbind = therm_est_unbind, 153 .unbind = therm_est_unbind,
143 .get_trip_type = therm_est_get_trip_type, 154 .get_trip_type = therm_est_get_trip_type,
144 .get_trip_temp = therm_est_get_trip_temp, 155 .get_trip_temp = therm_est_get_trip_temp,
156 .set_trip_temp = therm_est_set_trip_temp,
145 .get_temp = therm_est_get_temp, 157 .get_temp = therm_est_get_temp,
146}; 158};
147 159