linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 03/19] drivers: thermal: make usage of CONFIG_THERMAL_HWMON optional
       [not found] <1395744572-20014-1-git-send-email-alex.shi@linaro.org>
@ 2014-03-25 10:49 ` Alex Shi
  2014-03-25 10:49 ` [PATCH 09/19] arm: dts: add omap4 CPU thermal data Alex Shi
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Alex Shi @ 2014-03-25 10:49 UTC (permalink / raw)
  To: linux-arm-kernel

From: Eduardo Valentin <eduardo.valentin@ti.com>

When registering a new thermal_device, the thermal framework
will always add a hwmon sysfs interface.

This patch adds a flag to make this behavior optional. Now
when registering a new thermal device, the caller can
optionally inform if hwmon interface is desirable. This can
be done by means of passing a thermal_zone_params.no_hwmon == true.

In order to keep same behavior as of today, all current
calls will by default create the hwmon interface.

Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-acpi at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
Cc: linux-pm at vger.kernel.org
Cc: Zhang Rui <rui.zhang@intel.com>
Suggested-by: Wei Ni <wni@nvidia.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
(cherry picked from commit ccba4ffd9eff6120a20cc7656458ac554aec4b0c)

Signed-off-by: Alex Shi <alex.shi@linaro.org>
---
 Documentation/thermal/sysfs-api.txt | 5 +++++
 drivers/thermal/thermal_core.c      | 8 +++++---
 include/linux/thermal.h             | 8 ++++++++
 3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt
index a71bd5b..37c5486 100644
--- a/Documentation/thermal/sysfs-api.txt
+++ b/Documentation/thermal/sysfs-api.txt
@@ -142,6 +142,11 @@ temperature) and throttle appropriate devices.
     This is an optional feature where some platforms can choose not to
     provide this data.
     .governor_name: Name of the thermal governor used for this zone
+    .no_hwmon: a boolean to indicate if the thermal to hwmon sysfs interface
+               is required. when no_hwmon == false, a hwmon sysfs interface
+               will be created. when no_hwmon == true, nothing will be done.
+               In case the thermal_zone_params is NULL, the hwmon interface
+               will be created (for backward compatibility).
     .num_tbps: Number of thermal_bind_params entries for this zone
     .tbp: thermal_bind_params entries
 
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index a3d1976..4f4b788 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -1460,9 +1460,11 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
 
 	mutex_unlock(&thermal_governor_lock);
 
-	result = thermal_add_hwmon_sysfs(tz);
-	if (result)
-		goto unregister;
+	if (!tz->tzp || !tz->tzp->no_hwmon) {
+		result = thermal_add_hwmon_sysfs(tz);
+		if (result)
+			goto unregister;
+	}
 
 	mutex_lock(&thermal_list_lock);
 	list_add_tail(&tz->node, &thermal_tz_list);
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index a386a1c..b4a975f 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -214,6 +214,14 @@ struct thermal_bind_params {
 /* Structure to define Thermal Zone parameters */
 struct thermal_zone_params {
 	char governor_name[THERMAL_NAME_LENGTH];
+
+	/*
+	 * a boolean to indicate if the thermal to hwmon sysfs interface
+	 * is required. when no_hwmon == false, a hwmon sysfs interface
+	 * will be created. when no_hwmon == true, nothing will be done
+	 */
+	bool no_hwmon;
+
 	int num_tbps;	/* Number of tbp entries */
 	struct thermal_bind_params *tbp;
 };
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 09/19] arm: dts: add omap4 CPU thermal data
       [not found] <1395744572-20014-1-git-send-email-alex.shi@linaro.org>
  2014-03-25 10:49 ` [PATCH 03/19] drivers: thermal: make usage of CONFIG_THERMAL_HWMON optional Alex Shi
@ 2014-03-25 10:49 ` Alex Shi
  2014-03-25 10:49 ` [PATCH 10/19] arm: dts: add cooling properties on omap4430 cpu node Alex Shi
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Alex Shi @ 2014-03-25 10:49 UTC (permalink / raw)
  To: linux-arm-kernel

From: Eduardo Valentin <eduardo.valentin@ti.com>

This patch changes a dtsi file to contain the thermal data
for MPU domain on OMAP4 and later SoCs. This data will
enable the passive cooling with CPUfreq cooling device
at 100C and the system will do a thermal shutdown at 125C.

This thermal data can be reused across TI SoC devices.

Cc: "Beno?t Cousson" <bcousson@baylibre.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-omap at vger.kernel.org
Cc: devicetree at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
(cherry picked from commit 0bbf6c54d100836db40ba020b7c9793ea3e6be0b)

Signed-off-by: Alex Shi <alex.shi@linaro.org>
---
 arch/arm/boot/dts/omap4-cpu-thermal.dtsi | 41 ++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap4-cpu-thermal.dtsi

diff --git a/arch/arm/boot/dts/omap4-cpu-thermal.dtsi b/arch/arm/boot/dts/omap4-cpu-thermal.dtsi
new file mode 100644
index 0000000..cb9458f
--- /dev/null
+++ b/arch/arm/boot/dts/omap4-cpu-thermal.dtsi
@@ -0,0 +1,41 @@
+/*
+ * Device Tree Source for OMAP4/5 SoC CPU thermal
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ * Contact: Eduardo Valentin <eduardo.valentin@ti.com>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include <dt-bindings/thermal/thermal.h>
+
+cpu_thermal: cpu_thermal {
+	polling-delay-passive = <250>; /* milliseconds */
+	polling-delay = <1000>; /* milliseconds */
+
+			/* sensor       ID */
+        thermal-sensors = <&bandgap     0>;
+
+        trips {
+                cpu_alert0: cpu_alert {
+                        temperature = <100000>; /* millicelsius */
+                        hysteresis = <2000>; /* millicelsius */
+                        type = "passive";
+                };
+                cpu_crit: cpu_crit {
+                        temperature = <125000>; /* millicelsius */
+                        hysteresis = <2000>; /* millicelsius */
+                        type = "critical";
+                };
+        };
+
+	cooling-maps {
+		map0 {
+			trip = <&cpu_alert0>;
+			cooling-device =
+				<&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+		};
+	};
+};
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 10/19] arm: dts: add cooling properties on omap4430 cpu node
       [not found] <1395744572-20014-1-git-send-email-alex.shi@linaro.org>
  2014-03-25 10:49 ` [PATCH 03/19] drivers: thermal: make usage of CONFIG_THERMAL_HWMON optional Alex Shi
  2014-03-25 10:49 ` [PATCH 09/19] arm: dts: add omap4 CPU thermal data Alex Shi
@ 2014-03-25 10:49 ` Alex Shi
  2014-05-06 15:20   ` Tony Lindgren
  2014-03-25 10:49 ` [PATCH 11/19] arm: dts: add cooling properties on omap4460 " Alex Shi
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 7+ messages in thread
From: Alex Shi @ 2014-03-25 10:49 UTC (permalink / raw)
  To: linux-arm-kernel

From: Eduardo Valentin <eduardo.valentin@ti.com>

OMAP4430 devices can reach high temperatures and thus
needs to have cpufreq-cooling on systems running on it.

This patch adds the required cooling device properties
so that cpufreq-cpu0 driver loads the cooling device.

Cc: "Beno?t Cousson" <bcousson@baylibre.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-omap at vger.kernel.org
Cc: devicetree-discuss at lists.ozlabs.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
(cherry picked from commit 72af5e6d0c3e01655c1c1fc7c7ca94a2b663611e)

Signed-off-by: Alex Shi <alex.shi@linaro.org>
---
 arch/arm/boot/dts/omap443x.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
index cccf39a..d2deba0 100644
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -22,6 +22,11 @@
 				1008000 1375000
 			>;
 			clock-latency = <300000>; /* From legacy driver */
+
+			/* cooling options */
+			cooling-min-level = <0>;
+			cooling-max-level = <3>;
+			#cooling-cells = <2>; /* min followed by max */
 		};
 	};
 };
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 11/19] arm: dts: add cooling properties on omap4460 cpu node
       [not found] <1395744572-20014-1-git-send-email-alex.shi@linaro.org>
                   ` (2 preceding siblings ...)
  2014-03-25 10:49 ` [PATCH 10/19] arm: dts: add cooling properties on omap4430 cpu node Alex Shi
@ 2014-03-25 10:49 ` Alex Shi
  2014-03-25 10:49 ` [PATCH 12/19] arm: dts: add omap5 GPU thermal data Alex Shi
  2014-03-25 10:49 ` [PATCH 13/19] arm: dts: add omap5 CORE " Alex Shi
  5 siblings, 0 replies; 7+ messages in thread
From: Alex Shi @ 2014-03-25 10:49 UTC (permalink / raw)
  To: linux-arm-kernel

From: Eduardo Valentin <eduardo.valentin@ti.com>

OMAP4460 devices can reach high temperatures and thus
needs to have cpufreq-cooling on systems running on it.

This patch adds the required cooling device properties
so that cpufreq-cpu0 driver loads the cooling device.

Cc: "Beno?t Cousson" <bcousson@baylibre.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-omap at vger.kernel.org
Cc: devicetree at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
(cherry picked from commit 616a66351d6cd4a9bdb20fe49ee2505d9cc8a0db)

Signed-off-by: Alex Shi <alex.shi@linaro.org>
---
 arch/arm/boot/dts/omap4460.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/omap4460.dtsi b/arch/arm/boot/dts/omap4460.dtsi
index 2cf227c..e21fc05 100644
--- a/arch/arm/boot/dts/omap4460.dtsi
+++ b/arch/arm/boot/dts/omap4460.dtsi
@@ -20,6 +20,11 @@
 				920000  1313000
 			>;
 			clock-latency = <300000>; /* From legacy driver */
+
+			/* cooling options */
+			cooling-min-level = <0>;
+			cooling-max-level = <2>;
+			#cooling-cells = <2>; /* min followed by max */
 		};
 	};
 
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 12/19] arm: dts: add omap5 GPU thermal data
       [not found] <1395744572-20014-1-git-send-email-alex.shi@linaro.org>
                   ` (3 preceding siblings ...)
  2014-03-25 10:49 ` [PATCH 11/19] arm: dts: add cooling properties on omap4460 " Alex Shi
@ 2014-03-25 10:49 ` Alex Shi
  2014-03-25 10:49 ` [PATCH 13/19] arm: dts: add omap5 CORE " Alex Shi
  5 siblings, 0 replies; 7+ messages in thread
From: Alex Shi @ 2014-03-25 10:49 UTC (permalink / raw)
  To: linux-arm-kernel

From: Eduardo Valentin <eduardo.valentin@ti.com>

This patch changes a dtsi file to contain the thermal data
for GPU domain on OMAP5 and later SoCs. This data will
enable a thermal shutdown at 125C.

This thermal data can be reused across TI SoC devices.

Cc: "Beno?t Cousson" <bcousson@baylibre.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-omap at vger.kernel.org
Cc: devicetree at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
(cherry picked from commit 28c90169f1d5eabf503e356c76bf49a67aef4cc0)

Signed-off-by: Alex Shi <alex.shi@linaro.org>
---
 arch/arm/boot/dts/omap5-gpu-thermal.dtsi | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap5-gpu-thermal.dtsi

diff --git a/arch/arm/boot/dts/omap5-gpu-thermal.dtsi b/arch/arm/boot/dts/omap5-gpu-thermal.dtsi
new file mode 100644
index 0000000..1b87aca
--- /dev/null
+++ b/arch/arm/boot/dts/omap5-gpu-thermal.dtsi
@@ -0,0 +1,28 @@
+/*
+ * Device Tree Source for OMAP543x SoC GPU thermal
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ * Contact: Eduardo Valentin <eduardo.valentin@ti.com>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include <dt-bindings/thermal/thermal.h>
+
+gpu_thermal: gpu_thermal {
+	polling-delay-passive = <250>; /* milliseconds */
+	polling-delay = <1000>; /* milliseconds */
+
+			/* sensor       ID */
+	thermal-sensors = <&bandgap     1>;
+
+	trips {
+		gpu_crit: gpu_crit {
+			temperature = <125000>; /* milliCelsius */
+			hysteresis = <2000>; /* milliCelsius */
+			type = "critical";
+		};
+	};
+};
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 13/19] arm: dts: add omap5 CORE thermal data
       [not found] <1395744572-20014-1-git-send-email-alex.shi@linaro.org>
                   ` (4 preceding siblings ...)
  2014-03-25 10:49 ` [PATCH 12/19] arm: dts: add omap5 GPU thermal data Alex Shi
@ 2014-03-25 10:49 ` Alex Shi
  5 siblings, 0 replies; 7+ messages in thread
From: Alex Shi @ 2014-03-25 10:49 UTC (permalink / raw)
  To: linux-arm-kernel

From: Eduardo Valentin <eduardo.valentin@ti.com>

This patch changes a dtsi file to contain the thermal data
for CORE domain on OMAP5 and later SoCs. This data will
enable a thermal shutdown at 125C.

This thermal data can be reused across TI SoC devices.

Cc: "Beno?t Cousson" <bcousson@baylibre.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: linux-omap at vger.kernel.org
Cc: devicetree at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
(cherry picked from commit dcb5004fceeb15f0fdfc4a2b8cd68c6ad515a80b)

Signed-off-by: Alex Shi <alex.shi@linaro.org>
---
 arch/arm/boot/dts/omap5-core-thermal.dtsi | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 arch/arm/boot/dts/omap5-core-thermal.dtsi

diff --git a/arch/arm/boot/dts/omap5-core-thermal.dtsi b/arch/arm/boot/dts/omap5-core-thermal.dtsi
new file mode 100644
index 0000000..19212ac
--- /dev/null
+++ b/arch/arm/boot/dts/omap5-core-thermal.dtsi
@@ -0,0 +1,28 @@
+/*
+ * Device Tree Source for OMAP543x SoC CORE thermal
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ * Contact: Eduardo Valentin <eduardo.valentin@ti.com>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include <dt-bindings/thermal/thermal.h>
+
+core_thermal: core_thermal {
+	polling-delay-passive = <250>; /* milliseconds */
+	polling-delay = <1000>; /* milliseconds */
+
+			/* sensor       ID */
+	thermal-sensors = <&bandgap     2>;
+
+	trips {
+		core_crit: core_crit {
+			temperature = <125000>; /* milliCelsius */
+			hysteresis = <2000>; /* milliCelsius */
+			type = "critical";
+		};
+	};
+};
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 10/19] arm: dts: add cooling properties on omap4430 cpu node
  2014-03-25 10:49 ` [PATCH 10/19] arm: dts: add cooling properties on omap4430 cpu node Alex Shi
@ 2014-05-06 15:20   ` Tony Lindgren
  0 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2014-05-06 15:20 UTC (permalink / raw)
  To: linux-arm-kernel

* Alex Shi <alex.shi@linaro.org> [140325 03:54]:
> From: Eduardo Valentin <eduardo.valentin@ti.com>
> 
> OMAP4430 devices can reach high temperatures and thus
> needs to have cpufreq-cooling on systems running on it.
> 
> This patch adds the required cooling device properties
> so that cpufreq-cpu0 driver loads the cooling device.

Alex, what's the status of this series? I could not find
the complete thread, so wondering what to do with patches
09 - 13?

Regards,

Tony
 
> Cc: "Beno?t Cousson" <bcousson@baylibre.com>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Russell King <linux@arm.linux.org.uk>
> Cc: linux-omap at vger.kernel.org
> Cc: devicetree-discuss at lists.ozlabs.org
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-kernel at vger.kernel.org
> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
> (cherry picked from commit 72af5e6d0c3e01655c1c1fc7c7ca94a2b663611e)
> 
> Signed-off-by: Alex Shi <alex.shi@linaro.org>
> ---
>  arch/arm/boot/dts/omap443x.dtsi | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
> index cccf39a..d2deba0 100644
> --- a/arch/arm/boot/dts/omap443x.dtsi
> +++ b/arch/arm/boot/dts/omap443x.dtsi
> @@ -22,6 +22,11 @@
>  				1008000 1375000
>  			>;
>  			clock-latency = <300000>; /* From legacy driver */
> +
> +			/* cooling options */
> +			cooling-min-level = <0>;
> +			cooling-max-level = <3>;
> +			#cooling-cells = <2>; /* min followed by max */
>  		};
>  	};
>  };
> -- 
> 1.8.1.2
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-05-06 15:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1395744572-20014-1-git-send-email-alex.shi@linaro.org>
2014-03-25 10:49 ` [PATCH 03/19] drivers: thermal: make usage of CONFIG_THERMAL_HWMON optional Alex Shi
2014-03-25 10:49 ` [PATCH 09/19] arm: dts: add omap4 CPU thermal data Alex Shi
2014-03-25 10:49 ` [PATCH 10/19] arm: dts: add cooling properties on omap4430 cpu node Alex Shi
2014-05-06 15:20   ` Tony Lindgren
2014-03-25 10:49 ` [PATCH 11/19] arm: dts: add cooling properties on omap4460 " Alex Shi
2014-03-25 10:49 ` [PATCH 12/19] arm: dts: add omap5 GPU thermal data Alex Shi
2014-03-25 10:49 ` [PATCH 13/19] arm: dts: add omap5 CORE " Alex Shi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).