18c2ecf20Sopenharmony_ci===================== 28c2ecf20Sopenharmony_ciExynos Emulation Mode 38c2ecf20Sopenharmony_ci===================== 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ciCopyright (C) 2012 Samsung Electronics 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ciWritten by Jonghwa Lee <jonghwa3.lee@samsung.com> 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ciDescription 108c2ecf20Sopenharmony_ci----------- 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ciExynos 4x12 (4212, 4412) and 5 series provide emulation mode for thermal 138c2ecf20Sopenharmony_cimanagement unit. Thermal emulation mode supports software debug for 148c2ecf20Sopenharmony_ciTMU's operation. User can set temperature manually with software code 158c2ecf20Sopenharmony_ciand TMU will read current temperature from user value not from sensor's 168c2ecf20Sopenharmony_civalue. 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ciEnabling CONFIG_THERMAL_EMULATION option will make this support 198c2ecf20Sopenharmony_ciavailable. When it's enabled, sysfs node will be created as 208c2ecf20Sopenharmony_ci/sys/devices/virtual/thermal/thermal_zone'zone id'/emul_temp. 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ciThe sysfs node, 'emul_node', will contain value 0 for the initial state. 238c2ecf20Sopenharmony_ciWhen you input any temperature you want to update to sysfs node, it 248c2ecf20Sopenharmony_ciautomatically enable emulation mode and current temperature will be 258c2ecf20Sopenharmony_cichanged into it. 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci(Exynos also supports user changeable delay time which would be used to 288c2ecf20Sopenharmony_cidelay of changing temperature. However, this node only uses same delay 298c2ecf20Sopenharmony_ciof real sensing time, 938us.) 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ciExynos emulation mode requires synchronous of value changing and 328c2ecf20Sopenharmony_cienabling. It means when you want to update the any value of delay or 338c2ecf20Sopenharmony_cinext temperature, then you have to enable emulation mode at the same 348c2ecf20Sopenharmony_citime. (Or you have to keep the mode enabling.) If you don't, it fails to 358c2ecf20Sopenharmony_cichange the value to updated one and just use last succeessful value 368c2ecf20Sopenharmony_cirepeatedly. That's why this node gives users the right to change 378c2ecf20Sopenharmony_citermerpature only. Just one interface makes it more simply to use. 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ciDisabling emulation mode only requires writing value 0 to sysfs node. 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci:: 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci TEMP 120 | 458c2ecf20Sopenharmony_ci | 468c2ecf20Sopenharmony_ci 100 | 478c2ecf20Sopenharmony_ci | 488c2ecf20Sopenharmony_ci 80 | 498c2ecf20Sopenharmony_ci | +----------- 508c2ecf20Sopenharmony_ci 60 | | | 518c2ecf20Sopenharmony_ci | +-------------| | 528c2ecf20Sopenharmony_ci 40 | | | | 538c2ecf20Sopenharmony_ci | | | | 548c2ecf20Sopenharmony_ci 20 | | | +---------- 558c2ecf20Sopenharmony_ci | | | | | 568c2ecf20Sopenharmony_ci 0 |______________|_____________|__________|__________|_________ 578c2ecf20Sopenharmony_ci A A A A TIME 588c2ecf20Sopenharmony_ci |<----->| |<----->| |<----->| | 598c2ecf20Sopenharmony_ci | 938us | | | | | | 608c2ecf20Sopenharmony_ci emulation : 0 50 | 70 | 20 | 0 618c2ecf20Sopenharmony_ci current temp: sensor 50 70 20 sensor 62