Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / drivers / thermal / ti-soc-thermal / ti-thermal.h
blob8e85ca973967d9525f41b0747ebd0f4725d1b4dc
1 /*
2 * OMAP thermal definitions
4 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
5 * Contact:
6 * Eduardo Valentin <eduardo.valentin@ti.com>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
23 #ifndef __TI_THERMAL_H
24 #define __TI_THERMAL_H
26 #include "ti-bandgap.h"
28 /* PCB sensor calculation constants */
29 #define OMAP_GRADIENT_SLOPE_W_PCB_4430 0
30 #define OMAP_GRADIENT_CONST_W_PCB_4430 20000
31 #define OMAP_GRADIENT_SLOPE_W_PCB_4460 1142
32 #define OMAP_GRADIENT_CONST_W_PCB_4460 -393
33 #define OMAP_GRADIENT_SLOPE_W_PCB_4470 1063
34 #define OMAP_GRADIENT_CONST_W_PCB_4470 -477
36 #define OMAP_GRADIENT_SLOPE_W_PCB_5430_CPU 100
37 #define OMAP_GRADIENT_CONST_W_PCB_5430_CPU 484
38 #define OMAP_GRADIENT_SLOPE_W_PCB_5430_GPU 464
39 #define OMAP_GRADIENT_CONST_W_PCB_5430_GPU -5102
41 #define DRA752_GRADIENT_SLOPE_W_PCB 0
42 #define DRA752_GRADIENT_CONST_W_PCB 2000
44 /* trip points of interest in milicelsius (at hotspot level) */
45 #define OMAP_TRIP_COLD 100000
46 #define OMAP_TRIP_HOT 110000
47 #define OMAP_TRIP_SHUTDOWN 125000
48 #define OMAP_TRIP_NUMBER 2
49 #define OMAP_TRIP_STEP \
50 ((OMAP_TRIP_SHUTDOWN - OMAP_TRIP_HOT) / (OMAP_TRIP_NUMBER - 1))
52 /* Update rates */
53 #define FAST_TEMP_MONITORING_RATE 250
55 /* helper macros */
56 /**
57 * ti_thermal_get_trip_value - returns trip temperature based on index
58 * @i: trip index
60 #define ti_thermal_get_trip_value(i) \
61 (OMAP_TRIP_HOT + ((i) * OMAP_TRIP_STEP))
63 /**
64 * ti_thermal_is_valid_trip - check for trip index
65 * @i: trip index
67 #define ti_thermal_is_valid_trip(trip) \
68 ((trip) >= 0 && (trip) < OMAP_TRIP_NUMBER)
70 #ifdef CONFIG_TI_THERMAL
71 int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id, char *domain);
72 int ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id);
73 int ti_thermal_report_sensor_temperature(struct ti_bandgap *bgp, int id);
74 int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id);
75 int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id);
76 #else
77 static inline
78 int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id, char *domain)
80 return 0;
83 static inline
84 int ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id)
86 return 0;
89 static inline
90 int ti_thermal_report_sensor_temperature(struct ti_bandgap *bgp, int id)
92 return 0;
95 static inline
96 int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id)
98 return 0;
101 static inline
102 int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id)
104 return 0;
106 #endif
107 #endif