aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/ti-soc-thermal/ti-bandgap.c
AgeCommit message (Collapse)Author
2016-03-08thermal: ti-soc-thermal: clean up the error handling a bitDan Carpenter
We don't need to initialize "ret". We can move the IS_ERR() checks into the if condition instead of doing an assignment first. Also there is a check for "ret" when we know it is zero so we can remove that. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2015-09-29thermal: ti-soc-thermal: add OMAP36xx supportEduardo Valentin
Add OMAP36xx support to ti-soc-thermal driver. This chip is also unreliable. The data provided here is based on OMAP36xx TRM: http://www.ti.com/lit/ug/swpu177aa/swpu177aa.pdf Signed-off-by: Eduardo Valentin <edubezva@gmail.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2015-09-29ti-soc-thermal: implement omap3 supportPavel Machek
This adds support for OMAP3 chips to ti-soc-thermal. As requested by TI people, it is marked unreliable and warning is printed. Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2015-06-25Merge branch 'next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux Pull thermal management updates from Zhang Rui: "Specifics: - enhance Thermal Framework with several new capabilities: * use power estimates * compute weights with relative integers instead of percentages * allow governors to have private data in thermal zones * export thermal zone parameters through sysfs Thanks to the ARM thermal team (Javi, Punit, KP). - introduce a new thermal governor: power allocator. First in kernel closed loop PI(D) controller for thermal control. Thanks to ARM thermal team. - enhance OF thermal to allow thermal zones to have sustainable power HW specification. Thanks to Punit. - introduce thermal driver for Intel Quark SoC x1000platform. Thanks to Ong, Boon Leong. - introduce QPNP PMIC temperature alarm driver. Thanks to Ivan T. I. - introduce thermal driver for Hisilicon hi6220. Thanks to kongxinwei. - enhance Exynos thermal driver to handle Exynos5433 TMU. Thanks to Chanwoo C. - TI thermal driver now has a better implementation for EOCZ bit. From Pavel M. - add id for Skylake processors in int340x processor thermal driver. - a couple of small fixes and cleanups." * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (36 commits) thermal: hisilicon: add new hisilicon thermal sensor driver dt-bindings: Document the hi6220 thermal sensor bindings thermal: of-thermal: add support for reading coefficients property thermal: support slope and offset coefficients thermal: power_allocator: round the division when divvying up power thermal: exynos: Add the support for Exynos5433 TMU thermal: cpu_cooling: Fix power calculation when CPUs are offline thermal: cpu_cooling: Remove cpu_dev update on policy CPU update thermal: export thermal_zone_parameters to sysfs thermal: cpu_cooling: Check memory allocation of power_table ti-soc-thermal: request temperature periodically if hw can't do that itself ti-soc-thermal: implement eocz bit to make driver useful on omap3 cleanup ti-soc-thermal thermal: remove stale THERMAL_POWER_ACTOR select thermal: Default OF created trip points to writable thermal: core: Add Kconfig option to enable writable trips thermal: x86_pkg_temp: drop const for thermal_zone_parameters of: thermal: Introduce sustainable power for a thermal zone thermal: add trace events to the power allocator governor thermal: introduce the Power Allocator governor ...
2015-05-08thermal: ti-soc-thermal: OMAP5: Implement Workaround for Errata i813Keerthy
DESCRIPTION Spurious Thermal Alert: Talert can happen randomly while the device remains under the temperature limit defined for this event to trig. This spurious event is caused by a incorrect re-synchronization between clock domains. The comparison between configured threshold and current temperature value can happen while the value is transitioning (metastable), thus causing inappropriate event generation. No spurious event occurs as long as the threshold value stays unchanged. Spurious event can be generated while a thermal alert threshold is modified in CONTROL_BANDGAP_THRESHOLD_MPU/GPU/CORE/DSPEVE/IVA_n. WORKAROUND Spurious event generation can be avoided by performing following sequence when the threshold is modified: 1. Mask the hot/cold events at the thermal IP level. 2. Modify Threshold. 3. Unmask the hot/cold events at the thermal IP level. Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2015-05-08thermal: ti-soc-thermal: dra7: Implement Workaround for Errata i814Keerthy
Bandgap Temperature read Dtemp can be corrupted DESCRIPTION Read accesses to registers listed below can be corrupted due to incorrect resynchronization between clock domains. Read access to registers below can be corrupted : • CTRL_CORE_DTEMP_MPU/GPU/CORE/DSPEVE/IVA_n (n = 0 to 4) • CTRL_CORE_TEMP_SENSOR_MPU/GPU/CORE/DSPEVE/IVA_n WORKAROUND Multiple reads to CTRL_CORE_TEMP_SENSOR_MPU/GPU/CORE/DSPEVE/IVA[9:0]: BGAP_DTEMPMPU/GPU/CORE/DSPEVE/IVA is needed to discard false value and read right value: 1. Perform two successive reads to BGAP_DTEMP bit field. (a) If read1 returns Val1 and read2 returns Val1, then right value is Val1. (b) If read1 returns Val1, read 2 returns Val2, a third read is needed. 2. Perform third read (a) If read3 returns Val2 then right value is Val2. (b) If read3 returns Val3, then right value is Val3. The above in gist means if val1 and val2 are the same then we can go ahead with that value else we need a third read which will be right since synchronization will be complete by then. Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2015-05-04ti-soc-thermal: request temperature periodically if hw can't do that itselfPavel Machek
When periodic mode is not enabled, it is neccessary to force reads. Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2015-05-04ti-soc-thermal: implement eocz bit to make driver useful on omap3Pavel Machek
For omap3, proper implementation of eocz bit is needed. It was actually a TODO in the driver. Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2015-05-04cleanup ti-soc-thermalPavel Machek
Simplify code by removing goto's where they point to simple return. Avoid confusing |= on error values. Correct whitespace. Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2015-02-24thermal: ti-soc-thermal: bandgap: Fix build warning if !CONFIG_PM_SLEEPGrygorii Strashko
Fix following build warning if CONFIG_PM_SLEEP is not set: drivers/thermal/ti-soc-thermal/ti-bandgap.c:1478:12: warning: 'ti_bandgap_suspend' defined but not used [-Wunused-function] static int ti_bandgap_suspend(struct device *dev) ^ drivers/thermal/ti-soc-thermal/ti-bandgap.c:1492:12: warning: 'ti_bandgap_resume' defined but not used [-Wunused-function] static int ti_bandgap_resume(struct device *dev) ^ Acked-by: Nishanth Menon <nm@ti.com> Signed-off-by: Grygorii Strashko <Grygorii.Strashko@linaro.org> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2014-07-01thermal: ti-soc-thermal: ti-bandgap.c: Cleaning up wrong address is checkedRickard Strandqvist
Wrong address is checked after memory allocation. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2014-05-06thermal: ti-soc-thermal: clk_round_rate() can return a zero upon errorPaul Walmsley
Treat both negative and zero return values from clk_round_rate() as errors. This is needed since subsequent patches will convert clk_round_rate()'s return value to be an unsigned type, rather than a signed type, since some clock sources can generate rates higher than (2^31)-1 Hz. Eventually, when calling clk_round_rate(), only a return value of zero will be considered a error. All other values will be considered valid rates. The comparison against values less than 0 is kept to preserve the correct behavior in the meantime. This patch also gets rid of a comparison between unsigned and signed values; a side-benefit. Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com> Cc: Eduardo Valentin <eduardo.valentin@ti.com> Cc: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
2014-04-08thermal: ti-soc-thermal: Use SIMPLE_DEV_PM_OPS macroJingoo Han
Use SIMPLE_DEV_PM_OPS macro in order to make the code simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-08-29thermal: ti-soc-thermal: Ensure to compute thermal trendRanganath Krishnan
Workaround to compute thermal trend even when update interval is not set. This patch will ensure to compute the thermal trend when bandgap counter delay is not set. Signed-off-by: Ranganath Krishnan <ranganath@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-07-08thermal: ti-soc-thermal: use standard GPIO DT bindingsEduardo Valentin
This change updates the ti-soc-thermal driver to use standard GPIO DT bindings to read the GPIO number associated to thermal shutdown IRQ, in case the device features it. Previously, the code was using a specific DT bindings. As now OMAP supports the standard way to model GPIOs, there is no point in having a ti specific binding. 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-discuss@lists.ozlabs.org Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
2013-06-13thermal: ti-soc-thermal: add dra752 chip to device tableEduardo Valentin
Add support to TI dra752 chips by adapting the driver device table. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-06-13thermal: ti-soc-thermal: remove usage of IS_ERR_OR_NULLEduardo Valentin
This patch changes the driver to avoid the usage of IS_ERR_OR_NULL() macro. This macro can lead to dangerous results, like returning success (0) during a failure scenario (NULL pointer handling). For this reason this patch is changing the driver after revisiting the code. These are the cases: i. For cases in which IS_ERR_OR_NULL() is used for checking return values of functions that returns either PTR_ERR() or a valid pointer, it has been translated to IS_ERR() check only. ii. For cases that a NULL check is still needed, it has been translated to if (!ptr || IS_ERR(ptr)). Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-06-13thermal: ti-soc-thermal: freeze FSM while computing trendEduardo Valentin
In order to read the history buffer, it is required to freeze BG FSM. This patch adds the missing piece of code to freeze the FSM and also a contention area to avoid other parts of the code to access the DTEMPs. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-05-28thermal: introduce TI SoC thermal driverEduardo Valentin
This patch moves the ti-soc-thermal driver out of the staging tree to the thermal tree. Cc: Grant Likely <grant.likely@linaro.org> Cc: Rob Herring <rob.herring@calxeda.com> Cc: Rob Landley <rob@landley.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <eduardo.valentin@ti.com> Cc: J Keerthy <j-keerthy@ti.com> Cc: Radhesh Fadnis <radhesh.fadnis@ti.com> Cc: Cyril Roelandt <tipecaml@gmail.com> Cc: devicetree-discuss@lists.ozlabs.org Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: devel@driverdev.osuosl.org Cc: linux-pm@vger.kernel.org Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>