thermal: soctherm: use thermal_trip_info struct in soctherm driver
[linux-2.6.git] / arch / arm / mach-tegra / tegra11_soctherm.h
1 /*
2  * arch/arm/mach-tegra/tegra11_soctherm.h
3  *
4  * Copyright (C) 2011-2013 NVIDIA Corporation
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18  *
19  */
20
21 #ifndef __MACH_TEGRA_11x_SOCTHERM_H
22 #define __MACH_TEGRA_11x_SOCTHERM_H
23
24 enum soctherm_sense {
25         TSENSE_CPU0 = 0,
26         TSENSE_CPU1,
27         TSENSE_CPU2,
28         TSENSE_CPU3,
29         TSENSE_MEM0,
30         TSENSE_MEM1,
31         TSENSE_GPU,
32         TSENSE_PLLX,
33         TSENSE_SIZE,
34 };
35
36 enum soctherm_therm_id {
37         THERM_CPU = 0,
38         THERM_MEM,
39         THERM_GPU,
40         THERM_PLL,
41         THERM_SIZE,
42 };
43
44 struct soctherm_sensor {
45         bool sensor_enable;
46         bool zone_enable;
47         int tall;
48         int tiddq;
49         int ten_count;
50         int tsample;
51         u8 pdiv;
52 };
53
54 struct soctherm_therm {
55         bool zone_enable;
56         s8 thermtrip;
57         s8 hw_backstop;
58         int passive_delay;
59         int etemp;
60         int num_trips;
61         struct thermal_trip_info trips[THERMAL_MAX_TRIPS];
62 };
63
64 enum soctherm_throttle_id {
65         THROTTLE_LITE = 0,
66         THROTTLE_HEAVY,
67         THROTTLE_SIZE,
68 };
69
70 enum soctherm_throttle_dev_id {
71         THROTTLE_DEV_CPU = 0,
72         THROTTLE_DEV_GPU,
73         THROTTLE_DEV_SIZE,
74 };
75
76 struct soctherm_throttle_dev {
77         bool enable;
78         u8 dividend;
79         u8 divisor;
80         u16 duration;
81         u8 step;
82 };
83
84 struct soctherm_throttle {
85         u8 priority;
86         struct soctherm_throttle_dev devs[THROTTLE_DEV_SIZE];
87 };
88
89 struct soctherm_platform_data {
90         unsigned long soctherm_clk_rate;
91         unsigned long tsensor_clk_rate;
92
93         struct soctherm_sensor sensor_data[TSENSE_SIZE];
94         struct soctherm_therm therm[THERM_SIZE];
95         struct soctherm_throttle throttle[THROTTLE_SIZE];
96
97         int edp_weights[12];
98         int edp_threshold;
99 };
100
101 #ifdef CONFIG_TEGRA_SOCTHERM
102 int __init tegra11_soctherm_init(struct soctherm_platform_data *data);
103 #else
104 static inline int tegra11_soctherm_init(struct soctherm_platform_data *data)
105 {
106         return 0;
107 }
108 #endif
109
110 #endif /* __MACH_TEGRA_11x_SOCTHERM_H */