All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] (gpio-fan): Add thermal control hooks
@ 2015-01-08 18:05 ` Nishanth Menon
  0 siblings, 0 replies; 21+ messages in thread
From: Nishanth Menon @ 2015-01-08 18:05 UTC (permalink / raw)
  To: Guenter Roeck, Jean Delvare, Eduardo Valentin
  Cc: lm-sensors, linux-kernel, devicetree, linux-pm, Nishanth Menon

Allow gpio-fan to be used as thermal cooling device for platforms that
use GPIO maps to control fans.

As part of this change, we make the shutdown and remove logic the same
as well.

Signed-off-by: Nishanth Menon <nm@ti.com>
---

Changes since v1:
	- review comments incorporated (hopefully correct)
	- checkpatch verified
	- retested :).

V1: https://patchwork.kernel.org/patch/5587061/

 .../devicetree/bindings/gpio/gpio-fan.txt          |   13 +++
 drivers/hwmon/gpio-fan.c                           |   83 ++++++++++++++++++--
 2 files changed, 89 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/gpio/gpio-fan.txt b/Documentation/devicetree/bindings/gpio/gpio-fan.txt
index 2dd457a3469a..43ca2a45b862 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-fan.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-fan.txt
@@ -11,6 +11,9 @@ Required properties:
 Optional properties:
 - alarm-gpios: This pin going active indicates something is wrong with
   the fan, and a udev event will be fired.
+- cooling-cells: If used as a cooling device, must be <2>
+  Also see: Documentation/devicetree/bindings/thermal/thermal.txt
+  min and max states are derived from the speed-map of the fan.
 
 Examples:
 
@@ -23,3 +26,13 @@ Examples:
 				      6000 2>;
 		alarm-gpios = <&gpio1 15 1>;
 	};
+	gpio_fan_cool: gpio_fan {
+		compatible = "gpio-fan";
+		gpios = <&gpio2 14 1
+			 &gpio2 13 1>;
+		gpio-fan,speed-map =	<0    0>,
+					<3000 1>,
+					<6000 2>;
+		alarm-gpios = <&gpio2 15 1>;
+		#cooling-cells = <2>; /* min followed by max */
+	};
diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
index 36abf814b8c7..20232c11b579 100644
--- a/drivers/hwmon/gpio-fan.c
+++ b/drivers/hwmon/gpio-fan.c
@@ -34,10 +34,13 @@
 #include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/of_gpio.h>
+#include <linux/thermal.h>
 
 struct gpio_fan_data {
 	struct platform_device	*pdev;
 	struct device		*hwmon_dev;
+	/* Cooling device if any */
+	struct thermal_cooling_device *cdev;
 	struct mutex		lock; /* lock GPIOs operations. */
 	int			num_ctrl;
 	unsigned		*ctrl;
@@ -387,6 +390,53 @@ static int fan_ctrl_init(struct gpio_fan_data *fan_data,
 	return 0;
 }
 
+static int gpio_fan_get_max_state(struct thermal_cooling_device *cdev,
+				  unsigned long *state)
+{
+	struct gpio_fan_data *fan_data = cdev->devdata;
+
+	if (!fan_data)
+		return -EINVAL;
+
+	*state = fan_data->num_speed - 1;
+	return 0;
+}
+
+static int gpio_fan_get_cur_state(struct thermal_cooling_device *cdev,
+				  unsigned long *state)
+{
+	struct gpio_fan_data *fan_data = cdev->devdata;
+	int r;
+
+	if (!fan_data)
+		return -EINVAL;
+
+	r = get_fan_speed_index(fan_data);
+	if (r < 0)
+		return r;
+
+	*state = r;
+	return 0;
+}
+
+static int gpio_fan_set_cur_state(struct thermal_cooling_device *cdev,
+				  unsigned long state)
+{
+	struct gpio_fan_data *fan_data = cdev->devdata;
+
+	if (!fan_data)
+		return -EINVAL;
+
+	set_fan_speed(fan_data, state);
+	return 0;
+}
+
+static const struct thermal_cooling_device_ops gpio_fan_cool_ops = {
+	.get_max_state = gpio_fan_get_max_state,
+	.get_cur_state = gpio_fan_get_cur_state,
+	.set_cur_state = gpio_fan_set_cur_state,
+};
+
 #ifdef CONFIG_OF_GPIO
 /*
  * Translate OpenFirmware node properties into platform_data
@@ -495,6 +545,11 @@ static int gpio_fan_probe(struct platform_device *pdev)
 	struct gpio_fan_data *fan_data;
 	struct gpio_fan_platform_data *pdata = dev_get_platdata(&pdev->dev);
 
+	fan_data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_fan_data),
+				GFP_KERNEL);
+	if (!fan_data)
+		return -ENOMEM;
+
 #ifdef CONFIG_OF_GPIO
 	if (!pdata) {
 		pdata = devm_kzalloc(&pdev->dev,
@@ -506,17 +561,20 @@ static int gpio_fan_probe(struct platform_device *pdev)
 		err = gpio_fan_get_of_pdata(&pdev->dev, pdata);
 		if (err)
 			return err;
+		/* Optional cooling device register for Device tree platforms */
+		fan_data->cdev =
+			thermal_of_cooling_device_register(pdev->dev.of_node,
+							   "gpio-fan", fan_data,
+							   &gpio_fan_cool_ops);
 	}
 #else /* CONFIG_OF_GPIO */
 	if (!pdata)
 		return -EINVAL;
+	/* Optional cooling device register for non Device tree platforms */
+	fan_data->cdev = thermal_cooling_device_register("gpio-fan", fan_data,
+							 &gpio_fan_cool_ops);
 #endif /* CONFIG_OF_GPIO */
 
-	fan_data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_fan_data),
-				GFP_KERNEL);
-	if (!fan_data)
-		return -ENOMEM;
-
 	fan_data->pdev = pdev;
 	platform_set_drvdata(pdev, fan_data);
 	mutex_init(&fan_data->lock);
@@ -550,12 +608,22 @@ static int gpio_fan_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static void gpio_fan_shutdown(struct platform_device *pdev)
+static int gpio_fan_remove(struct platform_device *pdev)
 {
-	struct gpio_fan_data *fan_data = dev_get_drvdata(&pdev->dev);
+	struct gpio_fan_data *fan_data = platform_get_drvdata(pdev);
+
+	if (!IS_ERR(fan_data->cdev))
+		thermal_cooling_device_unregister(fan_data->cdev);
 
 	if (fan_data->ctrl)
 		set_fan_speed(fan_data, 0);
+
+	return 0;
+}
+
+static void gpio_fan_shutdown(struct platform_device *pdev)
+{
+	gpio_fan_remove(pdev);
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -589,6 +657,7 @@ static SIMPLE_DEV_PM_OPS(gpio_fan_pm, gpio_fan_suspend, gpio_fan_resume);
 
 static struct platform_driver gpio_fan_driver = {
 	.probe		= gpio_fan_probe,
+	.remove		= gpio_fan_remove,
 	.shutdown	= gpio_fan_shutdown,
 	.driver	= {
 		.name	= "gpio-fan",
-- 
1.7.9.5


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

* [PATCH V2] (gpio-fan): Add thermal control hooks
@ 2015-01-08 18:05 ` Nishanth Menon
  0 siblings, 0 replies; 21+ messages in thread
From: Nishanth Menon @ 2015-01-08 18:05 UTC (permalink / raw)
  To: Guenter Roeck, Jean Delvare, Eduardo Valentin
  Cc: lm-sensors, linux-kernel, devicetree, linux-pm, Nishanth Menon

Allow gpio-fan to be used as thermal cooling device for platforms that
use GPIO maps to control fans.

As part of this change, we make the shutdown and remove logic the same
as well.

Signed-off-by: Nishanth Menon <nm@ti.com>
---

Changes since v1:
	- review comments incorporated (hopefully correct)
	- checkpatch verified
	- retested :).

V1: https://patchwork.kernel.org/patch/5587061/

 .../devicetree/bindings/gpio/gpio-fan.txt          |   13 +++
 drivers/hwmon/gpio-fan.c                           |   83 ++++++++++++++++++--
 2 files changed, 89 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/gpio/gpio-fan.txt b/Documentation/devicetree/bindings/gpio/gpio-fan.txt
index 2dd457a3469a..43ca2a45b862 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-fan.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-fan.txt
@@ -11,6 +11,9 @@ Required properties:
 Optional properties:
 - alarm-gpios: This pin going active indicates something is wrong with
   the fan, and a udev event will be fired.
+- cooling-cells: If used as a cooling device, must be <2>
+  Also see: Documentation/devicetree/bindings/thermal/thermal.txt
+  min and max states are derived from the speed-map of the fan.
 
 Examples:
 
@@ -23,3 +26,13 @@ Examples:
 				      6000 2>;
 		alarm-gpios = <&gpio1 15 1>;
 	};
+	gpio_fan_cool: gpio_fan {
+		compatible = "gpio-fan";
+		gpios = <&gpio2 14 1
+			 &gpio2 13 1>;
+		gpio-fan,speed-map =	<0    0>,
+					<3000 1>,
+					<6000 2>;
+		alarm-gpios = <&gpio2 15 1>;
+		#cooling-cells = <2>; /* min followed by max */
+	};
diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
index 36abf814b8c7..20232c11b579 100644
--- a/drivers/hwmon/gpio-fan.c
+++ b/drivers/hwmon/gpio-fan.c
@@ -34,10 +34,13 @@
 #include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/of_gpio.h>
+#include <linux/thermal.h>
 
 struct gpio_fan_data {
 	struct platform_device	*pdev;
 	struct device		*hwmon_dev;
+	/* Cooling device if any */
+	struct thermal_cooling_device *cdev;
 	struct mutex		lock; /* lock GPIOs operations. */
 	int			num_ctrl;
 	unsigned		*ctrl;
@@ -387,6 +390,53 @@ static int fan_ctrl_init(struct gpio_fan_data *fan_data,
 	return 0;
 }
 
+static int gpio_fan_get_max_state(struct thermal_cooling_device *cdev,
+				  unsigned long *state)
+{
+	struct gpio_fan_data *fan_data = cdev->devdata;
+
+	if (!fan_data)
+		return -EINVAL;
+
+	*state = fan_data->num_speed - 1;
+	return 0;
+}
+
+static int gpio_fan_get_cur_state(struct thermal_cooling_device *cdev,
+				  unsigned long *state)
+{
+	struct gpio_fan_data *fan_data = cdev->devdata;
+	int r;
+
+	if (!fan_data)
+		return -EINVAL;
+
+	r = get_fan_speed_index(fan_data);
+	if (r < 0)
+		return r;
+
+	*state = r;
+	return 0;
+}
+
+static int gpio_fan_set_cur_state(struct thermal_cooling_device *cdev,
+				  unsigned long state)
+{
+	struct gpio_fan_data *fan_data = cdev->devdata;
+
+	if (!fan_data)
+		return -EINVAL;
+
+	set_fan_speed(fan_data, state);
+	return 0;
+}
+
+static const struct thermal_cooling_device_ops gpio_fan_cool_ops = {
+	.get_max_state = gpio_fan_get_max_state,
+	.get_cur_state = gpio_fan_get_cur_state,
+	.set_cur_state = gpio_fan_set_cur_state,
+};
+
 #ifdef CONFIG_OF_GPIO
 /*
  * Translate OpenFirmware node properties into platform_data
@@ -495,6 +545,11 @@ static int gpio_fan_probe(struct platform_device *pdev)
 	struct gpio_fan_data *fan_data;
 	struct gpio_fan_platform_data *pdata = dev_get_platdata(&pdev->dev);
 
+	fan_data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_fan_data),
+				GFP_KERNEL);
+	if (!fan_data)
+		return -ENOMEM;
+
 #ifdef CONFIG_OF_GPIO
 	if (!pdata) {
 		pdata = devm_kzalloc(&pdev->dev,
@@ -506,17 +561,20 @@ static int gpio_fan_probe(struct platform_device *pdev)
 		err = gpio_fan_get_of_pdata(&pdev->dev, pdata);
 		if (err)
 			return err;
+		/* Optional cooling device register for Device tree platforms */
+		fan_data->cdev =
+			thermal_of_cooling_device_register(pdev->dev.of_node,
+							   "gpio-fan", fan_data,
+							   &gpio_fan_cool_ops);
 	}
 #else /* CONFIG_OF_GPIO */
 	if (!pdata)
 		return -EINVAL;
+	/* Optional cooling device register for non Device tree platforms */
+	fan_data->cdev = thermal_cooling_device_register("gpio-fan", fan_data,
+							 &gpio_fan_cool_ops);
 #endif /* CONFIG_OF_GPIO */
 
-	fan_data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_fan_data),
-				GFP_KERNEL);
-	if (!fan_data)
-		return -ENOMEM;
-
 	fan_data->pdev = pdev;
 	platform_set_drvdata(pdev, fan_data);
 	mutex_init(&fan_data->lock);
@@ -550,12 +608,22 @@ static int gpio_fan_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static void gpio_fan_shutdown(struct platform_device *pdev)
+static int gpio_fan_remove(struct platform_device *pdev)
 {
-	struct gpio_fan_data *fan_data = dev_get_drvdata(&pdev->dev);
+	struct gpio_fan_data *fan_data = platform_get_drvdata(pdev);
+
+	if (!IS_ERR(fan_data->cdev))
+		thermal_cooling_device_unregister(fan_data->cdev);
 
 	if (fan_data->ctrl)
 		set_fan_speed(fan_data, 0);
+
+	return 0;
+}
+
+static void gpio_fan_shutdown(struct platform_device *pdev)
+{
+	gpio_fan_remove(pdev);
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -589,6 +657,7 @@ static SIMPLE_DEV_PM_OPS(gpio_fan_pm, gpio_fan_suspend, gpio_fan_resume);
 
 static struct platform_driver gpio_fan_driver = {
 	.probe		= gpio_fan_probe,
+	.remove		= gpio_fan_remove,
 	.shutdown	= gpio_fan_shutdown,
 	.driver	= {
 		.name	= "gpio-fan",
-- 
1.7.9.5

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

* [lm-sensors] [PATCH V2] (gpio-fan): Add thermal control hooks
@ 2015-01-08 18:05 ` Nishanth Menon
  0 siblings, 0 replies; 21+ messages in thread
From: Nishanth Menon @ 2015-01-08 18:05 UTC (permalink / raw)
  To: Guenter Roeck, Jean Delvare, Eduardo Valentin
  Cc: lm-sensors, linux-kernel, devicetree, linux-pm, Nishanth Menon

Allow gpio-fan to be used as thermal cooling device for platforms that
use GPIO maps to control fans.

As part of this change, we make the shutdown and remove logic the same
as well.

Signed-off-by: Nishanth Menon <nm@ti.com>
---

Changes since v1:
	- review comments incorporated (hopefully correct)
	- checkpatch verified
	- retested :).

V1: https://patchwork.kernel.org/patch/5587061/

 .../devicetree/bindings/gpio/gpio-fan.txt          |   13 +++
 drivers/hwmon/gpio-fan.c                           |   83 ++++++++++++++++++--
 2 files changed, 89 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/gpio/gpio-fan.txt b/Documentation/devicetree/bindings/gpio/gpio-fan.txt
index 2dd457a3469a..43ca2a45b862 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-fan.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-fan.txt
@@ -11,6 +11,9 @@ Required properties:
 Optional properties:
 - alarm-gpios: This pin going active indicates something is wrong with
   the fan, and a udev event will be fired.
+- cooling-cells: If used as a cooling device, must be <2>
+  Also see: Documentation/devicetree/bindings/thermal/thermal.txt
+  min and max states are derived from the speed-map of the fan.
 
 Examples:
 
@@ -23,3 +26,13 @@ Examples:
 				      6000 2>;
 		alarm-gpios = <&gpio1 15 1>;
 	};
+	gpio_fan_cool: gpio_fan {
+		compatible = "gpio-fan";
+		gpios = <&gpio2 14 1
+			 &gpio2 13 1>;
+		gpio-fan,speed-map =	<0    0>,
+					<3000 1>,
+					<6000 2>;
+		alarm-gpios = <&gpio2 15 1>;
+		#cooling-cells = <2>; /* min followed by max */
+	};
diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
index 36abf814b8c7..20232c11b579 100644
--- a/drivers/hwmon/gpio-fan.c
+++ b/drivers/hwmon/gpio-fan.c
@@ -34,10 +34,13 @@
 #include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/of_gpio.h>
+#include <linux/thermal.h>
 
 struct gpio_fan_data {
 	struct platform_device	*pdev;
 	struct device		*hwmon_dev;
+	/* Cooling device if any */
+	struct thermal_cooling_device *cdev;
 	struct mutex		lock; /* lock GPIOs operations. */
 	int			num_ctrl;
 	unsigned		*ctrl;
@@ -387,6 +390,53 @@ static int fan_ctrl_init(struct gpio_fan_data *fan_data,
 	return 0;
 }
 
+static int gpio_fan_get_max_state(struct thermal_cooling_device *cdev,
+				  unsigned long *state)
+{
+	struct gpio_fan_data *fan_data = cdev->devdata;
+
+	if (!fan_data)
+		return -EINVAL;
+
+	*state = fan_data->num_speed - 1;
+	return 0;
+}
+
+static int gpio_fan_get_cur_state(struct thermal_cooling_device *cdev,
+				  unsigned long *state)
+{
+	struct gpio_fan_data *fan_data = cdev->devdata;
+	int r;
+
+	if (!fan_data)
+		return -EINVAL;
+
+	r = get_fan_speed_index(fan_data);
+	if (r < 0)
+		return r;
+
+	*state = r;
+	return 0;
+}
+
+static int gpio_fan_set_cur_state(struct thermal_cooling_device *cdev,
+				  unsigned long state)
+{
+	struct gpio_fan_data *fan_data = cdev->devdata;
+
+	if (!fan_data)
+		return -EINVAL;
+
+	set_fan_speed(fan_data, state);
+	return 0;
+}
+
+static const struct thermal_cooling_device_ops gpio_fan_cool_ops = {
+	.get_max_state = gpio_fan_get_max_state,
+	.get_cur_state = gpio_fan_get_cur_state,
+	.set_cur_state = gpio_fan_set_cur_state,
+};
+
 #ifdef CONFIG_OF_GPIO
 /*
  * Translate OpenFirmware node properties into platform_data
@@ -495,6 +545,11 @@ static int gpio_fan_probe(struct platform_device *pdev)
 	struct gpio_fan_data *fan_data;
 	struct gpio_fan_platform_data *pdata = dev_get_platdata(&pdev->dev);
 
+	fan_data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_fan_data),
+				GFP_KERNEL);
+	if (!fan_data)
+		return -ENOMEM;
+
 #ifdef CONFIG_OF_GPIO
 	if (!pdata) {
 		pdata = devm_kzalloc(&pdev->dev,
@@ -506,17 +561,20 @@ static int gpio_fan_probe(struct platform_device *pdev)
 		err = gpio_fan_get_of_pdata(&pdev->dev, pdata);
 		if (err)
 			return err;
+		/* Optional cooling device register for Device tree platforms */
+		fan_data->cdev +			thermal_of_cooling_device_register(pdev->dev.of_node,
+							   "gpio-fan", fan_data,
+							   &gpio_fan_cool_ops);
 	}
 #else /* CONFIG_OF_GPIO */
 	if (!pdata)
 		return -EINVAL;
+	/* Optional cooling device register for non Device tree platforms */
+	fan_data->cdev = thermal_cooling_device_register("gpio-fan", fan_data,
+							 &gpio_fan_cool_ops);
 #endif /* CONFIG_OF_GPIO */
 
-	fan_data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_fan_data),
-				GFP_KERNEL);
-	if (!fan_data)
-		return -ENOMEM;
-
 	fan_data->pdev = pdev;
 	platform_set_drvdata(pdev, fan_data);
 	mutex_init(&fan_data->lock);
@@ -550,12 +608,22 @@ static int gpio_fan_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static void gpio_fan_shutdown(struct platform_device *pdev)
+static int gpio_fan_remove(struct platform_device *pdev)
 {
-	struct gpio_fan_data *fan_data = dev_get_drvdata(&pdev->dev);
+	struct gpio_fan_data *fan_data = platform_get_drvdata(pdev);
+
+	if (!IS_ERR(fan_data->cdev))
+		thermal_cooling_device_unregister(fan_data->cdev);
 
 	if (fan_data->ctrl)
 		set_fan_speed(fan_data, 0);
+
+	return 0;
+}
+
+static void gpio_fan_shutdown(struct platform_device *pdev)
+{
+	gpio_fan_remove(pdev);
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -589,6 +657,7 @@ static SIMPLE_DEV_PM_OPS(gpio_fan_pm, gpio_fan_suspend, gpio_fan_resume);
 
 static struct platform_driver gpio_fan_driver = {
 	.probe		= gpio_fan_probe,
+	.remove		= gpio_fan_remove,
 	.shutdown	= gpio_fan_shutdown,
 	.driver	= {
 		.name	= "gpio-fan",
-- 
1.7.9.5


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [PATCH V2] (gpio-fan): Add thermal control hooks
  2015-01-08 18:05 ` Nishanth Menon
@ 2015-01-09  4:48   ` Guenter Roeck
  -1 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2015-01-09  4:48 UTC (permalink / raw)
  To: Nishanth Menon, Jean Delvare, Eduardo Valentin
  Cc: lm-sensors, linux-kernel, devicetree, linux-pm

On 01/08/2015 10:05 AM, Nishanth Menon wrote:
> Allow gpio-fan to be used as thermal cooling device for platforms that
> use GPIO maps to control fans.
>
> As part of this change, we make the shutdown and remove logic the same
> as well.
>
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---

Applied to -next.

Thanks,
Guenter


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

* Re: [lm-sensors] [PATCH V2] (gpio-fan): Add thermal control hooks
@ 2015-01-09  4:48   ` Guenter Roeck
  0 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2015-01-09  4:48 UTC (permalink / raw)
  To: Nishanth Menon, Jean Delvare, Eduardo Valentin
  Cc: lm-sensors, linux-kernel, devicetree, linux-pm

On 01/08/2015 10:05 AM, Nishanth Menon wrote:
> Allow gpio-fan to be used as thermal cooling device for platforms that
> use GPIO maps to control fans.
>
> As part of this change, we make the shutdown and remove logic the same
> as well.
>
> Signed-off-by: Nishanth Menon <nm@ti.com>
> ---

Applied to -next.

Thanks,
Guenter


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [PATCH V2] (gpio-fan): Add thermal control hooks
@ 2015-01-09 11:46   ` Eduardo Valentin
  0 siblings, 0 replies; 21+ messages in thread
From: Eduardo Valentin @ 2015-01-09 11:46 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Guenter Roeck, Jean Delvare, lm-sensors, linux-kernel,
	devicetree, linux-pm

[-- Attachment #1: Type: text/plain, Size: 6181 bytes --]

On Thu, Jan 08, 2015 at 12:05:03PM -0600, Nishanth Menon wrote:
> Allow gpio-fan to be used as thermal cooling device for platforms that
> use GPIO maps to control fans.
> 
> As part of this change, we make the shutdown and remove logic the same
> as well.
> 
> Signed-off-by: Nishanth Menon <nm@ti.com>

For the thermal part:

Acked-by: Eduardo Valentin <edubezval@gmail.com>

> ---
> 
> Changes since v1:
> 	- review comments incorporated (hopefully correct)
> 	- checkpatch verified
> 	- retested :).
> 
> V1: https://patchwork.kernel.org/patch/5587061/
> 
>  .../devicetree/bindings/gpio/gpio-fan.txt          |   13 +++
>  drivers/hwmon/gpio-fan.c                           |   83 ++++++++++++++++++--
>  2 files changed, 89 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-fan.txt b/Documentation/devicetree/bindings/gpio/gpio-fan.txt
> index 2dd457a3469a..43ca2a45b862 100644
> --- a/Documentation/devicetree/bindings/gpio/gpio-fan.txt
> +++ b/Documentation/devicetree/bindings/gpio/gpio-fan.txt
> @@ -11,6 +11,9 @@ Required properties:
>  Optional properties:
>  - alarm-gpios: This pin going active indicates something is wrong with
>    the fan, and a udev event will be fired.
> +- cooling-cells: If used as a cooling device, must be <2>
> +  Also see: Documentation/devicetree/bindings/thermal/thermal.txt
> +  min and max states are derived from the speed-map of the fan.
>  
>  Examples:
>  
> @@ -23,3 +26,13 @@ Examples:
>  				      6000 2>;
>  		alarm-gpios = <&gpio1 15 1>;
>  	};
> +	gpio_fan_cool: gpio_fan {
> +		compatible = "gpio-fan";
> +		gpios = <&gpio2 14 1
> +			 &gpio2 13 1>;
> +		gpio-fan,speed-map =	<0    0>,
> +					<3000 1>,
> +					<6000 2>;
> +		alarm-gpios = <&gpio2 15 1>;
> +		#cooling-cells = <2>; /* min followed by max */
> +	};
> diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
> index 36abf814b8c7..20232c11b579 100644
> --- a/drivers/hwmon/gpio-fan.c
> +++ b/drivers/hwmon/gpio-fan.c
> @@ -34,10 +34,13 @@
>  #include <linux/of.h>
>  #include <linux/of_platform.h>
>  #include <linux/of_gpio.h>
> +#include <linux/thermal.h>
>  
>  struct gpio_fan_data {
>  	struct platform_device	*pdev;
>  	struct device		*hwmon_dev;
> +	/* Cooling device if any */
> +	struct thermal_cooling_device *cdev;
>  	struct mutex		lock; /* lock GPIOs operations. */
>  	int			num_ctrl;
>  	unsigned		*ctrl;
> @@ -387,6 +390,53 @@ static int fan_ctrl_init(struct gpio_fan_data *fan_data,
>  	return 0;
>  }
>  
> +static int gpio_fan_get_max_state(struct thermal_cooling_device *cdev,
> +				  unsigned long *state)
> +{
> +	struct gpio_fan_data *fan_data = cdev->devdata;
> +
> +	if (!fan_data)
> +		return -EINVAL;
> +
> +	*state = fan_data->num_speed - 1;
> +	return 0;
> +}
> +
> +static int gpio_fan_get_cur_state(struct thermal_cooling_device *cdev,
> +				  unsigned long *state)
> +{
> +	struct gpio_fan_data *fan_data = cdev->devdata;
> +	int r;
> +
> +	if (!fan_data)
> +		return -EINVAL;
> +
> +	r = get_fan_speed_index(fan_data);
> +	if (r < 0)
> +		return r;
> +
> +	*state = r;
> +	return 0;
> +}
> +
> +static int gpio_fan_set_cur_state(struct thermal_cooling_device *cdev,
> +				  unsigned long state)
> +{
> +	struct gpio_fan_data *fan_data = cdev->devdata;
> +
> +	if (!fan_data)
> +		return -EINVAL;
> +
> +	set_fan_speed(fan_data, state);
> +	return 0;
> +}
> +
> +static const struct thermal_cooling_device_ops gpio_fan_cool_ops = {
> +	.get_max_state = gpio_fan_get_max_state,
> +	.get_cur_state = gpio_fan_get_cur_state,
> +	.set_cur_state = gpio_fan_set_cur_state,
> +};
> +
>  #ifdef CONFIG_OF_GPIO
>  /*
>   * Translate OpenFirmware node properties into platform_data
> @@ -495,6 +545,11 @@ static int gpio_fan_probe(struct platform_device *pdev)
>  	struct gpio_fan_data *fan_data;
>  	struct gpio_fan_platform_data *pdata = dev_get_platdata(&pdev->dev);
>  
> +	fan_data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_fan_data),
> +				GFP_KERNEL);
> +	if (!fan_data)
> +		return -ENOMEM;
> +
>  #ifdef CONFIG_OF_GPIO
>  	if (!pdata) {
>  		pdata = devm_kzalloc(&pdev->dev,
> @@ -506,17 +561,20 @@ static int gpio_fan_probe(struct platform_device *pdev)
>  		err = gpio_fan_get_of_pdata(&pdev->dev, pdata);
>  		if (err)
>  			return err;
> +		/* Optional cooling device register for Device tree platforms */
> +		fan_data->cdev =
> +			thermal_of_cooling_device_register(pdev->dev.of_node,
> +							   "gpio-fan", fan_data,
> +							   &gpio_fan_cool_ops);
>  	}
>  #else /* CONFIG_OF_GPIO */
>  	if (!pdata)
>  		return -EINVAL;
> +	/* Optional cooling device register for non Device tree platforms */
> +	fan_data->cdev = thermal_cooling_device_register("gpio-fan", fan_data,
> +							 &gpio_fan_cool_ops);
>  #endif /* CONFIG_OF_GPIO */
>  
> -	fan_data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_fan_data),
> -				GFP_KERNEL);
> -	if (!fan_data)
> -		return -ENOMEM;
> -
>  	fan_data->pdev = pdev;
>  	platform_set_drvdata(pdev, fan_data);
>  	mutex_init(&fan_data->lock);
> @@ -550,12 +608,22 @@ static int gpio_fan_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static void gpio_fan_shutdown(struct platform_device *pdev)
> +static int gpio_fan_remove(struct platform_device *pdev)
>  {
> -	struct gpio_fan_data *fan_data = dev_get_drvdata(&pdev->dev);
> +	struct gpio_fan_data *fan_data = platform_get_drvdata(pdev);
> +
> +	if (!IS_ERR(fan_data->cdev))
> +		thermal_cooling_device_unregister(fan_data->cdev);
>  
>  	if (fan_data->ctrl)
>  		set_fan_speed(fan_data, 0);
> +
> +	return 0;
> +}
> +
> +static void gpio_fan_shutdown(struct platform_device *pdev)
> +{
> +	gpio_fan_remove(pdev);
>  }
>  
>  #ifdef CONFIG_PM_SLEEP
> @@ -589,6 +657,7 @@ static SIMPLE_DEV_PM_OPS(gpio_fan_pm, gpio_fan_suspend, gpio_fan_resume);
>  
>  static struct platform_driver gpio_fan_driver = {
>  	.probe		= gpio_fan_probe,
> +	.remove		= gpio_fan_remove,
>  	.shutdown	= gpio_fan_shutdown,
>  	.driver	= {
>  		.name	= "gpio-fan",
> -- 
> 1.7.9.5
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [PATCH V2] (gpio-fan): Add thermal control hooks
@ 2015-01-09 11:46   ` Eduardo Valentin
  0 siblings, 0 replies; 21+ messages in thread
From: Eduardo Valentin @ 2015-01-09 11:46 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Guenter Roeck, Jean Delvare, lm-sensors-GZX6beZjE8VD60Wz+7aTrA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-pm-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 6233 bytes --]

On Thu, Jan 08, 2015 at 12:05:03PM -0600, Nishanth Menon wrote:
> Allow gpio-fan to be used as thermal cooling device for platforms that
> use GPIO maps to control fans.
> 
> As part of this change, we make the shutdown and remove logic the same
> as well.
> 
> Signed-off-by: Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>

For the thermal part:

Acked-by: Eduardo Valentin <edubezval-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

> ---
> 
> Changes since v1:
> 	- review comments incorporated (hopefully correct)
> 	- checkpatch verified
> 	- retested :).
> 
> V1: https://patchwork.kernel.org/patch/5587061/
> 
>  .../devicetree/bindings/gpio/gpio-fan.txt          |   13 +++
>  drivers/hwmon/gpio-fan.c                           |   83 ++++++++++++++++++--
>  2 files changed, 89 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-fan.txt b/Documentation/devicetree/bindings/gpio/gpio-fan.txt
> index 2dd457a3469a..43ca2a45b862 100644
> --- a/Documentation/devicetree/bindings/gpio/gpio-fan.txt
> +++ b/Documentation/devicetree/bindings/gpio/gpio-fan.txt
> @@ -11,6 +11,9 @@ Required properties:
>  Optional properties:
>  - alarm-gpios: This pin going active indicates something is wrong with
>    the fan, and a udev event will be fired.
> +- cooling-cells: If used as a cooling device, must be <2>
> +  Also see: Documentation/devicetree/bindings/thermal/thermal.txt
> +  min and max states are derived from the speed-map of the fan.
>  
>  Examples:
>  
> @@ -23,3 +26,13 @@ Examples:
>  				      6000 2>;
>  		alarm-gpios = <&gpio1 15 1>;
>  	};
> +	gpio_fan_cool: gpio_fan {
> +		compatible = "gpio-fan";
> +		gpios = <&gpio2 14 1
> +			 &gpio2 13 1>;
> +		gpio-fan,speed-map =	<0    0>,
> +					<3000 1>,
> +					<6000 2>;
> +		alarm-gpios = <&gpio2 15 1>;
> +		#cooling-cells = <2>; /* min followed by max */
> +	};
> diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
> index 36abf814b8c7..20232c11b579 100644
> --- a/drivers/hwmon/gpio-fan.c
> +++ b/drivers/hwmon/gpio-fan.c
> @@ -34,10 +34,13 @@
>  #include <linux/of.h>
>  #include <linux/of_platform.h>
>  #include <linux/of_gpio.h>
> +#include <linux/thermal.h>
>  
>  struct gpio_fan_data {
>  	struct platform_device	*pdev;
>  	struct device		*hwmon_dev;
> +	/* Cooling device if any */
> +	struct thermal_cooling_device *cdev;
>  	struct mutex		lock; /* lock GPIOs operations. */
>  	int			num_ctrl;
>  	unsigned		*ctrl;
> @@ -387,6 +390,53 @@ static int fan_ctrl_init(struct gpio_fan_data *fan_data,
>  	return 0;
>  }
>  
> +static int gpio_fan_get_max_state(struct thermal_cooling_device *cdev,
> +				  unsigned long *state)
> +{
> +	struct gpio_fan_data *fan_data = cdev->devdata;
> +
> +	if (!fan_data)
> +		return -EINVAL;
> +
> +	*state = fan_data->num_speed - 1;
> +	return 0;
> +}
> +
> +static int gpio_fan_get_cur_state(struct thermal_cooling_device *cdev,
> +				  unsigned long *state)
> +{
> +	struct gpio_fan_data *fan_data = cdev->devdata;
> +	int r;
> +
> +	if (!fan_data)
> +		return -EINVAL;
> +
> +	r = get_fan_speed_index(fan_data);
> +	if (r < 0)
> +		return r;
> +
> +	*state = r;
> +	return 0;
> +}
> +
> +static int gpio_fan_set_cur_state(struct thermal_cooling_device *cdev,
> +				  unsigned long state)
> +{
> +	struct gpio_fan_data *fan_data = cdev->devdata;
> +
> +	if (!fan_data)
> +		return -EINVAL;
> +
> +	set_fan_speed(fan_data, state);
> +	return 0;
> +}
> +
> +static const struct thermal_cooling_device_ops gpio_fan_cool_ops = {
> +	.get_max_state = gpio_fan_get_max_state,
> +	.get_cur_state = gpio_fan_get_cur_state,
> +	.set_cur_state = gpio_fan_set_cur_state,
> +};
> +
>  #ifdef CONFIG_OF_GPIO
>  /*
>   * Translate OpenFirmware node properties into platform_data
> @@ -495,6 +545,11 @@ static int gpio_fan_probe(struct platform_device *pdev)
>  	struct gpio_fan_data *fan_data;
>  	struct gpio_fan_platform_data *pdata = dev_get_platdata(&pdev->dev);
>  
> +	fan_data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_fan_data),
> +				GFP_KERNEL);
> +	if (!fan_data)
> +		return -ENOMEM;
> +
>  #ifdef CONFIG_OF_GPIO
>  	if (!pdata) {
>  		pdata = devm_kzalloc(&pdev->dev,
> @@ -506,17 +561,20 @@ static int gpio_fan_probe(struct platform_device *pdev)
>  		err = gpio_fan_get_of_pdata(&pdev->dev, pdata);
>  		if (err)
>  			return err;
> +		/* Optional cooling device register for Device tree platforms */
> +		fan_data->cdev =
> +			thermal_of_cooling_device_register(pdev->dev.of_node,
> +							   "gpio-fan", fan_data,
> +							   &gpio_fan_cool_ops);
>  	}
>  #else /* CONFIG_OF_GPIO */
>  	if (!pdata)
>  		return -EINVAL;
> +	/* Optional cooling device register for non Device tree platforms */
> +	fan_data->cdev = thermal_cooling_device_register("gpio-fan", fan_data,
> +							 &gpio_fan_cool_ops);
>  #endif /* CONFIG_OF_GPIO */
>  
> -	fan_data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_fan_data),
> -				GFP_KERNEL);
> -	if (!fan_data)
> -		return -ENOMEM;
> -
>  	fan_data->pdev = pdev;
>  	platform_set_drvdata(pdev, fan_data);
>  	mutex_init(&fan_data->lock);
> @@ -550,12 +608,22 @@ static int gpio_fan_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static void gpio_fan_shutdown(struct platform_device *pdev)
> +static int gpio_fan_remove(struct platform_device *pdev)
>  {
> -	struct gpio_fan_data *fan_data = dev_get_drvdata(&pdev->dev);
> +	struct gpio_fan_data *fan_data = platform_get_drvdata(pdev);
> +
> +	if (!IS_ERR(fan_data->cdev))
> +		thermal_cooling_device_unregister(fan_data->cdev);
>  
>  	if (fan_data->ctrl)
>  		set_fan_speed(fan_data, 0);
> +
> +	return 0;
> +}
> +
> +static void gpio_fan_shutdown(struct platform_device *pdev)
> +{
> +	gpio_fan_remove(pdev);
>  }
>  
>  #ifdef CONFIG_PM_SLEEP
> @@ -589,6 +657,7 @@ static SIMPLE_DEV_PM_OPS(gpio_fan_pm, gpio_fan_suspend, gpio_fan_resume);
>  
>  static struct platform_driver gpio_fan_driver = {
>  	.probe		= gpio_fan_probe,
> +	.remove		= gpio_fan_remove,
>  	.shutdown	= gpio_fan_shutdown,
>  	.driver	= {
>  		.name	= "gpio-fan",
> -- 
> 1.7.9.5
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [lm-sensors] [PATCH V2] (gpio-fan): Add thermal control hooks
@ 2015-01-09 11:46   ` Eduardo Valentin
  0 siblings, 0 replies; 21+ messages in thread
From: Eduardo Valentin @ 2015-01-09 11:46 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Guenter Roeck, Jean Delvare, lm-sensors, linux-kernel,
	devicetree, linux-pm


[-- Attachment #1.1: Type: text/plain, Size: 6181 bytes --]

On Thu, Jan 08, 2015 at 12:05:03PM -0600, Nishanth Menon wrote:
> Allow gpio-fan to be used as thermal cooling device for platforms that
> use GPIO maps to control fans.
> 
> As part of this change, we make the shutdown and remove logic the same
> as well.
> 
> Signed-off-by: Nishanth Menon <nm@ti.com>

For the thermal part:

Acked-by: Eduardo Valentin <edubezval@gmail.com>

> ---
> 
> Changes since v1:
> 	- review comments incorporated (hopefully correct)
> 	- checkpatch verified
> 	- retested :).
> 
> V1: https://patchwork.kernel.org/patch/5587061/
> 
>  .../devicetree/bindings/gpio/gpio-fan.txt          |   13 +++
>  drivers/hwmon/gpio-fan.c                           |   83 ++++++++++++++++++--
>  2 files changed, 89 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-fan.txt b/Documentation/devicetree/bindings/gpio/gpio-fan.txt
> index 2dd457a3469a..43ca2a45b862 100644
> --- a/Documentation/devicetree/bindings/gpio/gpio-fan.txt
> +++ b/Documentation/devicetree/bindings/gpio/gpio-fan.txt
> @@ -11,6 +11,9 @@ Required properties:
>  Optional properties:
>  - alarm-gpios: This pin going active indicates something is wrong with
>    the fan, and a udev event will be fired.
> +- cooling-cells: If used as a cooling device, must be <2>
> +  Also see: Documentation/devicetree/bindings/thermal/thermal.txt
> +  min and max states are derived from the speed-map of the fan.
>  
>  Examples:
>  
> @@ -23,3 +26,13 @@ Examples:
>  				      6000 2>;
>  		alarm-gpios = <&gpio1 15 1>;
>  	};
> +	gpio_fan_cool: gpio_fan {
> +		compatible = "gpio-fan";
> +		gpios = <&gpio2 14 1
> +			 &gpio2 13 1>;
> +		gpio-fan,speed-map =	<0    0>,
> +					<3000 1>,
> +					<6000 2>;
> +		alarm-gpios = <&gpio2 15 1>;
> +		#cooling-cells = <2>; /* min followed by max */
> +	};
> diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
> index 36abf814b8c7..20232c11b579 100644
> --- a/drivers/hwmon/gpio-fan.c
> +++ b/drivers/hwmon/gpio-fan.c
> @@ -34,10 +34,13 @@
>  #include <linux/of.h>
>  #include <linux/of_platform.h>
>  #include <linux/of_gpio.h>
> +#include <linux/thermal.h>
>  
>  struct gpio_fan_data {
>  	struct platform_device	*pdev;
>  	struct device		*hwmon_dev;
> +	/* Cooling device if any */
> +	struct thermal_cooling_device *cdev;
>  	struct mutex		lock; /* lock GPIOs operations. */
>  	int			num_ctrl;
>  	unsigned		*ctrl;
> @@ -387,6 +390,53 @@ static int fan_ctrl_init(struct gpio_fan_data *fan_data,
>  	return 0;
>  }
>  
> +static int gpio_fan_get_max_state(struct thermal_cooling_device *cdev,
> +				  unsigned long *state)
> +{
> +	struct gpio_fan_data *fan_data = cdev->devdata;
> +
> +	if (!fan_data)
> +		return -EINVAL;
> +
> +	*state = fan_data->num_speed - 1;
> +	return 0;
> +}
> +
> +static int gpio_fan_get_cur_state(struct thermal_cooling_device *cdev,
> +				  unsigned long *state)
> +{
> +	struct gpio_fan_data *fan_data = cdev->devdata;
> +	int r;
> +
> +	if (!fan_data)
> +		return -EINVAL;
> +
> +	r = get_fan_speed_index(fan_data);
> +	if (r < 0)
> +		return r;
> +
> +	*state = r;
> +	return 0;
> +}
> +
> +static int gpio_fan_set_cur_state(struct thermal_cooling_device *cdev,
> +				  unsigned long state)
> +{
> +	struct gpio_fan_data *fan_data = cdev->devdata;
> +
> +	if (!fan_data)
> +		return -EINVAL;
> +
> +	set_fan_speed(fan_data, state);
> +	return 0;
> +}
> +
> +static const struct thermal_cooling_device_ops gpio_fan_cool_ops = {
> +	.get_max_state = gpio_fan_get_max_state,
> +	.get_cur_state = gpio_fan_get_cur_state,
> +	.set_cur_state = gpio_fan_set_cur_state,
> +};
> +
>  #ifdef CONFIG_OF_GPIO
>  /*
>   * Translate OpenFirmware node properties into platform_data
> @@ -495,6 +545,11 @@ static int gpio_fan_probe(struct platform_device *pdev)
>  	struct gpio_fan_data *fan_data;
>  	struct gpio_fan_platform_data *pdata = dev_get_platdata(&pdev->dev);
>  
> +	fan_data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_fan_data),
> +				GFP_KERNEL);
> +	if (!fan_data)
> +		return -ENOMEM;
> +
>  #ifdef CONFIG_OF_GPIO
>  	if (!pdata) {
>  		pdata = devm_kzalloc(&pdev->dev,
> @@ -506,17 +561,20 @@ static int gpio_fan_probe(struct platform_device *pdev)
>  		err = gpio_fan_get_of_pdata(&pdev->dev, pdata);
>  		if (err)
>  			return err;
> +		/* Optional cooling device register for Device tree platforms */
> +		fan_data->cdev =
> +			thermal_of_cooling_device_register(pdev->dev.of_node,
> +							   "gpio-fan", fan_data,
> +							   &gpio_fan_cool_ops);
>  	}
>  #else /* CONFIG_OF_GPIO */
>  	if (!pdata)
>  		return -EINVAL;
> +	/* Optional cooling device register for non Device tree platforms */
> +	fan_data->cdev = thermal_cooling_device_register("gpio-fan", fan_data,
> +							 &gpio_fan_cool_ops);
>  #endif /* CONFIG_OF_GPIO */
>  
> -	fan_data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_fan_data),
> -				GFP_KERNEL);
> -	if (!fan_data)
> -		return -ENOMEM;
> -
>  	fan_data->pdev = pdev;
>  	platform_set_drvdata(pdev, fan_data);
>  	mutex_init(&fan_data->lock);
> @@ -550,12 +608,22 @@ static int gpio_fan_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static void gpio_fan_shutdown(struct platform_device *pdev)
> +static int gpio_fan_remove(struct platform_device *pdev)
>  {
> -	struct gpio_fan_data *fan_data = dev_get_drvdata(&pdev->dev);
> +	struct gpio_fan_data *fan_data = platform_get_drvdata(pdev);
> +
> +	if (!IS_ERR(fan_data->cdev))
> +		thermal_cooling_device_unregister(fan_data->cdev);
>  
>  	if (fan_data->ctrl)
>  		set_fan_speed(fan_data, 0);
> +
> +	return 0;
> +}
> +
> +static void gpio_fan_shutdown(struct platform_device *pdev)
> +{
> +	gpio_fan_remove(pdev);
>  }
>  
>  #ifdef CONFIG_PM_SLEEP
> @@ -589,6 +657,7 @@ static SIMPLE_DEV_PM_OPS(gpio_fan_pm, gpio_fan_suspend, gpio_fan_resume);
>  
>  static struct platform_driver gpio_fan_driver = {
>  	.probe		= gpio_fan_probe,
> +	.remove		= gpio_fan_remove,
>  	.shutdown	= gpio_fan_shutdown,
>  	.driver	= {
>  		.name	= "gpio-fan",
> -- 
> 1.7.9.5
> 

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [PATCH V2] (gpio-fan): Add thermal control hooks
  2015-01-09  4:48   ` [lm-sensors] " Guenter Roeck
@ 2015-02-24 19:29     ` Eduardo Valentin
  -1 siblings, 0 replies; 21+ messages in thread
From: Eduardo Valentin @ 2015-02-24 19:29 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Nishanth Menon, Jean Delvare, lm-sensors, linux-kernel,
	devicetree, linux-pm

[-- Attachment #1: Type: text/plain, Size: 555 bytes --]

Guenter,

On Thu, Jan 08, 2015 at 08:48:40PM -0800, Guenter Roeck wrote:
> On 01/08/2015 10:05 AM, Nishanth Menon wrote:
> > Allow gpio-fan to be used as thermal cooling device for platforms that
> > use GPIO maps to control fans.
> >
> > As part of this change, we make the shutdown and remove logic the same
> > as well.
> >
> > Signed-off-by: Nishanth Menon <nm@ti.com>
> > ---
> 
> Applied to -next.

What is the target kernel version for this change? It didn't make
4.0-rc1

BR,

Eduardo Valentin

> 
> Thanks,
> Guenter
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [lm-sensors] [PATCH V2] (gpio-fan): Add thermal control hooks
@ 2015-02-24 19:29     ` Eduardo Valentin
  0 siblings, 0 replies; 21+ messages in thread
From: Eduardo Valentin @ 2015-02-24 19:29 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Nishanth Menon, Jean Delvare, lm-sensors, linux-kernel,
	devicetree, linux-pm


[-- Attachment #1.1: Type: text/plain, Size: 555 bytes --]

Guenter,

On Thu, Jan 08, 2015 at 08:48:40PM -0800, Guenter Roeck wrote:
> On 01/08/2015 10:05 AM, Nishanth Menon wrote:
> > Allow gpio-fan to be used as thermal cooling device for platforms that
> > use GPIO maps to control fans.
> >
> > As part of this change, we make the shutdown and remove logic the same
> > as well.
> >
> > Signed-off-by: Nishanth Menon <nm@ti.com>
> > ---
> 
> Applied to -next.

What is the target kernel version for this change? It didn't make
4.0-rc1

BR,

Eduardo Valentin

> 
> Thanks,
> Guenter
> 

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [PATCH V2] (gpio-fan): Add thermal control hooks
  2015-02-24 19:29     ` [lm-sensors] " Eduardo Valentin
@ 2015-02-24 19:55       ` Guenter Roeck
  -1 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2015-02-24 19:55 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Nishanth Menon, Jean Delvare, lm-sensors, linux-kernel,
	devicetree, linux-pm

On Tue, Feb 24, 2015 at 03:29:35PM -0400, Eduardo Valentin wrote:
> Guenter,
> 
> On Thu, Jan 08, 2015 at 08:48:40PM -0800, Guenter Roeck wrote:
> > On 01/08/2015 10:05 AM, Nishanth Menon wrote:
> > > Allow gpio-fan to be used as thermal cooling device for platforms that
> > > use GPIO maps to control fans.
> > >
> > > As part of this change, we make the shutdown and remove logic the same
> > > as well.
> > >
> > > Signed-off-by: Nishanth Menon <nm@ti.com>
> > > ---
> > 
> > Applied to -next.
> 
> What is the target kernel version for this change? It didn't make
> 4.0-rc1
> 
If I recall correctly, I had to pull it because the thermal framework
does not provide hooks if disabled. Weird, I am sure I sent an e-mail
about this, but I don't find it right now.

It can't make it in before the hooks are in place, or we'll need
another version with ifdefs around the thermal registration code.

Guenter

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

* Re: [lm-sensors] [PATCH V2] (gpio-fan): Add thermal control hooks
@ 2015-02-24 19:55       ` Guenter Roeck
  0 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2015-02-24 19:55 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Nishanth Menon, Jean Delvare, lm-sensors, linux-kernel,
	devicetree, linux-pm

On Tue, Feb 24, 2015 at 03:29:35PM -0400, Eduardo Valentin wrote:
> Guenter,
> 
> On Thu, Jan 08, 2015 at 08:48:40PM -0800, Guenter Roeck wrote:
> > On 01/08/2015 10:05 AM, Nishanth Menon wrote:
> > > Allow gpio-fan to be used as thermal cooling device for platforms that
> > > use GPIO maps to control fans.
> > >
> > > As part of this change, we make the shutdown and remove logic the same
> > > as well.
> > >
> > > Signed-off-by: Nishanth Menon <nm@ti.com>
> > > ---
> > 
> > Applied to -next.
> 
> What is the target kernel version for this change? It didn't make
> 4.0-rc1
> 
If I recall correctly, I had to pull it because the thermal framework
does not provide hooks if disabled. Weird, I am sure I sent an e-mail
about this, but I don't find it right now.

It can't make it in before the hooks are in place, or we'll need
another version with ifdefs around the thermal registration code.

Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [PATCH V2] (gpio-fan): Add thermal control hooks
  2015-02-24 19:55       ` [lm-sensors] " Guenter Roeck
@ 2015-02-24 19:57         ` Eduardo Valentin
  -1 siblings, 0 replies; 21+ messages in thread
From: Eduardo Valentin @ 2015-02-24 19:57 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Nishanth Menon, Jean Delvare, lm-sensors, linux-kernel,
	devicetree, linux-pm

[-- Attachment #1: Type: text/plain, Size: 1368 bytes --]

On Tue, Feb 24, 2015 at 11:55:23AM -0800, Guenter Roeck wrote:
> On Tue, Feb 24, 2015 at 03:29:35PM -0400, Eduardo Valentin wrote:
> > Guenter,
> > 
> > On Thu, Jan 08, 2015 at 08:48:40PM -0800, Guenter Roeck wrote:
> > > On 01/08/2015 10:05 AM, Nishanth Menon wrote:
> > > > Allow gpio-fan to be used as thermal cooling device for platforms that
> > > > use GPIO maps to control fans.
> > > >
> > > > As part of this change, we make the shutdown and remove logic the same
> > > > as well.
> > > >
> > > > Signed-off-by: Nishanth Menon <nm@ti.com>
> > > > ---
> > > 
> > > Applied to -next.
> > 
> > What is the target kernel version for this change? It didn't make
> > 4.0-rc1
> > 
> If I recall correctly, I had to pull it because the thermal framework
> does not provide hooks if disabled. Weird, I am sure I sent an e-mail
> about this, but I don't find it right now.
> 
> It can't make it in before the hooks are in place, or we'll need
> another version with ifdefs around the thermal registration code.

Got it!

I applied the fix that Nishanth sent to thermal.h [1]. I am planing to
send it during 4.0 rc cycles.

Thanks for the clarification.

[1] -
https://git.kernel.org/cgit/linux/kernel/git/evalenti/linux-soc-thermal.git/commit/?h=fixes&id=12ca7188468ee29c4e717f73db4bf43c90954fc7

> 
> Guenter

Eduardo Valentin

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [lm-sensors] [PATCH V2] (gpio-fan): Add thermal control hooks
@ 2015-02-24 19:57         ` Eduardo Valentin
  0 siblings, 0 replies; 21+ messages in thread
From: Eduardo Valentin @ 2015-02-24 19:57 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Nishanth Menon, Jean Delvare, lm-sensors, linux-kernel,
	devicetree, linux-pm


[-- Attachment #1.1: Type: text/plain, Size: 1368 bytes --]

On Tue, Feb 24, 2015 at 11:55:23AM -0800, Guenter Roeck wrote:
> On Tue, Feb 24, 2015 at 03:29:35PM -0400, Eduardo Valentin wrote:
> > Guenter,
> > 
> > On Thu, Jan 08, 2015 at 08:48:40PM -0800, Guenter Roeck wrote:
> > > On 01/08/2015 10:05 AM, Nishanth Menon wrote:
> > > > Allow gpio-fan to be used as thermal cooling device for platforms that
> > > > use GPIO maps to control fans.
> > > >
> > > > As part of this change, we make the shutdown and remove logic the same
> > > > as well.
> > > >
> > > > Signed-off-by: Nishanth Menon <nm@ti.com>
> > > > ---
> > > 
> > > Applied to -next.
> > 
> > What is the target kernel version for this change? It didn't make
> > 4.0-rc1
> > 
> If I recall correctly, I had to pull it because the thermal framework
> does not provide hooks if disabled. Weird, I am sure I sent an e-mail
> about this, but I don't find it right now.
> 
> It can't make it in before the hooks are in place, or we'll need
> another version with ifdefs around the thermal registration code.

Got it!

I applied the fix that Nishanth sent to thermal.h [1]. I am planing to
send it during 4.0 rc cycles.

Thanks for the clarification.

[1] -
https://git.kernel.org/cgit/linux/kernel/git/evalenti/linux-soc-thermal.git/commit/?h=fixes&id=12ca7188468ee29c4e717f73db4bf43c90954fc7

> 
> Guenter

Eduardo Valentin

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [PATCH V2] (gpio-fan): Add thermal control hooks
  2015-02-24 19:55       ` [lm-sensors] " Guenter Roeck
@ 2015-02-24 20:06         ` Nishanth Menon
  -1 siblings, 0 replies; 21+ messages in thread
From: Nishanth Menon @ 2015-02-24 20:06 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Eduardo Valentin, Jean Delvare, lm-sensors, lkml, dt list, linux-pm

On Tue, Feb 24, 2015 at 1:55 PM, Guenter Roeck <linux@roeck-us.net> wrote:
> On Tue, Feb 24, 2015 at 03:29:35PM -0400, Eduardo Valentin wrote:
>> Guenter,
>>
>> On Thu, Jan 08, 2015 at 08:48:40PM -0800, Guenter Roeck wrote:
>> > On 01/08/2015 10:05 AM, Nishanth Menon wrote:
>> > > Allow gpio-fan to be used as thermal cooling device for platforms that
>> > > use GPIO maps to control fans.
>> > >
>> > > As part of this change, we make the shutdown and remove logic the same
>> > > as well.
>> > >
>> > > Signed-off-by: Nishanth Menon <nm@ti.com>
>> > > ---
>> >
>> > Applied to -next.
>>
>> What is the target kernel version for this change? It didn't make
>> 4.0-rc1
>>
> If I recall correctly, I had to pull it because the thermal framework
> does not provide hooks if disabled. Weird, I am sure I sent an e-mail
> about this, but I don't find it right now.
>
> It can't make it in before the hooks are in place, or we'll need
> another version with ifdefs around the thermal registration code.

I had posted the required hooks.
https://patchwork.kernel.org/patch/5828261/ -> I think Eduardo picked
this one up.. So once it hits mainline, we should ideally be clear.

-- 
---
Regards,
Nishanth Menon

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

* Re: [lm-sensors] [PATCH V2] (gpio-fan): Add thermal control hooks
@ 2015-02-24 20:06         ` Nishanth Menon
  0 siblings, 0 replies; 21+ messages in thread
From: Nishanth Menon @ 2015-02-24 20:06 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Eduardo Valentin, Jean Delvare, lm-sensors, lkml, dt list, linux-pm

On Tue, Feb 24, 2015 at 1:55 PM, Guenter Roeck <linux@roeck-us.net> wrote:
> On Tue, Feb 24, 2015 at 03:29:35PM -0400, Eduardo Valentin wrote:
>> Guenter,
>>
>> On Thu, Jan 08, 2015 at 08:48:40PM -0800, Guenter Roeck wrote:
>> > On 01/08/2015 10:05 AM, Nishanth Menon wrote:
>> > > Allow gpio-fan to be used as thermal cooling device for platforms that
>> > > use GPIO maps to control fans.
>> > >
>> > > As part of this change, we make the shutdown and remove logic the same
>> > > as well.
>> > >
>> > > Signed-off-by: Nishanth Menon <nm@ti.com>
>> > > ---
>> >
>> > Applied to -next.
>>
>> What is the target kernel version for this change? It didn't make
>> 4.0-rc1
>>
> If I recall correctly, I had to pull it because the thermal framework
> does not provide hooks if disabled. Weird, I am sure I sent an e-mail
> about this, but I don't find it right now.
>
> It can't make it in before the hooks are in place, or we'll need
> another version with ifdefs around the thermal registration code.

I had posted the required hooks.
https://patchwork.kernel.org/patch/5828261/ -> I think Eduardo picked
this one up.. So once it hits mainline, we should ideally be clear.

-- 
---
Regards,
Nishanth Menon

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [PATCH V2] (gpio-fan): Add thermal control hooks
  2015-02-24 20:06         ` [lm-sensors] " Nishanth Menon
  (?)
@ 2015-03-03 17:09           ` Nishanth Menon
  -1 siblings, 0 replies; 21+ messages in thread
From: Nishanth Menon @ 2015-03-03 17:09 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Eduardo Valentin, Jean Delvare, lm-sensors, lkml, dt list, linux-pm

On 02/24/2015 02:06 PM, Nishanth Menon wrote:
> On Tue, Feb 24, 2015 at 1:55 PM, Guenter Roeck <linux@roeck-us.net> wrote:
>> On Tue, Feb 24, 2015 at 03:29:35PM -0400, Eduardo Valentin wrote:
>>> Guenter,
>>>
>>> On Thu, Jan 08, 2015 at 08:48:40PM -0800, Guenter Roeck wrote:
>>>> On 01/08/2015 10:05 AM, Nishanth Menon wrote:
>>>>> Allow gpio-fan to be used as thermal cooling device for platforms that
>>>>> use GPIO maps to control fans.
>>>>>
>>>>> As part of this change, we make the shutdown and remove logic the same
>>>>> as well.
>>>>>
>>>>> Signed-off-by: Nishanth Menon <nm@ti.com>
>>>>> ---
>>>>
>>>> Applied to -next.
>>>
>>> What is the target kernel version for this change? It didn't make
>>> 4.0-rc1
>>>
>> If I recall correctly, I had to pull it because the thermal framework
>> does not provide hooks if disabled. Weird, I am sure I sent an e-mail
>> about this, but I don't find it right now.
>>
>> It can't make it in before the hooks are in place, or we'll need
>> another version with ifdefs around the thermal registration code.
> 
> I had posted the required hooks.
> https://patchwork.kernel.org/patch/5828261/ -> I think Eduardo picked
> this one up.. So once it hits mainline, we should ideally be clear.
> 
merged as 12ca7188468ee29c4e717f73db4bf43c90954fc7 upstream. Can we
pick up this patch now?

-- 
Regards,
Nishanth Menon

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

* Re: [PATCH V2] (gpio-fan): Add thermal control hooks
@ 2015-03-03 17:09           ` Nishanth Menon
  0 siblings, 0 replies; 21+ messages in thread
From: Nishanth Menon @ 2015-03-03 17:09 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Eduardo Valentin, Jean Delvare, lm-sensors, lkml, dt list, linux-pm

On 02/24/2015 02:06 PM, Nishanth Menon wrote:
> On Tue, Feb 24, 2015 at 1:55 PM, Guenter Roeck <linux@roeck-us.net> wrote:
>> On Tue, Feb 24, 2015 at 03:29:35PM -0400, Eduardo Valentin wrote:
>>> Guenter,
>>>
>>> On Thu, Jan 08, 2015 at 08:48:40PM -0800, Guenter Roeck wrote:
>>>> On 01/08/2015 10:05 AM, Nishanth Menon wrote:
>>>>> Allow gpio-fan to be used as thermal cooling device for platforms that
>>>>> use GPIO maps to control fans.
>>>>>
>>>>> As part of this change, we make the shutdown and remove logic the same
>>>>> as well.
>>>>>
>>>>> Signed-off-by: Nishanth Menon <nm@ti.com>
>>>>> ---
>>>>
>>>> Applied to -next.
>>>
>>> What is the target kernel version for this change? It didn't make
>>> 4.0-rc1
>>>
>> If I recall correctly, I had to pull it because the thermal framework
>> does not provide hooks if disabled. Weird, I am sure I sent an e-mail
>> about this, but I don't find it right now.
>>
>> It can't make it in before the hooks are in place, or we'll need
>> another version with ifdefs around the thermal registration code.
> 
> I had posted the required hooks.
> https://patchwork.kernel.org/patch/5828261/ -> I think Eduardo picked
> this one up.. So once it hits mainline, we should ideally be clear.
> 
merged as 12ca7188468ee29c4e717f73db4bf43c90954fc7 upstream. Can we
pick up this patch now?

-- 
Regards,
Nishanth Menon

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

* Re: [lm-sensors] [PATCH V2] (gpio-fan): Add thermal control hooks
@ 2015-03-03 17:09           ` Nishanth Menon
  0 siblings, 0 replies; 21+ messages in thread
From: Nishanth Menon @ 2015-03-03 17:09 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Eduardo Valentin, Jean Delvare, lm-sensors, lkml, dt list, linux-pm

On 02/24/2015 02:06 PM, Nishanth Menon wrote:
> On Tue, Feb 24, 2015 at 1:55 PM, Guenter Roeck <linux@roeck-us.net> wrote:
>> On Tue, Feb 24, 2015 at 03:29:35PM -0400, Eduardo Valentin wrote:
>>> Guenter,
>>>
>>> On Thu, Jan 08, 2015 at 08:48:40PM -0800, Guenter Roeck wrote:
>>>> On 01/08/2015 10:05 AM, Nishanth Menon wrote:
>>>>> Allow gpio-fan to be used as thermal cooling device for platforms that
>>>>> use GPIO maps to control fans.
>>>>>
>>>>> As part of this change, we make the shutdown and remove logic the same
>>>>> as well.
>>>>>
>>>>> Signed-off-by: Nishanth Menon <nm@ti.com>
>>>>> ---
>>>>
>>>> Applied to -next.
>>>
>>> What is the target kernel version for this change? It didn't make
>>> 4.0-rc1
>>>
>> If I recall correctly, I had to pull it because the thermal framework
>> does not provide hooks if disabled. Weird, I am sure I sent an e-mail
>> about this, but I don't find it right now.
>>
>> It can't make it in before the hooks are in place, or we'll need
>> another version with ifdefs around the thermal registration code.
> 
> I had posted the required hooks.
> https://patchwork.kernel.org/patch/5828261/ -> I think Eduardo picked
> this one up.. So once it hits mainline, we should ideally be clear.
> 
merged as 12ca7188468ee29c4e717f73db4bf43c90954fc7 upstream. Can we
pick up this patch now?

-- 
Regards,
Nishanth Menon

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [PATCH V2] (gpio-fan): Add thermal control hooks
  2015-03-03 17:09           ` Nishanth Menon
@ 2015-03-03 17:32             ` Guenter Roeck
  -1 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2015-03-03 17:32 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Eduardo Valentin, Jean Delvare, lm-sensors, lkml, dt list, linux-pm

On 03/03/2015 09:09 AM, Nishanth Menon wrote:
> On 02/24/2015 02:06 PM, Nishanth Menon wrote:
>> On Tue, Feb 24, 2015 at 1:55 PM, Guenter Roeck <linux@roeck-us.net> wrote:
>>> On Tue, Feb 24, 2015 at 03:29:35PM -0400, Eduardo Valentin wrote:
>>>> Guenter,
>>>>
>>>> On Thu, Jan 08, 2015 at 08:48:40PM -0800, Guenter Roeck wrote:
>>>>> On 01/08/2015 10:05 AM, Nishanth Menon wrote:
>>>>>> Allow gpio-fan to be used as thermal cooling device for platforms that
>>>>>> use GPIO maps to control fans.
>>>>>>
>>>>>> As part of this change, we make the shutdown and remove logic the same
>>>>>> as well.
>>>>>>
>>>>>> Signed-off-by: Nishanth Menon <nm@ti.com>
>>>>>> ---
>>>>>
>>>>> Applied to -next.
>>>>
>>>> What is the target kernel version for this change? It didn't make
>>>> 4.0-rc1
>>>>
>>> If I recall correctly, I had to pull it because the thermal framework
>>> does not provide hooks if disabled. Weird, I am sure I sent an e-mail
>>> about this, but I don't find it right now.
>>>
>>> It can't make it in before the hooks are in place, or we'll need
>>> another version with ifdefs around the thermal registration code.
>>
>> I had posted the required hooks.
>> https://patchwork.kernel.org/patch/5828261/ -> I think Eduardo picked
>> this one up.. So once it hits mainline, we should ideally be clear.
>>
> merged as 12ca7188468ee29c4e717f73db4bf43c90954fc7 upstream. Can we
> pick up this patch now?
>

Done, currently testing. Should make its way into -next in a couple of days
unless there are unexpected problems.

Guenter


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

* Re: [lm-sensors] [PATCH V2] (gpio-fan): Add thermal control hooks
@ 2015-03-03 17:32             ` Guenter Roeck
  0 siblings, 0 replies; 21+ messages in thread
From: Guenter Roeck @ 2015-03-03 17:32 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Eduardo Valentin, Jean Delvare, lm-sensors, lkml, dt list, linux-pm

On 03/03/2015 09:09 AM, Nishanth Menon wrote:
> On 02/24/2015 02:06 PM, Nishanth Menon wrote:
>> On Tue, Feb 24, 2015 at 1:55 PM, Guenter Roeck <linux@roeck-us.net> wrote:
>>> On Tue, Feb 24, 2015 at 03:29:35PM -0400, Eduardo Valentin wrote:
>>>> Guenter,
>>>>
>>>> On Thu, Jan 08, 2015 at 08:48:40PM -0800, Guenter Roeck wrote:
>>>>> On 01/08/2015 10:05 AM, Nishanth Menon wrote:
>>>>>> Allow gpio-fan to be used as thermal cooling device for platforms that
>>>>>> use GPIO maps to control fans.
>>>>>>
>>>>>> As part of this change, we make the shutdown and remove logic the same
>>>>>> as well.
>>>>>>
>>>>>> Signed-off-by: Nishanth Menon <nm@ti.com>
>>>>>> ---
>>>>>
>>>>> Applied to -next.
>>>>
>>>> What is the target kernel version for this change? It didn't make
>>>> 4.0-rc1
>>>>
>>> If I recall correctly, I had to pull it because the thermal framework
>>> does not provide hooks if disabled. Weird, I am sure I sent an e-mail
>>> about this, but I don't find it right now.
>>>
>>> It can't make it in before the hooks are in place, or we'll need
>>> another version with ifdefs around the thermal registration code.
>>
>> I had posted the required hooks.
>> https://patchwork.kernel.org/patch/5828261/ -> I think Eduardo picked
>> this one up.. So once it hits mainline, we should ideally be clear.
>>
> merged as 12ca7188468ee29c4e717f73db4bf43c90954fc7 upstream. Can we
> pick up this patch now?
>

Done, currently testing. Should make its way into -next in a couple of days
unless there are unexpected problems.

Guenter


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

end of thread, other threads:[~2015-03-03 17:32 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-08 18:05 [PATCH V2] (gpio-fan): Add thermal control hooks Nishanth Menon
2015-01-08 18:05 ` [lm-sensors] " Nishanth Menon
2015-01-08 18:05 ` Nishanth Menon
2015-01-09  4:48 ` Guenter Roeck
2015-01-09  4:48   ` [lm-sensors] " Guenter Roeck
2015-02-24 19:29   ` Eduardo Valentin
2015-02-24 19:29     ` [lm-sensors] " Eduardo Valentin
2015-02-24 19:55     ` Guenter Roeck
2015-02-24 19:55       ` [lm-sensors] " Guenter Roeck
2015-02-24 19:57       ` Eduardo Valentin
2015-02-24 19:57         ` [lm-sensors] " Eduardo Valentin
2015-02-24 20:06       ` Nishanth Menon
2015-02-24 20:06         ` [lm-sensors] " Nishanth Menon
2015-03-03 17:09         ` Nishanth Menon
2015-03-03 17:09           ` [lm-sensors] " Nishanth Menon
2015-03-03 17:09           ` Nishanth Menon
2015-03-03 17:32           ` Guenter Roeck
2015-03-03 17:32             ` [lm-sensors] " Guenter Roeck
2015-01-09 11:46 ` Eduardo Valentin
2015-01-09 11:46   ` [lm-sensors] " Eduardo Valentin
2015-01-09 11:46   ` Eduardo Valentin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.