aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-24 20:13:49 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-24 20:13:49 -0500
commit91466574be1a3701fab4abf5ac1539b556575a81 (patch)
tree89373ef6b0c9e024a9688207b832552dfbcca666 /drivers/cpufreq
parent09da8dfa98682d871987145ed11e3232accac860 (diff)
parentc698a4492f01127ca90fc28cd5157f3d616fe4ff (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Pull thermal management updates from Zhang Rui: "This time, the biggest change is the work of representing hardware thermal properties in device tree infrastructure. This work includes the introduction of a device tree bindings for describing the hardware thermal behavior and limits, and also a parser to read and interpret the data, and build thermal zones and thermal binding parameters. It also contains three examples on how to use the new representation on sensor devices, using three different drivers to accomplish it. One driver is in thermal subsystem, the TI SoC thermal, and the other two drivers are in hwmon subsystem. Actually, this would be the first step of the complete work because we still need to check other potential drivers to be converted and then validate the proposed API. But the reason why I include it in this pull request is that, first, this change does not hurt any others without using this approach, second, the principle and concept of this change would not break after converting the remaining drivers. BTW, as you can see, there are several points in this change that do not belong to thermal subsystem. Because it has been suggested by Guenter R that in such cases, it is recommended to send the complete series via one single subsystem. Specifics: - representing hardware thermal properties in device tree infrastructure - fix a regression that the imx thermal driver breaks system suspend. - introduce ACPI INT3403 thermal driver to retrieve temperature data from the INT3403 ACPI device object present on some systems. - introduce debug statement for thermal core and step_wise governor. - assorted fixes and cleanups for thermal core, cpu cooling, exynos thrmal, intel powerclamp and imx thermal driver" * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (34 commits) thermal: remove const flag from .ops of imx thermal Thermal: update thermal zone device after setting emul_temp intel_powerclamp: Fix cstate counter detection. thermal: imx: add necessary clk operation Thermal cpu cooling: return error if no valid cpu frequency entry thermal: fix cpu_cooling max_level behavior thermal: rcar-thermal: Enable driver compilation with COMPILE_TEST thermal: debug: add debug statement for core and step_wise thermal: imx_thermal: add module device table drivers: thermal: Mark function as static in x86_pkg_temp_thermal.c thermal:samsung: fix compilation warning thermal: imx: correct suspend/resume flow thermal: exynos: fix error return code Thermal: ACPI INT3403 thermal driver MAINTAINERS: add thermal bindings entry in thermal domain arm: dts: make OMAP4460 bandgap node to belong to OCP arm: dts: make OMAP443x bandgap node to belong to OCP arm: dts: add cooling properties on omap5 cpu node arm: dts: add omap5 thermal data arm: dts: add omap5 CORE thermal data ...
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/Kconfig2
-rw-r--r--drivers/cpufreq/cpufreq-cpu0.c16
2 files changed, 17 insertions, 1 deletions
diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
index d100926aca0a..4b029c0944af 100644
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -185,7 +185,7 @@ config CPU_FREQ_GOV_CONSERVATIVE
185 185
186config GENERIC_CPUFREQ_CPU0 186config GENERIC_CPUFREQ_CPU0
187 tristate "Generic CPU0 cpufreq driver" 187 tristate "Generic CPU0 cpufreq driver"
188 depends on HAVE_CLK && REGULATOR && OF 188 depends on HAVE_CLK && REGULATOR && OF && THERMAL && CPU_THERMAL
189 select PM_OPP 189 select PM_OPP
190 help 190 help
191 This adds a generic cpufreq driver for CPU0 frequency management. 191 This adds a generic cpufreq driver for CPU0 frequency management.
diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
index bb7b3082efb3..0c12ffc0ebcb 100644
--- a/drivers/cpufreq/cpufreq-cpu0.c
+++ b/drivers/cpufreq/cpufreq-cpu0.c
@@ -13,7 +13,9 @@
13 13
14#include <linux/clk.h> 14#include <linux/clk.h>
15#include <linux/cpu.h> 15#include <linux/cpu.h>
16#include <linux/cpu_cooling.h>
16#include <linux/cpufreq.h> 17#include <linux/cpufreq.h>
18#include <linux/cpumask.h>
17#include <linux/err.h> 19#include <linux/err.h>
18#include <linux/module.h> 20#include <linux/module.h>
19#include <linux/of.h> 21#include <linux/of.h>
@@ -21,6 +23,7 @@
21#include <linux/platform_device.h> 23#include <linux/platform_device.h>
22#include <linux/regulator/consumer.h> 24#include <linux/regulator/consumer.h>
23#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/thermal.h>
24 27
25static unsigned int transition_latency; 28static unsigned int transition_latency;
26static unsigned int voltage_tolerance; /* in percentage */ 29static unsigned int voltage_tolerance; /* in percentage */
@@ -29,6 +32,7 @@ static struct device *cpu_dev;
29static struct clk *cpu_clk; 32static struct clk *cpu_clk;
30static struct regulator *cpu_reg; 33static struct regulator *cpu_reg;
31static struct cpufreq_frequency_table *freq_table; 34static struct cpufreq_frequency_table *freq_table;
35static struct thermal_cooling_device *cdev;
32 36
33static int cpu0_set_target(struct cpufreq_policy *policy, unsigned int index) 37static int cpu0_set_target(struct cpufreq_policy *policy, unsigned int index)
34{ 38{
@@ -197,6 +201,17 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
197 goto out_free_table; 201 goto out_free_table;
198 } 202 }
199 203
204 /*
205 * For now, just loading the cooling device;
206 * thermal DT code takes care of matching them.
207 */
208 if (of_find_property(np, "#cooling-cells", NULL)) {
209 cdev = of_cpufreq_cooling_register(np, cpu_present_mask);
210 if (IS_ERR(cdev))
211 pr_err("running cpufreq without cooling device: %ld\n",
212 PTR_ERR(cdev));
213 }
214
200 of_node_put(np); 215 of_node_put(np);
201 return 0; 216 return 0;
202 217
@@ -209,6 +224,7 @@ out_put_node:
209 224
210static int cpu0_cpufreq_remove(struct platform_device *pdev) 225static int cpu0_cpufreq_remove(struct platform_device *pdev)
211{ 226{
227 cpufreq_cooling_unregister(cdev);
212 cpufreq_unregister_driver(&cpu0_cpufreq_driver); 228 cpufreq_unregister_driver(&cpu0_cpufreq_driver);
213 dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table); 229 dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
214 230