thermal: Don't limit CPU frequency after msm_thermal is disabled

There may be an outstanding task to check for threshold crossing
when msm_thermal is disabled and CPU is restored to maximum
frequency. This task can get scheduled after the maximum frequency
is restored, and result in another mitigation that pins CPU
frequencies to 918mHz. This happens in the case that the final
temperature was still above the max temperature threshold.
This patch ensures any outstanding tasks are cancelled and flushed
before finally restoring the CPU frequencies.

CRs-fixed: 351614
Change-Id: Ifce00b379989b78856803ac09c7403207f5c998b
Signed-off-by: Eugene Seah <eseah@codeaurora.org>
drivers: thermal: create kernel thermal readout

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
defconfig: disable not needed thermal driver

This caused a race condition when assigning trusted zones.

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Revert "thermal: Don't limit CPU frequency after msm_thermal is disabled"

This reverts commit 4034964ae9202ef6976b72575c2e67203a362f99.
thermal: patch down msm_thermal, pre device

This also removes the cputable freq changes, which
we won't need since we use static values.

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
msm_thermal: 3-phase thermal throttling

This introduces 3-phase thermal throttling to the existing
msm_thermal driver (it now works more like thermald).
This also changes the sampling rate to check every second
for increased temperatures.
Additionally this adds clear thresholds for the 2 new tripping
points.

Signed-off-by: showp1984 <showp1984@gmail.com>
msm_thermal: add sysfs interface

This adds a sysfs interface to msm_thermal.
I've also restructured the tuneables into a struct
for better overview.

Signed-off-by: showp1984 <showp1984@gmail.com>
msm_thermal: move sysfs to /sys/kernel/msm_thermal/conf/

Signed-off-by: showp1984 <showp1984@gmail.com>
msm_thermal: fix saving pre-throttled freq

Signed-off-by: showp1984 <showp1984@gmail.com>
drivers/thermal: create own unbound (highpri) wq for msm_thermal

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
drivers/thermal: adapt msm_thermal for quadcore & mako

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
drivers/thermal: use config variable here

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
boards: fix up other boardfiles due to msm_thermal downgrade

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
drivers/thermal: add emergency shutdown

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>