1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#ifndef __TI_THERMAL_H
24#define __TI_THERMAL_H
25
26#include "ti-bandgap.h"
27
28
29#define OMAP_GRADIENT_SLOPE_4430 0
30#define OMAP_GRADIENT_CONST_4430 20000
31#define OMAP_GRADIENT_SLOPE_4460 348
32#define OMAP_GRADIENT_CONST_4460 -9301
33#define OMAP_GRADIENT_SLOPE_4470 308
34#define OMAP_GRADIENT_CONST_4470 -7896
35
36#define OMAP_GRADIENT_SLOPE_5430_CPU 65
37#define OMAP_GRADIENT_CONST_5430_CPU -1791
38#define OMAP_GRADIENT_SLOPE_5430_GPU 117
39#define OMAP_GRADIENT_CONST_5430_GPU -2992
40
41#define DRA752_GRADIENT_SLOPE 0
42#define DRA752_GRADIENT_CONST 2000
43
44
45#define OMAP_GRADIENT_SLOPE_W_PCB_4430 0
46#define OMAP_GRADIENT_CONST_W_PCB_4430 20000
47#define OMAP_GRADIENT_SLOPE_W_PCB_4460 1142
48#define OMAP_GRADIENT_CONST_W_PCB_4460 -393
49#define OMAP_GRADIENT_SLOPE_W_PCB_4470 1063
50#define OMAP_GRADIENT_CONST_W_PCB_4470 -477
51
52#define OMAP_GRADIENT_SLOPE_W_PCB_5430_CPU 100
53#define OMAP_GRADIENT_CONST_W_PCB_5430_CPU 484
54#define OMAP_GRADIENT_SLOPE_W_PCB_5430_GPU 464
55#define OMAP_GRADIENT_CONST_W_PCB_5430_GPU -5102
56
57#define DRA752_GRADIENT_SLOPE_W_PCB 0
58#define DRA752_GRADIENT_CONST_W_PCB 2000
59
60
61#define OMAP_TRIP_COLD 100000
62#define OMAP_TRIP_HOT 110000
63#define OMAP_TRIP_SHUTDOWN 125000
64#define OMAP_TRIP_NUMBER 2
65#define OMAP_TRIP_STEP \
66 ((OMAP_TRIP_SHUTDOWN - OMAP_TRIP_HOT) / (OMAP_TRIP_NUMBER - 1))
67
68
69#define FAST_TEMP_MONITORING_RATE 250
70
71
72
73
74
75
76#define ti_thermal_get_trip_value(i) \
77 (OMAP_TRIP_HOT + ((i) * OMAP_TRIP_STEP))
78
79
80
81
82
83#define ti_thermal_is_valid_trip(trip) \
84 ((trip) >= 0 && (trip) < OMAP_TRIP_NUMBER)
85
86#ifdef CONFIG_TI_THERMAL
87int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id, char *domain);
88int ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id);
89int ti_thermal_report_sensor_temperature(struct ti_bandgap *bgp, int id);
90int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id);
91int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id);
92#else
93static inline
94int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id, char *domain)
95{
96 return 0;
97}
98
99static inline
100int ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id)
101{
102 return 0;
103}
104
105static inline
106int ti_thermal_report_sensor_temperature(struct ti_bandgap *bgp, int id)
107{
108 return 0;
109}
110
111static inline
112int ti_thermal_register_cpu_cooling(struct ti_bandgap *bgp, int id)
113{
114 return 0;
115}
116
117static inline
118int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id)
119{
120 return 0;
121}
122#endif
123#endif
124