summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/imx_thermal.c
Commit message (Collapse)AuthorAgeFilesLines
* Thermal: imx: correct critical trip temperature settingAnson Huang2014-07-011-11/+7
| | | | | | | | | | | | | | | | | | | On latest i.MX6 SOC with thermal calibration data of 0x5A100000, the critical trip temperature will be an invalid value and cause system auto shutdown as below log: thermal thermal_zone0: critical temperature reached(42 C),shutting down So, with universal formula for thermal sensor, only room temperature point is calibrated, which means the calibration data read from fuse only has valid data of bit [31:20], others are all 0, the critical trip point temperature can NOT depend on the hot point calibration data, here we set it to 20 C higher than default passive temperature. Signed-off-by: Anson Huang <b20788@freescale.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* thermal: imx: update formula for thermal sensorAnson Huang2014-04-081-13/+26
| | | | | | | | | | | | | | | | | Thermal sensor used to need two calibration points which are in fuse map to get a slope for converting thermal sensor's raw data to real temperature in degree C. Due to the chip calibration limitation, hardware team provides an universal formula to get real temperature from internal thermal sensor raw data: Slope = 0.4297157 - (0.0015976 * 25C fuse); Update the formula, as there will be no hot point calibration data in fuse map from now on. Signed-off-by: Anson Huang <b20788@freescale.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* Merge branch 'misc' of .git into nextZhang Rui2014-01-061-1/+1
|\
| * thermal: remove const flag from .ops of imx thermalEduardo Valentin2014-01-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per previous changes on thermal framework API, registering a new thermal zone does not require a const thermal zone ops. Thus, this patch removes the flag from imx thermal zone ops. Cc: Zhang Rui <rui.zhang@intel.com> Cc: Grant Likely <grant.likely@linaro.org> Cc: Rob Herring <rob.herring@calxeda.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* | thermal: imx: add necessary clk operationAnson Huang2014-01-031-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | Thermal sensor needs pll3_usb_otg when measuring temperature, otherwise the temperature read will be incorrect, so need to enable this clk before sensor working, for alarm function, as hardware will take measurement periodically, so we should keep this clk always on once alarm function is enabled. Signed-off-by: Anson Huang <b20788@freescale.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* | thermal: imx_thermal: add module device tableRussell King2014-01-021-0/+1
| | | | | | | | | | | | | | | | | | | | Add the module device table declaration so the module can be loaded automatically at boot time. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* | thermal: imx: correct suspend/resume flowAnson Huang2014-01-021-14/+17
|/ | | | | | | | | | | | | | | | | | | | Fixes regression introduced by: commit 37713a1e8e4c1a1067ad4c99296f78d3c82ed9c4 Author: Philipp Zabel <p.zabel@pengutronix.de> Date: Thu Aug 1 18:33:12 2013 +0200 thermal: imx: implement thermal alarm interrupt handling The commit 37713a1e8e4 makes imx thermal sensor always powered up as alarm function is enabled, but the suspend callback of imx thermal returns success only if thermal sensor is powered down, so it will always returns fail hence break system's suspend, this patch disables imx thermal sensor before suspend and re-enable it after resume. Signed-off-by: Anson Huang <b20788@freescale.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* thermal: imx: implement thermal alarm interrupt handlingPhilipp Zabel2013-08-151-13/+127
| | | | | | | | | | Enable automatic measurements at 10 Hz and use the alarm interrupt to react more quickly to sudden temperature changes above the passive or critical temperature trip points. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* thermal: imx: dynamic passive and SoC specific critical trip pointsPhilipp Zabel2013-08-151-10/+40
| | | | | | | | | | | Set passive and critical trip point values depending on the maximum die temperature stored in the OCOTP fuses. This allows higher trip points for industrial and automotive rated i.MX6 SoCs. Also allow to configure the passive trip point from userspace. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* thermal: add imx thermal driver supportShawn Guo2013-08-131-0/+397
This is based on the initial imx thermal work done by Rob Lee <rob.lee@linaro.org> (Not sure if the email address is still valid). Since he is no longer interested in the work and I have rewritten a significant amount of the code, I just took the authorship over from him. It adds the imx thermal support using Temperature Monitor (TEMPMON) block found on some Freescale i.MX SoCs. The driver uses syscon regmap interface to access TEMPMON control registers and calibration data, and supports cpufreq as the cooling device. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>