imx: thermal: use CPU temperature grade info for thresholds
authorTim Harvey <tharvey@gateworks.com>
Thu, 19 Nov 2015 14:49:40 +0000 (06:49 -0800)
committerEduardo Valentin <edubezval@gmail.com>
Tue, 24 Nov 2015 00:38:40 +0000 (16:38 -0800)
commita2291badc355d58ead5c19ae0609468947416040
tree5c3b0a66ef3895a42e7bb4a5edfd1e59356fbec3
parentc86b3de8c8b02d7e474fdc002c8df533b844524c
imx: thermal: use CPU temperature grade info for thresholds

The IMX6Q/IMX6DL SoC's have a 2-bit temperature grade stored in OTP which
is valid for all IMX6 SoC's (despite the fact that the IMXSDLRM and
IMXSXRM do not document this - this has been proven via tests as well as
verified by Freescale FAE).

Instead of assuming a fixed 85C for passive cooling threshold and 105C for
critical use the thermal grade for these configurations.

We will set the critical to maxT - 5C and passive to maxT - 10C.

Cc: Anson Huang <b20788@freescale.com>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Jon Nettleton <jon@solid-run.com>
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
----
v3:
 - rebase against linux-soc-thermal.git
 - added ack's from Shawn and Jon
v2:
 - remove check for IMX6Q and update comments: The OTP values have been tested
   on IMX6SOLO, IMX6DUALLITE, and IMX6SX and Freescale FAE has shared data with
   me that the OTP settings are the same and that the reference manuals will
   reflect this in their next updates.
 - set critical to max - 5C
 - set passive to max - 10C
 - display max temp in info
 - do not allow passive to be set above critical
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/imx_thermal.c