Merge tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[sfrench/cifs-2.6.git] / Documentation / driver-api / thermal / exynos_thermal.rst
1 ========================
2 Kernel driver exynos_tmu
3 ========================
4
5 Supported chips:
6
7 * ARM SAMSUNG EXYNOS4, EXYNOS5 series of SoC
8
9   Datasheet: Not publicly available
10
11 Authors: Donggeun Kim <dg77.kim@samsung.com>
12 Authors: Amit Daniel <amit.daniel@samsung.com>
13
14 TMU controller Description:
15 ---------------------------
16
17 This driver allows to read temperature inside SAMSUNG EXYNOS4/5 series of SoC.
18
19 The chip only exposes the measured 8-bit temperature code value
20 through a register.
21 Temperature can be taken from the temperature code.
22 There are three equations converting from temperature to temperature code.
23
24 The three equations are:
25   1. Two point trimming::
26
27         Tc = (T - 25) * (TI2 - TI1) / (85 - 25) + TI1
28
29   2. One point trimming::
30
31         Tc = T + TI1 - 25
32
33   3. No trimming::
34
35         Tc = T + 50
36
37   Tc:
38        Temperature code, T: Temperature,
39   TI1:
40        Trimming info for 25 degree Celsius (stored at TRIMINFO register)
41        Temperature code measured at 25 degree Celsius which is unchanged
42   TI2:
43        Trimming info for 85 degree Celsius (stored at TRIMINFO register)
44        Temperature code measured at 85 degree Celsius which is unchanged
45
46 TMU(Thermal Management Unit) in EXYNOS4/5 generates interrupt
47 when temperature exceeds pre-defined levels.
48 The maximum number of configurable threshold is five.
49 The threshold levels are defined as follows::
50
51   Level_0: current temperature > trigger_level_0 + threshold
52   Level_1: current temperature > trigger_level_1 + threshold
53   Level_2: current temperature > trigger_level_2 + threshold
54   Level_3: current temperature > trigger_level_3 + threshold
55
56 The threshold and each trigger_level are set
57 through the corresponding registers.
58
59 When an interrupt occurs, this driver notify kernel thermal framework
60 with the function exynos_report_trigger.
61 Although an interrupt condition for level_0 can be set,
62 it can be used to synchronize the cooling action.
63
64 TMU driver description:
65 -----------------------
66
67 The exynos thermal driver is structured as::
68
69                                         Kernel Core thermal framework
70                                 (thermal_core.c, step_wise.c, cpu_cooling.c)
71                                                                 ^
72                                                                 |
73                                                                 |
74   TMU configuration data -----> TMU Driver  <----> Exynos Core thermal wrapper
75   (exynos_tmu_data.c)         (exynos_tmu.c)       (exynos_thermal_common.c)
76   (exynos_tmu_data.h)         (exynos_tmu.h)       (exynos_thermal_common.h)
77
78 a) TMU configuration data:
79                 This consist of TMU register offsets/bitfields
80                 described through structure exynos_tmu_registers. Also several
81                 other platform data (struct exynos_tmu_platform_data) members
82                 are used to configure the TMU.
83 b) TMU driver:
84                 This component initialises the TMU controller and sets different
85                 thresholds. It invokes core thermal implementation with the call
86                 exynos_report_trigger.
87 c) Exynos Core thermal wrapper:
88                 This provides 3 wrapper function to use the
89                 Kernel core thermal framework. They are exynos_unregister_thermal,
90                 exynos_register_thermal and exynos_report_trigger.