summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/spear_thermal.c
Commit message (Collapse)AuthorAgeFilesLines
* thermal/drivers/spear: Don't use tz->device but pdev->devDaniel Lezcano2023-03-031-1/+1
| | | | | | | | Use the spear associated device instead of the thermal zone device which belongs to the thermal framework internals. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* thermal/core: Use the thermal zone 'devdata' accessor in thermal located driversDaniel Lezcano2023-03-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The thermal zone device structure is exposed to the different drivers and obviously they access the internals while that should be restricted to the core thermal code. In order to self-encapsulate the thermal core code, we need to prevent the drivers accessing directly the thermal zone structure and provide accessor functions to deal with. Use the devdata accessor introduced in the previous patch. No functional changes intended. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> #R-Car Acked-by: Mark Brown <broonie@kernel.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> #MediaTek auxadc and lvts Reviewed-by: Balsam CHIHI <bchihi@baylibre.com> #Mediatek lvts Reviewed-by: Adam Ward <DLG-Adam.Ward.opensource@dm.renesas.com> #da9062 Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> #spread Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> #sun8i_thermal Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> #Broadcom Reviewed-by: Dhruva Gole <d-gole@ti.com> # K3 bandgap Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Heiko Stuebner <heiko@sntech.de> #rockchip Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> #uniphier Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* thermal/drivers/spear: Use devm_platform_get_and_ioremap_resource()ye xingchen2023-01-181-3/+1
| | | | | | | | | | Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Link: https://lore.kernel.org/r/202301181644433003839@zte.com.cn Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
* thermal: Explicitly enable non-changing thermal zone devicesAndrzej Pietrasiewicz2020-06-291-0/+7
| | | | | | | | | | Some thermal zone devices never change their state, so they should be always enabled. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20200629122925.21729-9-andrzej.p@collabora.com
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282Thomas Gleixner2019-06-051-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this software is licensed under the terms of the gnu general public license version 2 as published by the free software foundation and may be copied distributed and modified under those terms this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 285 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190529141900.642774971@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* thermal: spear_thermal: simplify getting .driver_dataWolfram Sang2018-11-301-5/+3
| | | | | | | | | We should get 'driver_data' from 'struct device' directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* thermal: spear: use __maybe_unused for PM functionsArnd Bergmann2016-02-091-4/+2
| | | | | | | | | | | | | | | The spear thermal driver hides its suspend/resume function conditionally based on CONFIG_PM, but references them based on CONFIG_PM_SLEEP, so we get a warning if the former is set but the latter is not: thermal/spear_thermal.c:58:12: warning: 'spear_thermal_suspend' defined but not used [-Wunused-function] thermal/spear_thermal.c:75:12: warning: 'spear_thermal_resume' defined but not used [-Wunused-function] This removes the #ifdef and instead uses a __maybe_uninitialized annotation to avoid the warning and improve compile-time coverage. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
* thermal: consistently use int for temperaturesSascha Hauer2015-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The thermal code uses int, long and unsigned long for temperatures in different places. Using an unsigned type limits the thermal framework to positive temperatures without need. Also several drivers currently will report temperatures near UINT_MAX for temperatures below 0°C. This will probably immediately shut the machine down due to overtemperature if started below 0°C. 'long' is 64bit on several architectures. This is not needed since INT_MAX °mC is above the melting point of all known materials. Consistently use a plain 'int' for temperatures throughout the thermal code and the drivers. This only changes the places in the drivers where the temperature is passed around as pointer, when drivers internally use another type this is not changed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Lukasz Majewski <l.majewski@samsung.com> Reviewed-by: Darren Hart <dvhart@linux.intel.com> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Peter Feuerer <peter@piie.net> Cc: Punit Agrawal <punit.agrawal@arm.com> Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <edubezval@gmail.com> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Jean Delvare <jdelvare@suse.de> Cc: Peter Feuerer <peter@piie.net> Cc: Heiko Stuebner <heiko@sntech.de> Cc: Lukasz Majewski <l.majewski@samsung.com> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: linux-acpi@vger.kernel.org Cc: platform-driver-x86@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-omap@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org Cc: Guenter Roeck <linux@roeck-us.net> Cc: Rafael J. Wysocki <rjw@rjwysocki.net> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Darren Hart <dvhart@infradead.org> Cc: lm-sensors@lm-sensors.org Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* thermal: drop owner assignment from platform_driversWolfram Sang2014-10-201-1/+0
| | | | | | | A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* thermal: spear: remove unnecessary OOM messagesJingoo Han2014-05-151-3/+1
| | | | | | | | | The site-specific OOM messages are unnecessary, because they duplicate the MM subsystem generic OOM message. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
*---. Merge branches 'misc', 'drv_cleanup', 'devm-cleanup' and 'ti-soc' of .git ↵Zhang Rui2013-05-281-13/+5
|\ \ \ | | | | | | | | | | | | into next
| | * | Thermal: don't check resource with devm_ioremap_resourceZhang Rui2013-05-281-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | devm_ioremap_resource does sanity checks on the given resource. No need to duplicate this in the driver. CC: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> CC: Vincenzo Frascino <vincenzo.frascino@st.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
| | * | Thermal: spear_thermal: convert to devm_ioremap_resourceZhang Rui2013-05-201-10/+10
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the newly introduced devm_ioremap_resource(). devm_ioremap_resource() provides its own error messages; so all explicit error messages can be removed from the failure code paths. CC: Vincenzo Frascino <vincenzo.frascino@st.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
| * / Thermal: spear: Remove redundant platform_set_drvdata()Sachin Kamat2013-05-061-1/+0
| |/ | | | | | | | | | | | | | | | | | | | | | | Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Vincenzo Frascino <vincenzo.frascino@st.com> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* / Thermal: spear: Remove redundant use of of_match_ptrSachin Kamat2013-05-281-1/+1
|/ | | | | | | | | | | | 'spear_thermal_id_table' is always compiled in and the driver is dependent on OF. Hence use of of_match_ptr is unnecessary. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Vincenzo Frascino <vincenzo.frascino@st.com> Cc: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* drivers/thermal/spear_thermal.c: use devm_clk_getJulia Lawall2013-01-041-5/+2
| | | | | | | | | devm_clk_get allocates a resource that is released when a driver detaches. This patch uses devm_clk_get for data that is allocated in the probe function of a platform device and is only released in the remove function. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* Thermal: Pass zone parameters as argument to tzd_registerDurgadoss R2012-11-051-1/+1
| | | | | | | | | This patch adds the thermal zone parameter as an argument to the tzd_register() function call; and updates other drivers using this function. Signed-off-by: Durgadoss R <durgadoss.r@intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* Thermal: Remove tc1/tc2 in generic thermal layer.Zhang Rui2012-09-241-1/+1
| | | | | | | | | Remove tc1/tc2 in generic thermal layer. .get_trend() callback starts to take effect from this patch. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl> Reviewed-by: Valentin, Eduardo <eduardo.valentin@ti.com>
*-. Merge branches 'acpi_pad', 'acpica', 'apei-bugzilla-43282', 'battery', ↵Len Brown2012-07-261-11/+17
|\ \ | | | | | | | | | 'cpuidle-coupled', 'cpuidle-tweaks', 'intel_idle-ivb', 'ost', 'red-hat-bz-772730', 'thermal', 'thermal-spear' and 'turbostat-v2' into release
| | * drivers/thermal/spear_thermal.c: add Device Tree probing capabilityViresh Kumar2012-06-021-10/+16
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | SPEAr platforms now support DT and so must convert all drivers to support DT. This patch adds DT probing support for SPEAr thermal sensor driver and updates its documentation too. Also, as SPEAr is the only user of this driver and is only available with DT, make this an only DT driver. So, platform_data is completely removed and passed via DT now. Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Vincenzo Frascino <vincenzo.frascino@st.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
| * Thermal: Make Thermal trip points writeableDurgadoss R2012-07-241-1/+1
|/ | | | | | | | | | | | Some of the thermal drivers using the Generic Thermal Framework require (all/some) trip points to be writeable. This patch makes the trip point temperatures writeable on a per-trip point basis, and modifies the required function call in thermal.c. This patch also updates the Documentation to reflect the new change. Signed-off-by: Durgadoss R <durgadoss.r@intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* thermal: spear13xx: checking for NULL instead of IS_ERR()Dan Carpenter2012-03-221-2/+2
| | | | | | | | | | | thermal_zone_device_register() never returns NULL, on error it returns and ERR_PTR(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Viresh Kumar <viresh.kumar@st.com> Reviewed-by: Vincenzo Frascino <vincenzo.frascino@st.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
* thermal/spear_thermal: replace readl/writel with lighter _relaxed variantsViresh Kumar2012-03-221-8/+8
| | | | | | | | | | readl/writel versions for ARM contain memory barrier instruction for synchronizing DMA buffers. These are not required at least on this module. So use lighter _relaxed variants. Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
* thermal: add support for thermal sensor present on SPEAr13xx machinesVincenzo Frascino2012-03-221-0/+206
ST's SPEAr13xx machines are based on CortexA9 ARM processors. These machines contain a thermal sensor for junction temperature monitoring. This patch adds support for this thermal sensor in existing thermal framework. [akpm@linux-foundation.org: little code cleanup] [akpm@linux-foundation.org: print the pointer correctly] [viresh.kumar@st.com: thermal/spear_thermal: add compilation dependency on PLAT_SPEAR] Signed-off-by: Vincenzo Frascino <vincenzo.frascino@st.com> Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>