2 * OMAP thermal definitions
4 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
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
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))
53 #define FAST_TEMP_MONITORING_RATE 250
57 * ti_thermal_get_trip_value - returns trip temperature based on index
60 #define ti_thermal_get_trip_value(i) \
61 (OMAP_TRIP_HOT + ((i) * OMAP_TRIP_STEP))
64 * ti_thermal_is_valid_trip - check for 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
);
78 int ti_thermal_expose_sensor(struct ti_bandgap
*bgp
, int id
, char *domain
)
84 int ti_thermal_remove_sensor(struct ti_bandgap
*bgp
, int id
)
90 int ti_thermal_report_sensor_temperature(struct ti_bandgap
*bgp
, int id
)
96 int ti_thermal_register_cpu_cooling(struct ti_bandgap
*bgp
, int id
)
102 int ti_thermal_unregister_cpu_cooling(struct ti_bandgap
*bgp
, int id
)