xref: /linux/Documentation/driver-api/thermal/exynos_thermal_emulation.rst (revision 55a42f78ffd386e01a5404419f8c5ded7db70a21)
1=====================
2Exynos Emulation Mode
3=====================
4
5Copyright (C) 2012 Samsung Electronics
6
7Written by Jonghwa Lee <jonghwa3.lee@samsung.com>
8
9Description
10-----------
11
12Exynos 4x12 (4212, 4412) and 5 series provide emulation mode for thermal
13management unit. Thermal emulation mode supports software debug for
14TMU's operation. User can set temperature manually with software code
15and TMU will read current temperature from user value not from sensor's
16value.
17
18Enabling CONFIG_THERMAL_EMULATION option will make this support
19available. When it's enabled, sysfs node will be created as
20/sys/devices/virtual/thermal/thermal_zone'zone id'/emul_temp.
21
22The sysfs node, 'emul_node', will contain value 0 for the initial state.
23When you input any temperature you want to update to sysfs node, it
24automatically enable emulation mode and current temperature will be
25changed into it.
26
27(Exynos also supports user changeable delay time which would be used to
28delay of changing temperature. However, this node only uses same delay
29of real sensing time, 938us.)
30
31Exynos emulation mode requires that value changes and enabling are performed
32synchronously. This means that when you want to update any value, such as the
33delay or the next temperature, you must enable emulation mode at the same
34time (or keep the mode enabled). If you do not, the value will fail to update
35and the last successful value will continue to be used. For this reason,
36this node only allows users to change the temperature. Providing a single
37interface makes it simpler to use.
38
39Disabling emulation mode only requires writing value 0 to sysfs node.
40
41::
42
43
44  TEMP	120 |
45	    |
46	100 |
47	    |
48	 80 |
49	    |				 +-----------
50	 60 |      			 |	    |
51	    |		   +-------------|          |
52	 40 |              |         	 |          |
53	    |		   |		 |          |
54	 20 |		   |		 |          +----------
55	    |		   |		 |          |          |
56	  0 |______________|_____________|__________|__________|_________
57		   A		 A	    A		       A     TIME
58		   |<----->|	 |<----->|  |<----->|	       |
59		   | 938us |  	 |	 |  |       |          |
60  emulation   : 0  50	   |  	 70      |  20      |          0
61  current temp:   sensor   50		 70         20	      sensor
62