BACKPORT: thermal/drivers/hisi: Remove costly sensor inspection
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 19 Oct 2017 17:05:51 +0000 (19:05 +0200)
committerKevin Wangtao <kevin.wangtao@hisilicon.com>
Fri, 26 Jan 2018 01:59:39 +0000 (09:59 +0800)
commit29776b59f90f1a28af5d0763a23ad2f8bdde2f94
treed7ae05410b12e46ce127fa110db7179812876599
parentb5f9b8c241b9c8b1d2536cb0a8a6d948ac11cece
BACKPORT: thermal/drivers/hisi: Remove costly sensor inspection

The sensor is all setup, bind, resetted, acked, etc... every single second.

That was the way to workaround a problem with the interrupt bouncing again and
again.

With the following changes, we fix all in one:

 - Do the setup, one time, at probe time

 - Add the IRQF_ONESHOT, ack the interrupt in the threaded handler

 - Remove the interrupt handler

 - Set the correct value for the LAG register

 - Remove all the irq_enabled stuff in the code as the interruption
   handling is fixed

 - Remove the 3ms delay

 - Reorder the initialization routine to be in the right order

It ends up to a nicer code and more efficient, the 3-5ms delay is removed from
the get_temp() path.

Change-Id: I73a357caed3a34cd1f4de594c724577b4146683c
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Leo Yan <leo.yan@linaro.org>
Tested-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
(cherry picked from commit 10d7e9a9181f4637640f388d334c6740c1b5d0e8)
Signed-off-by: Kevin Wangtao <kevin.wangtao@hisilicon.com>
drivers/thermal/hisi_thermal.c