aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/thermal/cpu-cooling-api.txt15
-rw-r--r--MAINTAINERS3
-rw-r--r--drivers/thermal/imx_thermal.c2
-rw-r--r--drivers/thermal/of-thermal.c2
-rw-r--r--drivers/thermal/rcar_thermal.c17
-rw-r--r--drivers/thermal/thermal_core.h4
6 files changed, 31 insertions, 12 deletions
diff --git a/Documentation/thermal/cpu-cooling-api.txt b/Documentation/thermal/cpu-cooling-api.txt
index fca24c931ec8..753e47cc2e20 100644
--- a/Documentation/thermal/cpu-cooling-api.txt
+++ b/Documentation/thermal/cpu-cooling-api.txt
@@ -3,7 +3,7 @@ CPU cooling APIs How To
3 3
4Written by Amit Daniel Kachhap <amit.kachhap@linaro.org> 4Written by Amit Daniel Kachhap <amit.kachhap@linaro.org>
5 5
6Updated: 12 May 2012 6Updated: 6 Jan 2015
7 7
8Copyright (c) 2012 Samsung Electronics Co., Ltd(http://www.samsung.com) 8Copyright (c) 2012 Samsung Electronics Co., Ltd(http://www.samsung.com)
9 9
@@ -25,7 +25,18 @@ the user. The registration APIs returns the cooling device pointer.
25 25
26 clip_cpus: cpumask of cpus where the frequency constraints will happen. 26 clip_cpus: cpumask of cpus where the frequency constraints will happen.
27 27
281.1.2 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) 281.1.2 struct thermal_cooling_device *of_cpufreq_cooling_register(
29 struct device_node *np, const struct cpumask *clip_cpus)
30
31 This interface function registers the cpufreq cooling device with
32 the name "thermal-cpufreq-%x" linking it with a device tree node, in
33 order to bind it via the thermal DT code. This api can support multiple
34 instances of cpufreq cooling devices.
35
36 np: pointer to the cooling device device tree node
37 clip_cpus: cpumask of cpus where the frequency constraints will happen.
38
391.1.3 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
29 40
30 This interface function unregisters the "thermal-cpufreq-%x" cooling device. 41 This interface function unregisters the "thermal-cpufreq-%x" cooling device.
31 42
diff --git a/MAINTAINERS b/MAINTAINERS
index 600d2aad8276..ab6610e6c610 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9543,7 +9543,8 @@ F: drivers/platform/x86/thinkpad_acpi.c
9543TI BANDGAP AND THERMAL DRIVER 9543TI BANDGAP AND THERMAL DRIVER
9544M: Eduardo Valentin <edubezval@gmail.com> 9544M: Eduardo Valentin <edubezval@gmail.com>
9545L: linux-pm@vger.kernel.org 9545L: linux-pm@vger.kernel.org
9546S: Supported 9546L: linux-omap@vger.kernel.org
9547S: Maintained
9547F: drivers/thermal/ti-soc-thermal/ 9548F: drivers/thermal/ti-soc-thermal/
9548 9549
9549TI CLOCK DRIVER 9550TI CLOCK DRIVER
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index c1188ac053c9..2ccbc0788353 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -608,6 +608,7 @@ static int imx_thermal_suspend(struct device *dev)
608 regmap_write(map, TEMPSENSE0 + REG_CLR, TEMPSENSE0_MEASURE_TEMP); 608 regmap_write(map, TEMPSENSE0 + REG_CLR, TEMPSENSE0_MEASURE_TEMP);
609 regmap_write(map, TEMPSENSE0 + REG_SET, TEMPSENSE0_POWER_DOWN); 609 regmap_write(map, TEMPSENSE0 + REG_SET, TEMPSENSE0_POWER_DOWN);
610 data->mode = THERMAL_DEVICE_DISABLED; 610 data->mode = THERMAL_DEVICE_DISABLED;
611 clk_disable_unprepare(data->thermal_clk);
611 612
612 return 0; 613 return 0;
613} 614}
@@ -617,6 +618,7 @@ static int imx_thermal_resume(struct device *dev)
617 struct imx_thermal_data *data = dev_get_drvdata(dev); 618 struct imx_thermal_data *data = dev_get_drvdata(dev);
618 struct regmap *map = data->tempmon; 619 struct regmap *map = data->tempmon;
619 620
621 clk_prepare_enable(data->thermal_clk);
620 /* Enabled thermal sensor after resume */ 622 /* Enabled thermal sensor after resume */
621 regmap_write(map, TEMPSENSE0 + REG_CLR, TEMPSENSE0_POWER_DOWN); 623 regmap_write(map, TEMPSENSE0 + REG_CLR, TEMPSENSE0_POWER_DOWN);
622 regmap_write(map, TEMPSENSE0 + REG_SET, TEMPSENSE0_MEASURE_TEMP); 624 regmap_write(map, TEMPSENSE0 + REG_SET, TEMPSENSE0_MEASURE_TEMP);
diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
index e145b66df444..d717f3dab6f1 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -149,7 +149,7 @@ EXPORT_SYMBOL_GPL(of_thermal_is_trip_valid);
149 * 149 *
150 * Return: pointer to trip points table, NULL otherwise 150 * Return: pointer to trip points table, NULL otherwise
151 */ 151 */
152const struct thermal_trip * const 152const struct thermal_trip *
153of_thermal_get_trip_points(struct thermal_zone_device *tz) 153of_thermal_get_trip_points(struct thermal_zone_device *tz)
154{ 154{
155 struct __thermal_zone *data = tz->devdata; 155 struct __thermal_zone *data = tz->devdata;
diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 8803e693fe68..2580a4872f90 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -63,7 +63,7 @@ struct rcar_thermal_priv {
63 struct mutex lock; 63 struct mutex lock;
64 struct list_head list; 64 struct list_head list;
65 int id; 65 int id;
66 int ctemp; 66 u32 ctemp;
67}; 67};
68 68
69#define rcar_thermal_for_each_priv(pos, common) \ 69#define rcar_thermal_for_each_priv(pos, common) \
@@ -145,7 +145,7 @@ static int rcar_thermal_update_temp(struct rcar_thermal_priv *priv)
145{ 145{
146 struct device *dev = rcar_priv_to_dev(priv); 146 struct device *dev = rcar_priv_to_dev(priv);
147 int i; 147 int i;
148 int ctemp, old, new; 148 u32 ctemp, old, new;
149 int ret = -EINVAL; 149 int ret = -EINVAL;
150 150
151 mutex_lock(&priv->lock); 151 mutex_lock(&priv->lock);
@@ -372,6 +372,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
372 int i; 372 int i;
373 int ret = -ENODEV; 373 int ret = -ENODEV;
374 int idle = IDLE_INTERVAL; 374 int idle = IDLE_INTERVAL;
375 u32 enr_bits = 0;
375 376
376 common = devm_kzalloc(dev, sizeof(*common), GFP_KERNEL); 377 common = devm_kzalloc(dev, sizeof(*common), GFP_KERNEL);
377 if (!common) 378 if (!common)
@@ -390,7 +391,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
390 391
391 /* 392 /*
392 * platform has IRQ support. 393 * platform has IRQ support.
393 * Then, drier use common register 394 * Then, driver uses common registers
394 */ 395 */
395 396
396 ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0, 397 ret = devm_request_irq(dev, irq->start, rcar_thermal_irq, 0,
@@ -408,9 +409,6 @@ static int rcar_thermal_probe(struct platform_device *pdev)
408 if (IS_ERR(common->base)) 409 if (IS_ERR(common->base))
409 return PTR_ERR(common->base); 410 return PTR_ERR(common->base);
410 411
411 /* enable temperature comparation */
412 rcar_thermal_common_write(common, ENR, 0x00030303);
413
414 idle = 0; /* polling delay is not needed */ 412 idle = 0; /* polling delay is not needed */
415 } 413 }
416 414
@@ -452,8 +450,15 @@ static int rcar_thermal_probe(struct platform_device *pdev)
452 rcar_thermal_irq_enable(priv); 450 rcar_thermal_irq_enable(priv);
453 451
454 list_move_tail(&priv->list, &common->head); 452 list_move_tail(&priv->list, &common->head);
453
454 /* update ENR bits */
455 enr_bits |= 3 << (i * 8);
455 } 456 }
456 457
458 /* enable temperature comparation */
459 if (irq)
460 rcar_thermal_common_write(common, ENR, enr_bits);
461
457 platform_set_drvdata(pdev, common); 462 platform_set_drvdata(pdev, common);
458 463
459 dev_info(dev, "%d sensor probed\n", i); 464 dev_info(dev, "%d sensor probed\n", i);
diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index 9083e7520623..0531c752fbbb 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -91,7 +91,7 @@ int of_parse_thermal_zones(void);
91void of_thermal_destroy_zones(void); 91void of_thermal_destroy_zones(void);
92int of_thermal_get_ntrips(struct thermal_zone_device *); 92int of_thermal_get_ntrips(struct thermal_zone_device *);
93bool of_thermal_is_trip_valid(struct thermal_zone_device *, int); 93bool of_thermal_is_trip_valid(struct thermal_zone_device *, int);
94const struct thermal_trip * const 94const struct thermal_trip *
95of_thermal_get_trip_points(struct thermal_zone_device *); 95of_thermal_get_trip_points(struct thermal_zone_device *);
96#else 96#else
97static inline int of_parse_thermal_zones(void) { return 0; } 97static inline int of_parse_thermal_zones(void) { return 0; }
@@ -105,7 +105,7 @@ static inline bool of_thermal_is_trip_valid(struct thermal_zone_device *tz,
105{ 105{
106 return 0; 106 return 0;
107} 107}
108static inline const struct thermal_trip * const 108static inline const struct thermal_trip *
109of_thermal_get_trip_points(struct thermal_zone_device *tz) 109of_thermal_get_trip_points(struct thermal_zone_device *tz)
110{ 110{
111 return NULL; 111 return NULL;