summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/cpu_cooling.c
Commit message (Collapse)AuthorAgeFilesLines
* thermal: cpu_cooling: alignment improvementsEduardo Valentin2013-04-271-10/+9
| | | | | | | | | 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>
* thermal: cpu_cooling: remove checkpatch.pl warningEduardo Valentin2013-04-271-1/+1
| | | | | | | Simple code style fix. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* thermal: cpu_cooling: remove trailing blank lineEduardo Valentin2013-04-271-1/+0
| | | | | | | Remove unnecessary blank line. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* thermal: cpu_cooling: align on open parenthesisEduardo Valentin2013-04-271-1/+2
| | | | | | | | 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>
* thermal: cpu_cooling: standardize comment styleEduardo Valentin2013-04-271-6/+4
| | | | | | | | 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>
* thermal: cpu_cooling: standardize end of functionEduardo Valentin2013-04-271-0/+12
| | | | | | | | | | | 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>
* thermal: cpu_cooling: remove trailing white spacesEduardo Valentin2013-04-271-2/+1
| | | | | | | Remove unnecessary white spaces. Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* thermal: cpu_cooling: remove unused symbolsEduardo Valentin2013-04-251-5/+1
| | | | | | | | 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>
* thermal: cpu_cooling: remove not needed curl bracketsEduardo Valentin2013-04-251-2/+2
| | | | | | | | 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>
* thermal: cpu_cooling: use snprintf instead of sprintfEduardo Valentin2013-04-251-1/+2
| | | | | | | | | 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>
* thermal: cpu_cooling: update kernel-doc comment for cpufreq_cooling_unregisterEduardo Valentin2013-04-251-0/+2
| | | | | | | | 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>
* thermal: cpu_cooling: update kernel-doc for cpufreq_cooling_registerEduardo Valentin2013-04-251-0/+7
| | | | | | | | 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>
* thermal: cpu_cooling: update documentation for cpufreq_set_cur_stateEduardo Valentin2013-04-251-0/+5
| | | | | | | | 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>
* thermal: cpu_cooling: update documentation for cpufreq_get_cur_stateEduardo Valentin2013-04-251-0/+5
| | | | | | | | 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>
* thermal: cpu_cooling: update documentation for cpufreq_get_max_stateEduardo Valentin2013-04-251-0/+5
| | | | | | | | 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>
* thermal: cpu_cooling: update documentation for cpufreq_thermal_notifierEduardo Valentin2013-04-251-0/+6
| | | | | | | | 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>
* thermal: cpu_cooling: update documentation for cpufreq_apply_coolingEduardo Valentin2013-04-251-0/+6
| | | | | | | | 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>
* thermal: cpu_cooling: improve documentation for get_cpu_frequencyEduardo Valentin2013-04-251-1/+7
| | | | | | | | | 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>
* thermal: cpu_cooling: document cpufreq_get_cooling_levelEduardo Valentin2013-04-251-0/+11
| | | | | | | | | 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>
* thermal: cpu_cooling: add documentation for get_propertyEduardo Valentin2013-04-251-3/+11
| | | | | | | | | | 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>
* thermal: cpu_cooling: fix kernel doc for is_cpufreq_validEduardo Valentin2013-04-251-1/+7
| | | | | | | | | 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>
* thermal: cpu_cooling: remove compiler warningEduardo Valentin2013-04-251-1/+1
| | | | | | | | | | | 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>
* thermal: cpu_cooling: use EXPORT_SYMBOL_GPLEduardo Valentin2013-04-251-4/+3
| | | | | | | | 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>
* thermal: cpu_cooling: fix kernel_doc for cpufreq_cooling_deviceEduardo Valentin2013-04-251-3/+3
| | | | | | | | | | 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>
* thermal: cpu_cooling: remove unused headersEduardo Valentin2013-04-251-2/+0
| | | | | | | | 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>
* Thermal: cpufreq cooling: endian bug in cpufreq_get_max_state()Dan Carpenter2013-04-171-2/+2
| | | | | | | | | 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>
* Merge branch 'thermal' of ↵Zhang Rui2013-04-151-50/+104
|\ | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux into next Conflicts: drivers/thermal/cpu_cooling.c
| * Thermal: exynos: fix cooling state translationZhang Rui2013-03-261-0/+11
| | | | | | | | | | Signed-off-by: Zhang Rui <rui.zhang@intel.com> Tested-by: Amit Daniel kachhap <amit.daniel@samsung.com>
| * Thermal: cpufreq cooling: fix parsing per_cpu cpufreq_frequency_tableZhang Rui2013-03-261-50/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cpufreq cooling uses different frequencies as different cooling states. But the per_cpu cpufreq_frequency_table may contain duplicate, invalid entries, and it may be in either ascending or descending order. And currently, code for parsing the per_cpu cpufreq_frequency_table is used in several places and inconsistent. Now introduce new code to 1. get the maximum cooling states 2. translate cooling state to cpu frequency 3. translate cpu frequency to cooling state in one place, with the correct logic of handling per_cpu cpufreq_frequency_table. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Tested-by: Amit Daniel kachhap <amit.daniel@samsung.com>
* | drivers: thermal: cpu_cooling: fix checkpatch warningLaurent Navet [Mali]2013-03-261-5/+5
|/ | | | | | | - WARNING: Avoid CamelCase: <maskPtr> Signed-off-by: Laurent Navet <laurent.navet@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* Merge branch 'release' of ↵Linus Torvalds2013-02-281-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux Pull thermal management updates from Zhang Rui: "Highlights: - introduction of Dove thermal sensor driver. - introduction of Kirkwood thermal sensor driver. - introduction of intel_powerclamp thermal cooling device driver. - add interrupt and DT support for rcar thermal driver. - add thermal emulation support which allows platform thermal driver to do software/hardware emulation for thermal issues." * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (36 commits) thermal: rcar: remove __devinitconst thermal: return an error on failure to register thermal class Thermal: rename thermal governor Kconfig option to avoid generic naming thermal: exynos: Use the new thermal trend type for quick cooling action. Thermal: exynos: Add support for temperature falling interrupt. Thermal: Dove: Add Themal sensor support for Dove. thermal: Add support for the thermal sensor on Kirkwood SoCs thermal: rcar: add Device Tree support thermal: rcar: remove machine_power_off() from rcar_thermal_notify() thermal: rcar: add interrupt support thermal: rcar: add read/write functions for common/priv data thermal: rcar: multi channel support thermal: rcar: use mutex lock instead of spin lock thermal: rcar: enable CPCTL to use hardware TSC deciding thermal: rcar: use parenthesis on macro Thermal: fix a build warning when CONFIG_THERMAL_EMULATION cleared Thermal: fix a wrong comment thermal: sysfs: Add a new sysfs node emul_temp for thermal emulation PM: intel_powerclamp: off by one in start_power_clamp() thermal: exynos: Miscellaneous fixes to support falling threshold interrupt ...
| * Thermal: fix a wrong commentZhang Rui2013-02-061-2/+2
| | | | | | | | | | | | | | | | | | "level" parameter of get_cpu_frequency equals cooling state of cpu cooling device, and it starts from 0. Fix the misleading comment. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* | thermal: convert to idr_alloc()Tejun Heo2013-02-271-12/+5
|/ | | | | | | | | Convert to the much saner new idr interface. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* thermal: cpu cooling: use const parameter while registeringEduardo Valentin2012-11-221-1/+1
| | | | | | | | | | | | | | | | | | | | There are predefined cpu_masks that are const data structures. This patch changes the cpu cooling register function so that those const cpu_masks can be used, without compilation warnings. include/linux/cpumask.h * The following particular system cpumasks and operations manage * possible, present, active and online cpus. * * cpu_possible_mask- has bit 'cpu' set iff cpu is populatable * cpu_present_mask - has bit 'cpu' set iff cpu is populated * cpu_online_mask - has bit 'cpu' set iff cpu available to scheduler * cpu_active_mask - has bit 'cpu' set iff cpu available to migration * Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* thermal: cpu_cooling: Make 'notify_device' staticSachin Kamat2012-11-151-1/+1
| | | | | | | | | | Silences the following sparse warning: drivers/thermal/cpu_cooling.c:67:31: warning: symbol 'notify_device' was not declared. Should it be static? Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* Thermal: Remove the cooling_cpufreq_list.hongbo.zhang2012-11-071-72/+19
| | | | | | | | | | | | | Problem of using this list is that the cpufreq_get_max_state callback will be called when register cooling device by thermal_cooling_device_register, but this list isn't ready at this moment. What's more, there is no need to maintain such a list, we can get cpufreq_cooling_device instance by the private thermal_cooling_device.devdata. Signed-off-by: hongbo.zhang <hongbo.zhang@linaro.com> Reviewed-by: Francesco Lavra <francescolavra.fl@gmail.com> Reviewed-by: Amit Daniel Kachhap <amit.kachhap@linaro.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* Thermal: fix bug of counting cpu frequencies.hongbo.zhang2012-11-071-4/+6
| | | | | | | | | | | | In the while loop for counting cpu frequencies, if table[i].frequency equals CPUFREQ_ENTRY_INVALID, index i won't be increased, so this leads to an endless loop, what's more the index i cannot be referred as cpu frequencies number if there is CPUFREQ_ENTRY_INVALID case. Signed-off-by: hongbo.zhang <hongbo.zhang@linaro.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Amit Daniel Kachhap <amit.kachhap@linaro.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* Thermal: add indent for code alignment.hongbo.zhang2012-11-071-1/+1
| | | | | | | | The curly bracket should be aligned with corresponding if else statements. Signed-off-by: hongbo.zhang <hongbo.zhang@linaro.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
* Merge branch 'release' of ↵Len Brown2012-10-091-1/+1
| | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux into thermal Conflicts: drivers/staging/omap-thermal/omap-thermal-common. OMAP supplied dummy TC1 and TC2, at the same time that the thermal tree removed them from thermal_zone_device_register() drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c propogate the upstream MAX_IDR_LEVEL re-name to prevent a build failure Previously-fixed-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Len Brown <len.brown@intel.com>
* Thermal: Fix bug on cpu_cooling, cooling device's id conflict problem.Jonghwa Lee2012-09-271-2/+1
| | | | | | | | | This patch fixes small bug on cpu_cooling. CPU cooling device has own id generated with idr mathod. However in the previous version, it swapped to all same id at last stage of probing as 0. This makes id's collision and also occures error when it releases that id. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
* thermal: add generic cpufreq cooling implementationAmit Daniel Kachhap2012-09-241-0/+450
This patchset introduces a new generic cooling device based on cpufreq that can be used on non-ACPI platforms. As a proof of concept, we have drivers for the following platforms using this mechanism now: * Samsung Exynos (Exynos4 and Exynos5) in the current patchset. * Freescale i.MX (git://git.linaro.org/people/amitdanielk/linux.git imx6q_thermal) There is a small change in cpufreq cooling registration APIs, so a minor change is needed for Freescale platforms. Brief Description: 1) The generic cooling devices code is placed inside driver/thermal/* as placing inside acpi folder will need un-necessary enabling of acpi code. This code is architecture independent. 2) This patchset adds generic cpu cooling low level implementation through frequency clipping. In future, other cpu related cooling devices may be added here. An ACPI version of this already exists (drivers/acpi/processor_thermal.c) .But this will be useful for platforms like ARM using the generic thermal interface along with the generic cpu cooling devices. The cooling device registration API's return cooling device pointers which can be easily binded with the thermal zone trip points. The important APIs exposed are, a) struct thermal_cooling_device *cpufreq_cooling_register( struct cpumask *clip_cpus) b) void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) 3) Samsung exynos platform thermal implementation is done using the generic cpu cooling APIs and the new trip type. The temperature sensor driver present in the hwmon folder(registered as hwmon driver) is moved to thermal folder and registered as a thermal driver. A simple data/control flow diagrams is shown below, Core Linux thermal <-----> Exynos thermal interface <----- Temperature Sensor | | \|/ | Cpufreq cooling device <--------------- TODO: *Will send the DT enablement patches later after the driver is merged. This patch: Add support for generic cpu thermal cooling low level implementations using frequency scaling up/down based on the registration parameters. Different cpu related cooling devices can be registered by the user and the binding of these cooling devices to the corresponding trip points can be easily done as the registration APIs return the cooling device pointer. The user of these APIs are responsible for passing clipping frequency . The drivers can also register to recieve notification about any cooling action called. [akpm@linux-foundation.org: fix comment layout] Signed-off-by: Amit Daniel Kachhap <amit.kachhap@linaro.org> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Cc: SangWook Ju <sw.ju@samsung.com> Cc: Durgadoss <durgadoss.r@intel.com> Cc: Len Brown <lenb@kernel.org> Cc: Jean Delvare <khali@linux-fr.org> Cc: Kyungmin Park <kmpark@infradead.org> Cc: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Amit Daniel Kachhap <amit.daniel@samsung.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
OpenPOWER on IntegriCloud