2 * include/linux/therm_est.h
4 * Copyright (c) 2010-2012, NVIDIA Corporation.
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
8 * may be copied, distributed, and modified under those terms.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
17 #ifndef _LINUX_THERM_EST_H
18 #define _LINUX_THERM_EST_H
20 #include <linux/workqueue.h>
24 struct therm_est_subdevice {
26 int (*get_temp)(void *, long *);
27 long coeffs[HIST_LEN];
31 struct therm_estimator {
32 long therm_est_lo_limit;
33 long therm_est_hi_limit;
34 void (*callback)(void *);
38 struct workqueue_struct *workqueue;
39 struct delayed_work therm_est_work;
43 struct therm_est_subdevice **devs;
46 #ifdef CONFIG_THERM_EST
47 struct therm_estimator *therm_est_register(
48 struct therm_est_subdevice **devs,
52 int therm_est_get_temp(struct therm_estimator *est, long *temp);
53 int therm_est_set_limits(struct therm_estimator *est,
56 int therm_est_set_alert(struct therm_estimator *est,
60 static inline struct therm_estimator *therm_est_register(
61 struct therm_est_subdevice **devs,
66 static inline int therm_est_get_temp(struct therm_estimator *est, long *temp)
68 static inline int therm_est_set_limits(struct therm_estimator *est,
72 static inline int therm_est_set_alert(struct therm_estimator *est,
77 #endif /* _LINUX_THERM_EST_H */