Donggeun Kim | 9d97e5c | 2011-09-07 18:49:08 +0900 | [diff] [blame] | 1 | /* |
Amit Daniel Kachhap | f22d9c0 | 2012-08-16 17:11:42 +0530 | [diff] [blame] | 2 | * exynos_thermal.h - Samsung EXYNOS TMU (Thermal Management Unit) |
Donggeun Kim | 9d97e5c | 2011-09-07 18:49:08 +0900 | [diff] [blame] | 3 | * |
| 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 Kachhap | c48cbba | 2012-08-16 17:11:41 +0530 | [diff] [blame] | 22 | #ifndef _LINUX_EXYNOS_THERMAL_H |
| 23 | #define _LINUX_EXYNOS_THERMAL_H |
Amit Daniel Kachhap | 7e0b55e | 2012-08-16 17:11:43 +0530 | [diff] [blame] | 24 | #include <linux/cpu_cooling.h> |
Donggeun Kim | 9d97e5c | 2011-09-07 18:49:08 +0900 | [diff] [blame] | 25 | |
| 26 | enum calibration_type { |
| 27 | TYPE_ONE_POINT_TRIMMING, |
| 28 | TYPE_TWO_POINT_TRIMMING, |
| 29 | TYPE_NONE, |
| 30 | }; |
| 31 | |
Amit Daniel Kachhap | f22d9c0 | 2012-08-16 17:11:42 +0530 | [diff] [blame] | 32 | enum soc_type { |
| 33 | SOC_ARCH_EXYNOS4210 = 1, |
| 34 | SOC_ARCH_EXYNOS, |
| 35 | }; |
Donggeun Kim | 9d97e5c | 2011-09-07 18:49:08 +0900 | [diff] [blame] | 36 | /** |
Amit Daniel Kachhap | 7e0b55e | 2012-08-16 17:11:43 +0530 | [diff] [blame] | 37 | * struct freq_clip_table |
| 38 | * @freq_clip_max: maximum frequency allowed for this cooling state. |
| 39 | * @temp_level: Temperature level at which the temperature clipping will |
| 40 | * happen. |
| 41 | * @mask_val: cpumask of the allowed cpu's where the clipping will take place. |
| 42 | * |
| 43 | * This structure is required to be filled and passed to the |
| 44 | * cpufreq_cooling_unregister function. |
| 45 | */ |
| 46 | struct freq_clip_table { |
| 47 | unsigned int freq_clip_max; |
| 48 | unsigned int temp_level; |
| 49 | const struct cpumask *mask_val; |
| 50 | }; |
| 51 | |
| 52 | /** |
Amit Daniel Kachhap | f22d9c0 | 2012-08-16 17:11:42 +0530 | [diff] [blame] | 53 | * struct exynos_tmu_platform_data |
Donggeun Kim | 9d97e5c | 2011-09-07 18:49:08 +0900 | [diff] [blame] | 54 | * @threshold: basic temperature for generating interrupt |
| 55 | * 25 <= threshold <= 125 [unit: degree Celsius] |
| 56 | * @trigger_levels: array for each interrupt levels |
| 57 | * [unit: degree Celsius] |
| 58 | * 0: temperature for trigger_level0 interrupt |
| 59 | * condition for trigger_level0 interrupt: |
| 60 | * current temperature > threshold + trigger_levels[0] |
| 61 | * 1: temperature for trigger_level1 interrupt |
| 62 | * condition for trigger_level1 interrupt: |
| 63 | * current temperature > threshold + trigger_levels[1] |
| 64 | * 2: temperature for trigger_level2 interrupt |
| 65 | * condition for trigger_level2 interrupt: |
| 66 | * current temperature > threshold + trigger_levels[2] |
| 67 | * 3: temperature for trigger_level3 interrupt |
| 68 | * condition for trigger_level3 interrupt: |
| 69 | * current temperature > threshold + trigger_levels[3] |
| 70 | * @trigger_level0_en: |
| 71 | * 1 = enable trigger_level0 interrupt, |
| 72 | * 0 = disable trigger_level0 interrupt |
| 73 | * @trigger_level1_en: |
| 74 | * 1 = enable trigger_level1 interrupt, |
| 75 | * 0 = disable trigger_level1 interrupt |
| 76 | * @trigger_level2_en: |
| 77 | * 1 = enable trigger_level2 interrupt, |
| 78 | * 0 = disable trigger_level2 interrupt |
| 79 | * @trigger_level3_en: |
| 80 | * 1 = enable trigger_level3 interrupt, |
| 81 | * 0 = disable trigger_level3 interrupt |
| 82 | * @gain: gain of amplifier in the positive-TC generator block |
| 83 | * 0 <= gain <= 15 |
| 84 | * @reference_voltage: reference voltage of amplifier |
| 85 | * in the positive-TC generator block |
| 86 | * 0 <= reference_voltage <= 31 |
Amit Daniel Kachhap | f22d9c0 | 2012-08-16 17:11:42 +0530 | [diff] [blame] | 87 | * @noise_cancel_mode: noise cancellation mode |
| 88 | * 000, 100, 101, 110 and 111 can be different modes |
| 89 | * @type: determines the type of SOC |
| 90 | * @efuse_value: platform defined fuse value |
Donggeun Kim | 9d97e5c | 2011-09-07 18:49:08 +0900 | [diff] [blame] | 91 | * @cal_type: calibration type for temperature |
Amit Daniel Kachhap | 7e0b55e | 2012-08-16 17:11:43 +0530 | [diff] [blame] | 92 | * @freq_clip_table: Table representing frequency reduction percentage. |
| 93 | * @freq_tab_count: Count of the above table as frequency reduction may |
| 94 | * applicable to only some of the trigger levels. |
Donggeun Kim | 9d97e5c | 2011-09-07 18:49:08 +0900 | [diff] [blame] | 95 | * |
Amit Daniel Kachhap | f22d9c0 | 2012-08-16 17:11:42 +0530 | [diff] [blame] | 96 | * This structure is required for configuration of exynos_tmu driver. |
Donggeun Kim | 9d97e5c | 2011-09-07 18:49:08 +0900 | [diff] [blame] | 97 | */ |
Amit Daniel Kachhap | f22d9c0 | 2012-08-16 17:11:42 +0530 | [diff] [blame] | 98 | struct exynos_tmu_platform_data { |
Donggeun Kim | 9d97e5c | 2011-09-07 18:49:08 +0900 | [diff] [blame] | 99 | u8 threshold; |
| 100 | u8 trigger_levels[4]; |
| 101 | bool trigger_level0_en; |
| 102 | bool trigger_level1_en; |
| 103 | bool trigger_level2_en; |
| 104 | bool trigger_level3_en; |
| 105 | |
| 106 | u8 gain; |
| 107 | u8 reference_voltage; |
Amit Daniel Kachhap | f22d9c0 | 2012-08-16 17:11:42 +0530 | [diff] [blame] | 108 | u8 noise_cancel_mode; |
| 109 | u32 efuse_value; |
Donggeun Kim | 9d97e5c | 2011-09-07 18:49:08 +0900 | [diff] [blame] | 110 | |
| 111 | enum calibration_type cal_type; |
Amit Daniel Kachhap | f22d9c0 | 2012-08-16 17:11:42 +0530 | [diff] [blame] | 112 | enum soc_type type; |
Amit Daniel Kachhap | 7e0b55e | 2012-08-16 17:11:43 +0530 | [diff] [blame] | 113 | struct freq_clip_table freq_tab[4]; |
| 114 | unsigned int freq_tab_count; |
Donggeun Kim | 9d97e5c | 2011-09-07 18:49:08 +0900 | [diff] [blame] | 115 | }; |
Amit Daniel Kachhap | c48cbba | 2012-08-16 17:11:41 +0530 | [diff] [blame] | 116 | #endif /* _LINUX_EXYNOS_THERMAL_H */ |