thermal/drivers/hisi: Remove costly sensor inspection
commit10d7e9a9181f4637640f388d334c6740c1b5d0e8
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 19 Oct 2017 17:05:51 +0000 (19 19:05 +0200)
committerEduardo Valentin <edubezval@gmail.com>
Wed, 1 Nov 2017 02:32:16 +0000 (31 19:32 -0700)
tree51467cf32cef550e044cdafd425844b9d143cc76
parentb424315a287c70eeb5f920f84c92492bd2f5658e
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.

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>
drivers/thermal/hisi_thermal.c