1*eaf7b460SMauro Carvalho Chehab===================== 2*eaf7b460SMauro Carvalho ChehabExynos Emulation Mode 3*eaf7b460SMauro Carvalho Chehab===================== 4*eaf7b460SMauro Carvalho Chehab 5*eaf7b460SMauro Carvalho ChehabCopyright (C) 2012 Samsung Electronics 6*eaf7b460SMauro Carvalho Chehab 7*eaf7b460SMauro Carvalho ChehabWritten by Jonghwa Lee <jonghwa3.lee@samsung.com> 8*eaf7b460SMauro Carvalho Chehab 9*eaf7b460SMauro Carvalho ChehabDescription 10*eaf7b460SMauro Carvalho Chehab----------- 11*eaf7b460SMauro Carvalho Chehab 12*eaf7b460SMauro Carvalho ChehabExynos 4x12 (4212, 4412) and 5 series provide emulation mode for thermal 13*eaf7b460SMauro Carvalho Chehabmanagement unit. Thermal emulation mode supports software debug for 14*eaf7b460SMauro Carvalho ChehabTMU's operation. User can set temperature manually with software code 15*eaf7b460SMauro Carvalho Chehaband TMU will read current temperature from user value not from sensor's 16*eaf7b460SMauro Carvalho Chehabvalue. 17*eaf7b460SMauro Carvalho Chehab 18*eaf7b460SMauro Carvalho ChehabEnabling CONFIG_THERMAL_EMULATION option will make this support 19*eaf7b460SMauro Carvalho Chehabavailable. When it's enabled, sysfs node will be created as 20*eaf7b460SMauro Carvalho Chehab/sys/devices/virtual/thermal/thermal_zone'zone id'/emul_temp. 21*eaf7b460SMauro Carvalho Chehab 22*eaf7b460SMauro Carvalho ChehabThe sysfs node, 'emul_node', will contain value 0 for the initial state. 23*eaf7b460SMauro Carvalho ChehabWhen you input any temperature you want to update to sysfs node, it 24*eaf7b460SMauro Carvalho Chehabautomatically enable emulation mode and current temperature will be 25*eaf7b460SMauro Carvalho Chehabchanged into it. 26*eaf7b460SMauro Carvalho Chehab 27*eaf7b460SMauro Carvalho Chehab(Exynos also supports user changeable delay time which would be used to 28*eaf7b460SMauro Carvalho Chehabdelay of changing temperature. However, this node only uses same delay 29*eaf7b460SMauro Carvalho Chehabof real sensing time, 938us.) 30*eaf7b460SMauro Carvalho Chehab 31*eaf7b460SMauro Carvalho ChehabExynos emulation mode requires synchronous of value changing and 32*eaf7b460SMauro Carvalho Chehabenabling. It means when you want to update the any value of delay or 33*eaf7b460SMauro Carvalho Chehabnext temperature, then you have to enable emulation mode at the same 34*eaf7b460SMauro Carvalho Chehabtime. (Or you have to keep the mode enabling.) If you don't, it fails to 35*eaf7b460SMauro Carvalho Chehabchange the value to updated one and just use last succeessful value 36*eaf7b460SMauro Carvalho Chehabrepeatedly. That's why this node gives users the right to change 37*eaf7b460SMauro Carvalho Chehabtermerpature only. Just one interface makes it more simply to use. 38*eaf7b460SMauro Carvalho Chehab 39*eaf7b460SMauro Carvalho ChehabDisabling emulation mode only requires writing value 0 to sysfs node. 40*eaf7b460SMauro Carvalho Chehab 41*eaf7b460SMauro Carvalho Chehab:: 42*eaf7b460SMauro Carvalho Chehab 43*eaf7b460SMauro Carvalho Chehab 44*eaf7b460SMauro Carvalho Chehab TEMP 120 | 45*eaf7b460SMauro Carvalho Chehab | 46*eaf7b460SMauro Carvalho Chehab 100 | 47*eaf7b460SMauro Carvalho Chehab | 48*eaf7b460SMauro Carvalho Chehab 80 | 49*eaf7b460SMauro Carvalho Chehab | +----------- 50*eaf7b460SMauro Carvalho Chehab 60 | | | 51*eaf7b460SMauro Carvalho Chehab | +-------------| | 52*eaf7b460SMauro Carvalho Chehab 40 | | | | 53*eaf7b460SMauro Carvalho Chehab | | | | 54*eaf7b460SMauro Carvalho Chehab 20 | | | +---------- 55*eaf7b460SMauro Carvalho Chehab | | | | | 56*eaf7b460SMauro Carvalho Chehab 0 |______________|_____________|__________|__________|_________ 57*eaf7b460SMauro Carvalho Chehab A A A A TIME 58*eaf7b460SMauro Carvalho Chehab |<----->| |<----->| |<----->| | 59*eaf7b460SMauro Carvalho Chehab | 938us | | | | | | 60*eaf7b460SMauro Carvalho Chehab emulation : 0 50 | 70 | 20 | 0 61*eaf7b460SMauro Carvalho Chehab current temp: sensor 50 70 20 sensor 62