msm: thermal: Automate KTM's switch to interrupt mode

Add support to Kernel Thermal Monitor (KTM) to stop polling
the temperatures and switch to interrupt mode when the KTM
module init is called. This avoids KTM's dependency on
thermal-engine to notify when to switch to interrupt mode.

After switching to interrupt mode, the KTM spawns a
thermal monitor thread and registers temperature
thresholds for monitoring the vdd restriction.

CRs-Fixed: 567187
Change-Id: Ib1536c9fc32d3fc0ef2737818c39ca80c5d636d8
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
(cherry picked from commit 1e7f31cbab5a5546d28ce63225635162dcb852e6)
msm: thermal: Update to speed up bootup time

Update KTM driver to remove flush_scheduled_work that
would introduce bootup delay. This patch replaces
cancel_delayed_work with cancel_delayed_work_sync
to cancel a delayed work.

CRs-Fixed: 647439
Change-Id: Ie81278ca3a7a58f8f46463f7149b512bd07cbcbc
Signed-off-by: Shiju Mathew <shijum@codeaurora.org>
(cherry picked from commit f1e51e6fb314f35436b9599a5574ff28f61c2956)
Merge "msm: thermal: Automate KTM's switch to interrupt mode"
Merge "msm: thermal: Update to speed up bootup time"