drivers: thermal: create kernel thermal readout

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 3d4c41995484a8b4c09ee542d14b970119de6669)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:
	drivers/thermal/msm_thermal.c
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>

Conflicts:
	drivers/thermal/msm_thermal.c
	include/linux/msm_thermal.h

(cherry picked from commit 7c769abfce7c246cf77593d83e5647d207709d32)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:
	drivers/thermal/msm_thermal.c
	include/linux/msm_thermal.h
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>
(cherry picked from commit 0836330a11dd55ea31468c3c0fcfc8fcd9893a10)
Signed-off-by: thirdzcee <thirdzcee@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>
(cherry picked from commit 5c1930018ef61c51f932e5f6fa48f0cab8adf7e6)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>

Conflicts:
	drivers/thermal/msm_thermal.c
msm_thermal: move sysfs to /sys/kernel/msm_thermal/conf/

Signed-off-by: showp1984 <showp1984@gmail.com>
(cherry picked from commit 64937e8ac1ec715dbcfc21ac02ef891db4d53d36)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
more patching down, was wondering why i was getting a lot of errors

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

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

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 91820a5a0ab957ff4ccd9a5d10d8c0903d938b16)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>
drivers/thermal: add emergency shutdown

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
(cherry picked from commit 1cf3d6bdce2fc5de08ebbb2893ef3f47372b98f3)
Signed-off-by: thirdzcee <thirdzcee@gmail.com>