[Desire 816 Android Development] bigsupersquid:
fixed thermanager.xml, woohoo.

<thermanager>
<resources>
<!-- thermal zones -->
<resource name="tsens_tz_sensor0" type="tz">/sys/class/thermal/thermal_zone0</resource> <!-- cpu0 -->
<resource name="tsens_tz_sensor1" type="tz">/sys/class/thermal/thermal_zone1</resource> <!-- cpu1 -->
<resource name="tsens_tz_sensor2" type="tz">/sys/class/thermal/thermal_zone2</resource> <!-- gpu0 -->
<resource name="tsens_tz_sensor3" type="tz">/sys/class/thermal/thermal_zone3</resource> <!-- gpu1 -->
<resource name="tsens_tz_sensor4" type="tz">/sys/class/thermal/thermal_zone4</resource> <!-- cpu2 -->
<resource name="tsens_tz_sensor5" type="tz">/sys/class/thermal/thermal_zone5</resource> <!-- cpu3 -->

<resource name="pm8226_tz" type="tz">/sys/class/thermal/thermal_zone6</resource>
<resource name="pa_therm0" type="tz">/sys/class/thermal/thermal_zone7</resource>
<resource name="pa_therm1" type="tz">/sys/class/thermal/thermal_zone8</resource>

<resource name="temp-core" type="union">
<resource name="pa_therm0" />
<resource name="pa_therm1" />
</resource>

<resource name="temp-cortex-a7" type="union">
<resource name="tsens_tz_sensor0" />
<resource name="tsens_tz_sensor1" />
<resource name="tsens_tz_sensor4" />
<resource name="tsens_tz_sensor5" />
</resource>

<resource name="temp-adreno-305" type="union">
<resource name="tsens_tz_sensor2" />
<resource name="tsens_tz_sensor3" />
</resource>

<!-- generic cpufreq -->
<resource name="cpu" type="sysfs">/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq</resource>

<!-- device-specific -->
<resource name="backlight" type="sysfs">/sys/devices/fd900000.qcom,mdss_mdp/qcom,mdss_fb_primary.157/leds/lcd-backlight/max_brightness</resource>
<resource name="charger" type="sysfs">/sys/devices/platform/htc_battery/power_supply/battery/batt_temp_now</resource>
<resource name="charge_en" type="sysfs">/sys/class/power_supply/battery/charging_enabled</resource>
<resource name="dc" type="sysfs">/sys/devices/platform/htc_battery/power_supply/ac/current_max</resource>
<resource name="gpu" type="sysfs">/sys/class/kgsl/kgsl-3d0/max_gpuclk</resource>
<resource name="usb" type="sysfs">/sys/class/power_supply/usb/current_max</resource>

<!-- TODO: -->
<resource name="modem" type="echo" />

<resource name="shutdown" type="halt" delay="5" />
</resources>

<control name="usb">
<mitigation level="off"><value resource="usb">1500000</value></mitigation>
<mitigation level="1"><value resource="usb">1100000</value></mitigation>
<mitigation level="2"><value resource="usb">900000</value></mitigation>
<mitigation level="3"><value resource="usb">700000</value></mitigation>
<mitigation level="4"><value resource="usb">500000</value></mitigation>
<mitigation level="5"><value resource="usb">300000</value></mitigation>
<mitigation level="6"><value resource="usb">150000</value></mitigation>
</control>

<control name="dc">
<mitigation level="off"><value resource="dc">1800000</value></mitigation>
<mitigation level="1"><value resource="dc">1100000</value></mitigation>
<mitigation level="2"><value resource="dc">900000</value></mitigation>
<mitigation level="3"><value resource="dc">700000</value></mitigation>
<mitigation level="4"><value resource="dc">500000</value></mitigation>
<mitigation level="5"><value resource="dc">300000</value></mitigation>
<mitigation level="6"><value resource="dc">150000</value></mitigation>
</control>

<control name="charge_en">
<mitigation level="off"><value resource="charge_en">1</value></mitigation>
<mitigation level="1"><value resource="charge_en">0</value></mitigation>
<mitigation level="2"><value resource="shutdown" /></mitigation>
</control>

<control name="charging">
<mitigation level="off"><value resource="charger">0</value></mitigation>
<mitigation level="1"><value resource="charger">1</value></mitigation>
<mitigation level="2"><value resource="charger">2</value></mitigation>
<mitigation level="3"><value resource="charger">3</value></mitigation>
<mitigation level="4"><value resource="charger">4</value></mitigation>
<mitigation level="5"><value resource="charger">5</value></mitigation>
<mitigation level="6"><value resource="charger">6</value></mitigation>
<mitigation level="7"><value resource="charger">7</value></mitigation>
<mitigation level="8"><value resource="charger">8</value></mitigation>
<mitigation level="9"><value resource="charger">9</value></mitigation>
</control>

<control name="modem">
<mitigation level="off"><value resource="modem">0</value></mitigation>
<mitigation level="1"><value resource="modem">1</value></mitigation>
</control>

<control name="shutdown">
<mitigation level="off" />
<mitigation level="1"><value resource="shutdown" /></mitigation>
</control>

<control name="backlight">
<mitigation level="off"><value resource="backlight">255</value></mitigation>
<mitigation level="1"><value resource="backlight">227</value></mitigation>
<mitigation level="2"><value resource="backlight">199</value></mitigation>
<mitigation level="3"><value resource="backlight">170</value></mitigation>
<mitigation level="4"><value resource="backlight">142</value></mitigation>
<mitigation level="5"><value resource="backlight">116</value></mitigation>
<mitigation level="6"><value resource="backlight">90</value></mitigation>
<mitigation level="7"><value resource="backlight">64</value></mitigation>
<mitigation level="8"><value resource="backlight">64</value></mitigation>
<mitigation level="9"><value resource="backlight">39</value></mitigation>
</control>

<control name="gpu">
<mitigation level="off"><value resource="kgsl-3d0">450000000</value></mitigation>
<mitigation level="1"><value resource="kgsl-3d0">320000000</value></mitigation>
<mitigation level="2"><value resource="kgsl-3d0">200000000</value></mitigation>
<mitigation level="3"><value resource="shutdown" /></mitigation>
</control>

<control name="cpu">
<mitigation level="off"><value resource="cortex-a7">1190400</value></mitigation>
<mitigation level="1"><value resource="cortex-a7">1094400</value></mitigation>
<mitigation level="2"><value resource="cortex-a7">998400</value></mitigation>
<mitigation level="3"><value resource="cortex-a7">787200</value></mitigation>
<mitigation level="4"><value resource="cortex-a7">600000</value></mitigation>
<mitigation level="5"><value resource="cortex-a7">384000</value></mitigation>
<mitigation level="6"><value resource="cortex-a7">300000</value></mitigation>
<mitigation level="7"><value resource="shutdown" /></mitigation>
</control>

<!-- burn-out protection -->
<configuration sensor="temp-core">
<threshold>
<mitigation name="shutdown" level="off" />
</threshold>
<threshold trigger="85" clear="75">
<mitigation name="shutdown" level="1" />
</threshold>
</configuration>

<!-- USB -->
<configuration sensor="pm8226_tz">
<threshold>
<mitigation name="usb" level="off" />
</threshold>
<threshold trigger="49000" clear="48000">
<mitigation name="usb" level="1" />
</threshold>
<threshold trigger="50000" clear="49000">
<mitigation name="usb" level="2" />
</threshold>
<threshold trigger="51000" clear="50000">
<mitigation name="usb" level="3" />
</threshold>
<threshold trigger="57000" clear="56000">
<mitigation name="usb" level="4" />
</threshold>
</configuration>

<!-- charging -->
<configuration sensor="pm8226_tz">
<threshold>
<mitigation name="charging" level="off" />
</threshold>
<threshold trigger="49000" clear="48000">
<mitigation name="charging" level="2" />
</threshold>
<threshold trigger="50000" clear="49000">
<mitigation name="charging" level="3" />
</threshold>
<threshold trigger="51000" clear="50000">
<mitigation name="charging" level="4" />
</threshold>
</configuration>

<!-- GPU -->
<configuration sensor="pm8226_tz">
<threshold>
<mitigation name="gpu" level="off" />
</threshold>
<threshold trigger="66000" clear="60000">
<mitigation name="gpu" level="2" />
</threshold>
</configuration>

<configuration sensor="temp-adreno-305">
<threshold>
<mitigation name="gpu" level="off" />
</threshold>
<threshold trigger="100" clear="95">
<mitigation name="gpu" level="2" />
</threshold>
<threshold trigger="120" clear="110">
<mitigation name="gpu" level="3" />
</threshold>
</configuration>

<!-- modem -->
<configuration sensor="pm8226_tz">
<threshold>
<mitigation name="modem" level="off" />
</threshold>
<threshold trigger="66000" clear="60000">
<mitigation name="modem" level="1" />
</threshold>
</configuration>

<!-- backlight -->
<configuration sensor="pm8226_tz">
<threshold>
<mitigation name="backlight" level="off" />
</threshold>
<threshold trigger="51000" clear="50000">
<mitigation name="backlight" level="1" />
</threshold>
<threshold trigger="53000" clear="52000">
<mitigation name="backlight" level="2" />
</threshold>
<threshold trigger="54000" clear="53000">
<mitigation name="backlight" level="3" />
</threshold>
<threshold trigger="55000" clear="54000">
<mitigation name="backlight" level="4" />
</threshold>
<threshold trigger="57000" clear="56000">
<mitigation name="backlight" level="5" />
</threshold>
<threshold trigger="58000" clear="57000">
<mitigation name="backlight" level="6" />
</threshold>
<threshold trigger="66000" clear="60000">
<mitigation name="backlight" level="7" />
</threshold>
</configuration>

<!-- CPU -->
<configuration sensor="pm8226_tz">
<threshold>
<mitigation name="cpu" level="off" />
</threshold>
<threshold trigger="53000" clear="52000">
<mitigation name="cpu" level="1" />
</threshold>
<threshold trigger="56000" clear="55000">
<mitigation name="cpu" level="2" />
</threshold>
<threshold trigger="58000" clear="57000">
<mitigation name="cpu" level="3" />
</threshold>
<threshold trigger="66000" clear="60000">
<mitigation name="cpu" level="4" />
</threshold>
</configuration>

<configuration sensor="temp-cortex-a7">
<threshold>
<mitigation name="cpu" level="off" />
</threshold>
<threshold trigger="90" clear="75">
<mitigation name="cpu" level="2" />
</threshold>
<threshold trigger="95" clear="80">
<mitigation name="cpu" level="3" />
</threshold>
<threshold trigger="110" clear="100">
<mitigation name="cpu" level="5" />
</threshold>
<threshold trigger="120" clear="110">
<mitigation name="cpu" level="7" />
</threshold>
</configuration>
</thermanager>