]>
Commit | Line | Data |
---|---|---|
445eaf87 EV |
1 | /* |
2 | * OMAP thermal definitions | |
3 | * | |
4 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ | |
5 | * Contact: | |
6 | * Eduardo Valentin <eduardo.valentin@ti.com> | |
7 | * | |
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. | |
11 | * | |
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. | |
16 | * | |
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 | |
21 | * | |
22 | */ | |
097ca6a3 EV |
23 | #ifndef __TI_THERMAL_H |
24 | #define __TI_THERMAL_H | |
445eaf87 | 25 | |
7372add4 | 26 | #include "ti-bandgap.h" |
445eaf87 | 27 | |
445eaf87 | 28 | /* PCB sensor calculation constants */ |
b763fdae EV |
29 | #define OMAP_GRADIENT_SLOPE_W_PCB_4430 0 |
30 | #define OMAP_GRADIENT_CONST_W_PCB_4430 20000 | |
445eaf87 EV |
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 | |
35 | ||
21bf2202 EV |
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 | |
445eaf87 | 40 | |
8926fa4f EV |
41 | #define DRA752_GRADIENT_SLOPE_W_PCB 0 |
42 | #define DRA752_GRADIENT_CONST_W_PCB 2000 | |
43 | ||
445eaf87 EV |
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)) | |
51 | ||
52 | /* Update rates */ | |
53 | #define FAST_TEMP_MONITORING_RATE 250 | |
54 | ||
55 | /* helper macros */ | |
56 | /** | |
03e859d3 | 57 | * ti_thermal_get_trip_value - returns trip temperature based on index |
445eaf87 EV |
58 | * @i: trip index |
59 | */ | |
03e859d3 | 60 | #define ti_thermal_get_trip_value(i) \ |
445eaf87 EV |
61 | (OMAP_TRIP_HOT + ((i) * OMAP_TRIP_STEP)) |
62 | ||
63 | /** | |
03e859d3 | 64 | * ti_thermal_is_valid_trip - check for trip index |
445eaf87 EV |
65 | * @i: trip index |
66 | */ | |
03e859d3 | 67 | #define ti_thermal_is_valid_trip(trip) \ |
445eaf87 EV |
68 | ((trip) >= 0 && (trip) < OMAP_TRIP_NUMBER) |
69 | ||
097ca6a3 | 70 | #ifdef CONFIG_TI_THERMAL |
03e859d3 EV |
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); | |
8c99c166 | 73 | int ti_thermal_report_sensor_temperature(struct ti_bandgap *bgp, int id); |
03e859d3 EV |
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); | |
445eaf87 EV |
76 | #else |
77 | static inline | |
03e859d3 | 78 | int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id, char *domain) |
445eaf87 EV |
79 | { |
80 | return 0; | |
81 | } | |
82 | ||
83 | static inline | |
03e859d3 | 84 | int ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id) |
445eaf87 EV |
85 | { |
86 | return 0; | |
87 | } | |
88 | ||
8c99c166 EV |
89 | static inline |
90 | int ti_thermal_report_sensor_temperature(struct ti_bandgap *bgp, int id) | |
91 | { | |
92 | return 0; | |
93 | } | |
94 | ||
445eaf87 | 95 | static inline |
03e859d3 | 96 | int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id) |
445eaf87 EV |
97 | { |
98 | return 0; | |
99 | } | |
100 | ||
101 | static inline | |
03e859d3 | 102 | int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id) |
445eaf87 EV |
103 | { |
104 | return 0; | |
105 | } | |
106 | #endif | |
107 | #endif |