aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/samsung/exynos_thermal_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/samsung/exynos_thermal_common.h')
-rw-r--r--drivers/thermal/samsung/exynos_thermal_common.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/drivers/thermal/samsung/exynos_thermal_common.h b/drivers/thermal/samsung/exynos_thermal_common.h
new file mode 100644
index 000000000000..8df18486078c
--- /dev/null
+++ b/drivers/thermal/samsung/exynos_thermal_common.h
@@ -0,0 +1,83 @@
1/*
2 * exynos_thermal_common.h - Samsung EXYNOS common header file
3 *
4 * Copyright (C) 2013 Samsung Electronics
5 * Amit Daniel Kachhap <amit.daniel@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */
22
23#ifndef _EXYNOS_THERMAL_COMMON_H
24#define _EXYNOS_THERMAL_COMMON_H
25
26/* In-kernel thermal framework related macros & definations */
27#define SENSOR_NAME_LEN 16
28#define MAX_TRIP_COUNT 8
29#define MAX_COOLING_DEVICE 4
30#define MAX_THRESHOLD_LEVS 4
31
32#define ACTIVE_INTERVAL 500
33#define IDLE_INTERVAL 10000
34#define MCELSIUS 1000
35
36/* CPU Zone information */
37#define PANIC_ZONE 4
38#define WARN_ZONE 3
39#define MONITOR_ZONE 2
40#define SAFE_ZONE 1
41
42#define GET_ZONE(trip) (trip + 2)
43#define GET_TRIP(zone) (zone - 2)
44
45#define EXYNOS_ZONE_COUNT 3
46
47struct thermal_trip_point_conf {
48 int trip_val[MAX_TRIP_COUNT];
49 int trip_count;
50 unsigned char trigger_falling;
51};
52
53struct thermal_cooling_conf {
54 struct freq_clip_table freq_data[MAX_TRIP_COUNT];
55 int freq_clip_count;
56};
57
58struct thermal_sensor_conf {
59 char name[SENSOR_NAME_LEN];
60 int (*read_temperature)(void *data);
61 int (*write_emul_temp)(void *drv_data, unsigned long temp);
62 struct thermal_trip_point_conf trip_data;
63 struct thermal_cooling_conf cooling_data;
64 void *private_data;
65};
66
67/*Functions used exynos based thermal sensor driver*/
68#ifdef CONFIG_EXYNOS_THERMAL_CORE
69void exynos_unregister_thermal(void);
70int exynos_register_thermal(struct thermal_sensor_conf *sensor_conf);
71void exynos_report_trigger(void);
72#else
73static inline void
74exynos_unregister_thermal(void) { return; }
75
76static inline int
77exynos_register_thermal(struct thermal_sensor_conf *sensor_conf) { return 0; }
78
79static inline void
80exynos_report_trigger(void) { return; }
81
82#endif /* CONFIG_EXYNOS_THERMAL_CORE */
83#endif /* _EXYNOS_THERMAL_COMMON_H */