blob: a9e960aaf98734839ca0a8dde06d1165e18a5410 [file] [log] [blame]
Donggeun Kim9d97e5c2011-09-07 18:49:08 +09001/*
Amit Daniel Kachhapf22d9c02012-08-16 17:11:42 +05302 * exynos_thermal.h - Samsung EXYNOS TMU (Thermal Management Unit)
Donggeun Kim9d97e5c2011-09-07 18:49:08 +09003 *
4 * Copyright (C) 2011 Samsung Electronics
5 * Donggeun Kim <dg77.kim@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
Amit Daniel Kachhapc48cbba2012-08-16 17:11:41 +053022#ifndef _LINUX_EXYNOS_THERMAL_H
23#define _LINUX_EXYNOS_THERMAL_H
Donggeun Kim9d97e5c2011-09-07 18:49:08 +090024
25enum calibration_type {
26 TYPE_ONE_POINT_TRIMMING,
27 TYPE_TWO_POINT_TRIMMING,
28 TYPE_NONE,
29};
30
Amit Daniel Kachhapf22d9c02012-08-16 17:11:42 +053031enum soc_type {
32 SOC_ARCH_EXYNOS4210 = 1,
33 SOC_ARCH_EXYNOS,
34};
Donggeun Kim9d97e5c2011-09-07 18:49:08 +090035/**
Amit Daniel Kachhapf22d9c02012-08-16 17:11:42 +053036 * struct exynos_tmu_platform_data
Donggeun Kim9d97e5c2011-09-07 18:49:08 +090037 * @threshold: basic temperature for generating interrupt
38 * 25 <= threshold <= 125 [unit: degree Celsius]
39 * @trigger_levels: array for each interrupt levels
40 * [unit: degree Celsius]
41 * 0: temperature for trigger_level0 interrupt
42 * condition for trigger_level0 interrupt:
43 * current temperature > threshold + trigger_levels[0]
44 * 1: temperature for trigger_level1 interrupt
45 * condition for trigger_level1 interrupt:
46 * current temperature > threshold + trigger_levels[1]
47 * 2: temperature for trigger_level2 interrupt
48 * condition for trigger_level2 interrupt:
49 * current temperature > threshold + trigger_levels[2]
50 * 3: temperature for trigger_level3 interrupt
51 * condition for trigger_level3 interrupt:
52 * current temperature > threshold + trigger_levels[3]
53 * @trigger_level0_en:
54 * 1 = enable trigger_level0 interrupt,
55 * 0 = disable trigger_level0 interrupt
56 * @trigger_level1_en:
57 * 1 = enable trigger_level1 interrupt,
58 * 0 = disable trigger_level1 interrupt
59 * @trigger_level2_en:
60 * 1 = enable trigger_level2 interrupt,
61 * 0 = disable trigger_level2 interrupt
62 * @trigger_level3_en:
63 * 1 = enable trigger_level3 interrupt,
64 * 0 = disable trigger_level3 interrupt
65 * @gain: gain of amplifier in the positive-TC generator block
66 * 0 <= gain <= 15
67 * @reference_voltage: reference voltage of amplifier
68 * in the positive-TC generator block
69 * 0 <= reference_voltage <= 31
Amit Daniel Kachhapf22d9c02012-08-16 17:11:42 +053070 * @noise_cancel_mode: noise cancellation mode
71 * 000, 100, 101, 110 and 111 can be different modes
72 * @type: determines the type of SOC
73 * @efuse_value: platform defined fuse value
Donggeun Kim9d97e5c2011-09-07 18:49:08 +090074 * @cal_type: calibration type for temperature
75 *
Amit Daniel Kachhapf22d9c02012-08-16 17:11:42 +053076 * This structure is required for configuration of exynos_tmu driver.
Donggeun Kim9d97e5c2011-09-07 18:49:08 +090077 */
Amit Daniel Kachhapf22d9c02012-08-16 17:11:42 +053078struct exynos_tmu_platform_data {
Donggeun Kim9d97e5c2011-09-07 18:49:08 +090079 u8 threshold;
80 u8 trigger_levels[4];
81 bool trigger_level0_en;
82 bool trigger_level1_en;
83 bool trigger_level2_en;
84 bool trigger_level3_en;
85
86 u8 gain;
87 u8 reference_voltage;
Amit Daniel Kachhapf22d9c02012-08-16 17:11:42 +053088 u8 noise_cancel_mode;
89 u32 efuse_value;
Donggeun Kim9d97e5c2011-09-07 18:49:08 +090090
91 enum calibration_type cal_type;
Amit Daniel Kachhapf22d9c02012-08-16 17:11:42 +053092 enum soc_type type;
Donggeun Kim9d97e5c2011-09-07 18:49:08 +090093};
Amit Daniel Kachhapc48cbba2012-08-16 17:11:41 +053094#endif /* _LINUX_EXYNOS_THERMAL_H */