MLK-16300 thermal: imx: avoid error message of get_temp when thermal zone is off
authorAnson Huang <Anson.Huang@nxp.com>
Wed, 30 Aug 2017 02:42:07 +0000 (10:42 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:38:21 +0000 (15:38 -0500)
commitccc62a688ef41366d7b82a851516a0e2793f6eea
treec9dd4f144cf9891ba0afa06406c208f922b858b6
parent3be86c14dfce60e822ddefd25c6908a95272e3cc
MLK-16300 thermal: imx: avoid error message of get_temp when thermal zone is off

For i.MX system controller thermal, when some of the thermal
zones are powered off, the get temp will fail, and thermal driver
will return CPU thermal zone's temp instead. But current driver
will return A53 cluster for all cases, and A53 cluster may be
also off when booting up A72 cluster only, so below error message
will come out:

[  475.606431] read temp sensor:0 failed
[  475.610107] thermal thermal_zone0: failed to read out thermal zone (-22)

To avoid this error, for the case of thermal zones power off,
thermal driver can return current thread's CPU cluster temperature.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
drivers/thermal/imx_sc_thermal.c