diff options
| author | navneet kumar <navneetk@nvidia.com> | 2014-10-30 15:02:03 -0400 |
|---|---|---|
| committer | Nicolin Chen <nicolinc@nvidia.com> | 2017-08-14 21:38:52 -0400 |
| commit | 303ebe41f25ac9f2e1aa1c5d1c6d0ac76d59adbd (patch) | |
| tree | d22e509f6c10f415e55ec2d785176feef4dd8ccd | |
| parent | 0713e44ee9db17cecc803666336705d6e0c1216b (diff) | |
thermal: tegra: therm_est: handle trip_update
Edit original commit to use 'thremal_zone_of_device_ops'.
Add trip_update notification callback and register the same
with the of-thermal
In the callback recalculate thermal threshold limits.
(cherry-picked from commit Ia7f3a85cab4cfb5dd5390dbcb783686ec3947262)
Signed-off-by: navneet kumar <navneetk@nvidia.com>
Reviewed-on: http://git-master/r/591811
Change-Id: Id64ee583d09340436e5049c17c4b2f8a091b3b96
Signed-off-by: Srikar Srimath Tirumala <srikars@nvidia.com>
| -rw-r--r-- | drivers/misc/therm_est.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/misc/therm_est.c b/drivers/misc/therm_est.c index 95c87d2e9..32ddd7fac 100644 --- a/drivers/misc/therm_est.c +++ b/drivers/misc/therm_est.c | |||
| @@ -182,6 +182,16 @@ static int therm_est_get_trend(void *of_data, long *trend) | |||
| 182 | return 0; | 182 | return 0; |
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | static int therm_est_trip_update(void *of_data, int trip) | ||
| 186 | { | ||
| 187 | struct therm_estimator *est = (struct therm_estimator *)of_data; | ||
| 188 | |||
| 189 | thermal_zone_device_update(est->thz); | ||
| 190 | therm_est_update_limits(est); | ||
| 191 | |||
| 192 | return 0; | ||
| 193 | } | ||
| 194 | |||
| 185 | static int therm_est_init_history(struct therm_estimator *est) | 195 | static int therm_est_init_history(struct therm_estimator *est) |
| 186 | { | 196 | { |
| 187 | int i, j; | 197 | int i, j; |
| @@ -577,6 +587,7 @@ static struct therm_est_data *therm_est_get_pdata(struct device *dev) | |||
| 577 | static struct thermal_zone_of_device_ops sops = { | 587 | static struct thermal_zone_of_device_ops sops = { |
| 578 | .get_temp = therm_est_get_temp, | 588 | .get_temp = therm_est_get_temp, |
| 579 | .get_trend = therm_est_get_trend, | 589 | .get_trend = therm_est_get_trend, |
| 590 | .trip_update = therm_est_trip_update, | ||
| 580 | }; | 591 | }; |
| 581 | 592 | ||
| 582 | static int therm_est_probe(struct platform_device *pdev) | 593 | static int therm_est_probe(struct platform_device *pdev) |
