Commit Graph

228 Commits

Author SHA1 Message Date
Wolfram Sang b948cc6161 drivers/thermal: don't check resource with devm_ioremap_resource
devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2013-05-18 11:57:30 +02:00
Zhang Rui 8f578bfefd Merge branch 'cpu_cooling-doc-comments-update' of .git into next 2013-04-27 09:28:56 +08:00
Eduardo Valentin 70d23b29e4 thermal: db8500_cpufreq_cooling: remove usage of IS_ERR_OR_NULL()
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).

The case present in this driver can be translated to a simple
check for IS_ERR(), as the cpufreq_cooling_register() returns
either a valid pointer or an ERR_PTR().

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Hongbo Zhang <hongbo.zhang@stericsson.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>
Acked-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-27 09:28:38 +08:00
Eduardo Valentin 9b19ec39b0 thermal: thermal_core: remove usage of IS_ERR_OR_NULL
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).

The case present in this patch has simply be translated to
normal check for NULL and if the pointer has an error code.
The later case is needed because functions like
thermal_zone_get_zone_by_name() could return an ERR_PTR().

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Russell King <rmk@arm.linux.org.uk>
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-04-27 09:28:25 +08:00
Eduardo Valentin 5fda7f680a thermal: cpu_cooling: alignment improvements
Improve code readiness by changing alignments so that
they match open parenthesis, like checkpatch.pl --strict
suggests.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-27 09:25:55 +08:00
Eduardo Valentin ef5e2124ec thermal: cpu_cooling: remove checkpatch.pl warning
Simple code style fix.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-27 09:25:51 +08:00
Eduardo Valentin e45a643002 thermal: cpu_cooling: remove trailing blank line
Remove unnecessary blank line.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-27 09:25:47 +08:00
Eduardo Valentin d8892a01b1 thermal: cpu_cooling: align on open parenthesis
Improve code readiness by remove checkpatch.pl warnings
on get_property function.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-27 09:25:43 +08:00
Eduardo Valentin 1b9e352659 thermal: cpu_cooling: standardize comment style
There are at least three patterns for oneline comments in this
file. This patch changes them to one single pattern

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-27 09:25:38 +08:00
Eduardo Valentin 79491e53dc thermal: cpu_cooling: standardize end of function
Just for code readiness, this patch makes all functions
on this file to have a blank line before their returns.
Now, some functions follow this pattern, and others will
not have a blank line. So, this patch makes it a single
pattern.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-27 09:25:32 +08:00
Eduardo Valentin 79d264016a thermal: cpu_cooling: remove trailing white spaces
Remove unnecessary white spaces.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-27 09:25:24 +08:00
Zhang Rui 07273d25b8 Merge branch 'cpu_cooling-doc-comments-update' of .git into next 2013-04-25 00:57:37 +08:00
Zhang Rui eea2d4812d Merge branch 'thermal_core-doc-comments-update' of .git into next 2013-04-25 00:57:22 +08:00
Eduardo Valentin a00e55f9c8 thermal: update kernel-doc for thermal_zone_device_register
This patch updates the documentation for thermal_zone_device_register
and removes the warnings generated by scripts/kernel-doc -v.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:56:39 +08:00
Eduardo Valentin 269c174f27 thermal: update kernel-doc for create_trip_attrs
This patch updates the documentation for create_trip_attrs
and removes the warnings generated by scripts/kernel-doc -v.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:56:35 +08:00
Eduardo Valentin 3a6eccb352 thermal: update kernel-doc for thermal_cooling_device_register
This patch updates the documentation for thermal_cooling_device_register
and removes the warnings generated by scripts/kernel-doc -v.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:56:32 +08:00
Eduardo Valentin 9892e5dc56 thermal: update kernel-doc for thermal_zone_unbind_cooling_device
This patch updates the documentation for thermal_zone_unbind_cooling_device
and removes the warnings generated by scripts/kernel-doc -v.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:56:28 +08:00
Eduardo Valentin d2e4eb83e7 thermal: update kernel-doc for thermal_zone_bind_cooling_device
This patch updates the documentation for thermal_zone_bind_cooling_device
and removes the warnings generated by scripts/kernel-doc -v.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:56:24 +08:00
Eduardo Valentin 910cb1e34d thermal: use EXPORT_SYMBOL_GPL
Restrict usage of GPL modules.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:56:19 +08:00
Eduardo Valentin 7b73c99377 thermal: rename notify_thermal_framework to thermal_notify_framework
To follow the prefix names used by the thermal functions,
this patch renames notify_thermal_framework to thermal_notify_framework.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:56:16 +08:00
Eduardo Valentin 6d8d4974a2 thermal: update driver license
As per the comment at the top of this file, this is a GPLv2 driver.
This patch updates the driver license accordingly.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:56:12 +08:00
Eduardo Valentin c7a8b9d916 thermal: use strlcpy instead of strcpy
For memory boundaries safety, use strlcpy instead of strcpy.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:56:07 +08:00
Eduardo Valentin 67d0b2a826 thermal: cpu_cooling: remove unused symbols
The list is not needed so far. Thus removing it.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:44 +08:00
Eduardo Valentin 2d9bf71c12 thermal: cpu_cooling: remove not needed curl brackets
Just for style purposes, remove extra curl brackets.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:43 +08:00
Eduardo Valentin 99871a714b thermal: cpu_cooling: use snprintf instead of sprintf
Limit the amount of bytes written to dev_name by
secure writing with snprintf.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:43 +08:00
Eduardo Valentin 135266b4ea thermal: cpu_cooling: update kernel-doc comment for cpufreq_cooling_unregister
Update comments for this exported function.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:42 +08:00
Eduardo Valentin 12cb08ba50 thermal: cpu_cooling: update kernel-doc for cpufreq_cooling_register
Add proper documentation for exported function cpufreq_cooling_register.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:42 +08:00
Eduardo Valentin 56e05fdb6d thermal: cpu_cooling: update documentation for cpufreq_set_cur_state
Update documentation for cpufreq_set_cur_state callback.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:42 +08:00
Eduardo Valentin 3672552dc0 thermal: cpu_cooling: update documentation for cpufreq_get_cur_state
Update documentation for cpufreq_get_cur_state callback.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:41 +08:00
Eduardo Valentin 62c00421b3 thermal: cpu_cooling: update documentation for cpufreq_get_max_state
Update documentation for cpufreq_get_max_state callback.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:41 +08:00
Eduardo Valentin f7188b3dde thermal: cpu_cooling: update Kconfig entry
There is no support for hotplug or any other means of reducing
temperature. So, this patch removes these references from Kconfig.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:40 +08:00
Eduardo Valentin bab3055472 thermal: cpu_cooling: update documentation for cpufreq_thermal_notifier
Update kernel-doc comment and documentation for cpufreq_thermal_notifier.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:40 +08:00
Eduardo Valentin 4b33deb547 thermal: cpu_cooling: update documentation for cpufreq_apply_cooling
Update kernel-doc comments for cpufreq_apply_cooling function.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:39 +08:00
Eduardo Valentin 41518c41dd thermal: cpu_cooling: improve documentation for get_cpu_frequency
Fix kernel-doc warning on get_cpu_frequency and improve
documentation comments.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:39 +08:00
Eduardo Valentin 44952d338a thermal: cpu_cooling: document cpufreq_get_cooling_level
Add documentation for cpufreq_get_cooling_level. As this
is an exported function, it has to be documented.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:38 +08:00
Eduardo Valentin 2d6f28fedc thermal: cpu_cooling: add documentation for get_property
As this is one of the central functions of this file,
it deserves a proper documentation. This patch improves
the existing comment to format it as a kernel-doc style.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:38 +08:00
Eduardo Valentin 82b9ee402f thermal: cpu_cooling: fix kernel doc for is_cpufreq_valid
Update documentation for is_cpufreq_valid function so
that kernel-doc does not complain about return value.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:38 +08:00
Eduardo Valentin 4469b99743 thermal: cpu_cooling: remove compiler warning
level will be used only if GET_FREQ mode is requested.
There is no potential harm with current code. But for
cleaning the compilation log, this patch initializes
level to zero.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:37 +08:00
Eduardo Valentin 243dbd9c60 thermal: cpu_cooling: use EXPORT_SYMBOL_GPL
Restrict the usage to GPL modules.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:37 +08:00
Eduardo Valentin 3b3c074855 thermal: cpu_cooling: fix kernel_doc for cpufreq_cooling_device
Simple fixes for making kernel_doc happy about
struct cpufreq_cooling_device. Includes also a minor
spelling fix.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:34:36 +08:00
Eduardo Valentin 25c52afe1c thermal: cpu_cooling: remove unused headers
Remove some unused header files.

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-25 00:33:58 +08:00
Zhang Rui a502be1873 Merge branch 'exynos-fix' of .git into next 2013-04-25 00:04:06 +08:00
Sachin Kamat b6cee53c19 Thermal: exynos: Add compatible string for exynos4412
Added compatible string for Exynos4412 SoC.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-24 23:37:34 +08:00
Sachin Kamat 2a16279c68 Thermal: exynos: Add clk_{un}prepare APIs
clk_{un}prepare APIs are required to migrate to common
clock framework. While at it convert to use devm_clk_get as
it removes some cleanup code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Amit Daniel Kachhap <amit.daniel@samsung.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-24 23:37:19 +08:00
Zhang Rui 335553ce40 Merge branch 'eduardo-1' of .git into next 2013-04-24 21:43:00 +08:00
Dan Carpenter 4f89038f17 Thermal: cpufreq cooling: endian bug in cpufreq_get_max_state()
This code doesn't work on big endian systems because we're storing low
values in the high bits of the unsigned long.  It makes it a very high
value instead.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-17 23:43:31 +08:00
Eduardo Valentin 837b26bb2e thermal: expose thermal_zone_get_temp API
This patch exports the thermal_zone_get_temp API so that driver
writers can fetch temperature of thermal zones managed by other
drivers.

Acked-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-15 09:39:02 +08:00
Eduardo Valentin 63c4d919cf thermal: introduce thermal_zone_get_zone_by_name helper function
This patch adds a helper function to get a reference of
a thermal zone, based on the zone type name.

It will perform a zone name lookup and return a reference
to a thermal zone device that matches the name requested.
In case the zone is not found or when several zones match
same name or if the required parameters are invalid, it will return
the corresponding error code (ERR_PTR).

Cc: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-04-15 09:34:28 +08:00
Zhang Rui d13cb03aef Merge branch 'thermal' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux into next
Conflicts:
	drivers/thermal/cpu_cooling.c
2013-04-15 09:26:58 +08:00
Zhang Rui bbf7fc88c7 Thermal: build cpu_cooling code into thermal_sys module
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>
Acked-by: Durgadoss R <durgadoss.r@intel.com>
2013-04-14 23:28:49 +08:00