linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Thermal: thermal API cleanup
@ 2013-04-17 15:18 Zhang Rui
  2013-04-17 16:17 ` R, Durgadoss
  2013-04-17 17:13 ` Eduardo Valentin
  0 siblings, 2 replies; 3+ messages in thread
From: Zhang Rui @ 2013-04-17 15:18 UTC (permalink / raw)
  To: Linux PM list; +Cc: eduardo, Zhang, Rui

>From d6db6ba9831d07338e11d4821febec4ef3cdf8f6 Mon Sep 17 00:00:00 2001
From: Zhang Rui <rui.zhang@intel.com>
Date: Wed, 17 Apr 2013 23:12:40 +0800
Subject: [PATCH] Thermal: thermal API cleanup

We build all the thermal governors into thermal module,
thus a couple of APIs should be cleaned up as they are used
by thermal governors only.

Cleanup for get_tz_trend(), get_thermal_instance(),
and thermal_cdev_update(), in this patch.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
 Documentation/thermal/sysfs-api.txt |   19 +------------------
 drivers/thermal/thermal_core.c      |    3 ---
 drivers/thermal/thermal_core.h      |    5 +++++
 include/linux/thermal.h             |    4 ----
 4 files changed, 6 insertions(+), 25 deletions(-)

diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt
index b2ffe98..4dcc4c7 100644
--- a/Documentation/thermal/sysfs-api.txt
+++ b/Documentation/thermal/sysfs-api.txt
@@ -355,27 +355,10 @@ crosses any of the configured thresholds.
 
 5. Export Symbol APIs:
 
-5.1: get_tz_trend:
-This function returns the trend of a thermal zone, i.e the rate of change
-of temperature of the thermal zone. Ideally, the thermal sensor drivers
-are supposed to implement the callback. If they don't, the thermal
-framework calculated the trend by comparing the previous and the current
-temperature values.
-
-5.2:get_thermal_instance:
-This function returns the thermal_instance corresponding to a given
-{thermal_zone, cooling_device, trip_point} combination. Returns NULL
-if such an instance does not exist.
-
-5.3:notify_thermal_framework:
+5.1:notify_thermal_framework:
 This function handles the trip events from sensor drivers. It starts
 throttling the cooling devices according to the policy configured.
 For CRITICAL and HOT trip points, this notifies the respective drivers,
 and does actual throttling for other trip points i.e ACTIVE and PASSIVE.
 The throttling policy is based on the configured platform data; if no
 platform data is provided, this uses the step_wise throttling policy.
-
-5.4:thermal_cdev_update:
-This function serves as an arbitrator to set the state of a cooling
-device. It sets the cooling device to the deepest cooling state if
-possible.
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 4cdc3e3..ac380fc 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -166,7 +166,6 @@ int get_tz_trend(struct thermal_zone_device *tz, int trip)
 
 	return trend;
 }
-EXPORT_SYMBOL(get_tz_trend);
 
 struct thermal_instance *get_thermal_instance(struct thermal_zone_device *tz,
 			struct thermal_cooling_device *cdev, int trip)
@@ -189,7 +188,6 @@ struct thermal_instance *get_thermal_instance(struct thermal_zone_device *tz,
 
 	return target_instance;
 }
-EXPORT_SYMBOL(get_thermal_instance);
 
 static void print_bind_err_msg(struct thermal_zone_device *tz,
 			struct thermal_cooling_device *cdev, int ret)
@@ -1415,7 +1413,6 @@ void thermal_cdev_update(struct thermal_cooling_device *cdev)
 	cdev->ops->set_cur_state(cdev, target);
 	cdev->updated = true;
 }
-EXPORT_SYMBOL(thermal_cdev_update);
 
 /**
  * notify_thermal_framework - Sensor drivers use this API to notify framework
diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index 7cf2f66..0bb98d2 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -50,6 +50,11 @@ struct thermal_instance {
 	struct list_head cdev_node; /* node in cdev->thermal_instances */
 };
 
+int get_tz_trend(struct thermal_zone_device *, int);
+struct thermal_instance *get_thermal_instance(struct thermal_zone_device *,
+                struct thermal_cooling_device *, int);
+void thermal_cdev_update(struct thermal_cooling_device *);
+
 int thermal_register_governor(struct thermal_governor *);
 void thermal_unregister_governor(struct thermal_governor *);
 
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 4445b95..097e674 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -240,10 +240,6 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
 		const struct thermal_cooling_device_ops *);
 void thermal_cooling_device_unregister(struct thermal_cooling_device *);
 
-int get_tz_trend(struct thermal_zone_device *, int);
-struct thermal_instance *get_thermal_instance(struct thermal_zone_device *,
-		struct thermal_cooling_device *, int);
-void thermal_cdev_update(struct thermal_cooling_device *);
 void notify_thermal_framework(struct thermal_zone_device *, int);
 
 #ifdef CONFIG_NET
-- 
1.7.9.5




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

* RE: [PATCH] Thermal: thermal API cleanup
  2013-04-17 15:18 [PATCH] Thermal: thermal API cleanup Zhang Rui
@ 2013-04-17 16:17 ` R, Durgadoss
  2013-04-17 17:13 ` Eduardo Valentin
  1 sibling, 0 replies; 3+ messages in thread
From: R, Durgadoss @ 2013-04-17 16:17 UTC (permalink / raw)
  To: Linux PM list; +Cc: eduardo, Zhang, Rui

> -----Original Message-----
> From: linux-pm-owner@vger.kernel.org [mailto:linux-pm-
> owner@vger.kernel.org] On Behalf Of Zhang Rui
> Sent: Wednesday, April 17, 2013 8:49 PM
> To: Linux PM list
> Cc: eduardo; Zhang, Rui
> Subject: [PATCH] Thermal: thermal API cleanup
> 
> From d6db6ba9831d07338e11d4821febec4ef3cdf8f6 Mon Sep 17 00:00:00
> 2001
> From: Zhang Rui <rui.zhang@intel.com>
> Date: Wed, 17 Apr 2013 23:12:40 +0800
> Subject: [PATCH] Thermal: thermal API cleanup
> 
> We build all the thermal governors into thermal module,
> thus a couple of APIs should be cleaned up as they are used
> by thermal governors only.
> 
> Cleanup for get_tz_trend(), get_thermal_instance(),
> and thermal_cdev_update(), in this patch.
> 
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Looks good to me,
Acked-by: Durgadoss R <durgadoss.r@intel.com>

Thanks,
Durga

> ---
>  Documentation/thermal/sysfs-api.txt |   19 +------------------
>  drivers/thermal/thermal_core.c      |    3 ---
>  drivers/thermal/thermal_core.h      |    5 +++++
>  include/linux/thermal.h             |    4 ----
>  4 files changed, 6 insertions(+), 25 deletions(-)
> 
> diff --git a/Documentation/thermal/sysfs-api.txt
> b/Documentation/thermal/sysfs-api.txt
> index b2ffe98..4dcc4c7 100644
> --- a/Documentation/thermal/sysfs-api.txt
> +++ b/Documentation/thermal/sysfs-api.txt
> @@ -355,27 +355,10 @@ crosses any of the configured thresholds.
> 
>  5. Export Symbol APIs:
> 
> -5.1: get_tz_trend:
> -This function returns the trend of a thermal zone, i.e the rate of change
> -of temperature of the thermal zone. Ideally, the thermal sensor drivers
> -are supposed to implement the callback. If they don't, the thermal
> -framework calculated the trend by comparing the previous and the current
> -temperature values.
> -
> -5.2:get_thermal_instance:
> -This function returns the thermal_instance corresponding to a given
> -{thermal_zone, cooling_device, trip_point} combination. Returns NULL
> -if such an instance does not exist.
> -
> -5.3:notify_thermal_framework:
> +5.1:notify_thermal_framework:
>  This function handles the trip events from sensor drivers. It starts
>  throttling the cooling devices according to the policy configured.
>  For CRITICAL and HOT trip points, this notifies the respective drivers,
>  and does actual throttling for other trip points i.e ACTIVE and PASSIVE.
>  The throttling policy is based on the configured platform data; if no
>  platform data is provided, this uses the step_wise throttling policy.
> -
> -5.4:thermal_cdev_update:
> -This function serves as an arbitrator to set the state of a cooling
> -device. It sets the cooling device to the deepest cooling state if
> -possible.
> diff --git a/drivers/thermal/thermal_core.c
> b/drivers/thermal/thermal_core.c
> index 4cdc3e3..ac380fc 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -166,7 +166,6 @@ int get_tz_trend(struct thermal_zone_device *tz, int
> trip)
> 
>  	return trend;
>  }
> -EXPORT_SYMBOL(get_tz_trend);
> 
>  struct thermal_instance *get_thermal_instance(struct
> thermal_zone_device *tz,
>  			struct thermal_cooling_device *cdev, int trip)
> @@ -189,7 +188,6 @@ struct thermal_instance
> *get_thermal_instance(struct thermal_zone_device *tz,
> 
>  	return target_instance;
>  }
> -EXPORT_SYMBOL(get_thermal_instance);
> 
>  static void print_bind_err_msg(struct thermal_zone_device *tz,
>  			struct thermal_cooling_device *cdev, int ret)
> @@ -1415,7 +1413,6 @@ void thermal_cdev_update(struct
> thermal_cooling_device *cdev)
>  	cdev->ops->set_cur_state(cdev, target);
>  	cdev->updated = true;
>  }
> -EXPORT_SYMBOL(thermal_cdev_update);
> 
>  /**
>   * notify_thermal_framework - Sensor drivers use this API to notify
> framework
> diff --git a/drivers/thermal/thermal_core.h
> b/drivers/thermal/thermal_core.h
> index 7cf2f66..0bb98d2 100644
> --- a/drivers/thermal/thermal_core.h
> +++ b/drivers/thermal/thermal_core.h
> @@ -50,6 +50,11 @@ struct thermal_instance {
>  	struct list_head cdev_node; /* node in cdev->thermal_instances */
>  };
> 
> +int get_tz_trend(struct thermal_zone_device *, int);
> +struct thermal_instance *get_thermal_instance(struct
> thermal_zone_device *,
> +                struct thermal_cooling_device *, int);
> +void thermal_cdev_update(struct thermal_cooling_device *);
> +
>  int thermal_register_governor(struct thermal_governor *);
>  void thermal_unregister_governor(struct thermal_governor *);
> 
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index 4445b95..097e674 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -240,10 +240,6 @@ struct thermal_cooling_device
> *thermal_cooling_device_register(char *, void *,
>  		const struct thermal_cooling_device_ops *);
>  void thermal_cooling_device_unregister(struct thermal_cooling_device *);
> 
> -int get_tz_trend(struct thermal_zone_device *, int);
> -struct thermal_instance *get_thermal_instance(struct
> thermal_zone_device *,
> -		struct thermal_cooling_device *, int);
> -void thermal_cdev_update(struct thermal_cooling_device *);
>  void notify_thermal_framework(struct thermal_zone_device *, int);
> 
>  #ifdef CONFIG_NET
> --
> 1.7.9.5
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] Thermal: thermal API cleanup
  2013-04-17 15:18 [PATCH] Thermal: thermal API cleanup Zhang Rui
  2013-04-17 16:17 ` R, Durgadoss
@ 2013-04-17 17:13 ` Eduardo Valentin
  1 sibling, 0 replies; 3+ messages in thread
From: Eduardo Valentin @ 2013-04-17 17:13 UTC (permalink / raw)
  To: Zhang Rui; +Cc: Linux PM list, eduardo

Rui,

On 17-04-2013 11:18, Zhang Rui wrote:
>>From d6db6ba9831d07338e11d4821febec4ef3cdf8f6 Mon Sep 17 00:00:00 2001
> From: Zhang Rui <rui.zhang@intel.com>
> Date: Wed, 17 Apr 2013 23:12:40 +0800
> Subject: [PATCH] Thermal: thermal API cleanup
>
> We build all the thermal governors into thermal module,
> thus a couple of APIs should be cleaned up as they are used
> by thermal governors only.
>
> Cleanup for get_tz_trend(), get_thermal_instance(),
> and thermal_cdev_update(), in this patch.
>
> Signed-off-by: Zhang Rui <rui.zhang@intel.com>

Acked-by: Eduardo Valentin <eduardo.valentin@ti.com>

> ---
>   Documentation/thermal/sysfs-api.txt |   19 +------------------
>   drivers/thermal/thermal_core.c      |    3 ---
>   drivers/thermal/thermal_core.h      |    5 +++++
>   include/linux/thermal.h             |    4 ----
>   4 files changed, 6 insertions(+), 25 deletions(-)
>
> diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.txt
> index b2ffe98..4dcc4c7 100644
> --- a/Documentation/thermal/sysfs-api.txt
> +++ b/Documentation/thermal/sysfs-api.txt
> @@ -355,27 +355,10 @@ crosses any of the configured thresholds.
>
>   5. Export Symbol APIs:
>
> -5.1: get_tz_trend:
> -This function returns the trend of a thermal zone, i.e the rate of change
> -of temperature of the thermal zone. Ideally, the thermal sensor drivers
> -are supposed to implement the callback. If they don't, the thermal
> -framework calculated the trend by comparing the previous and the current
> -temperature values.
> -
> -5.2:get_thermal_instance:
> -This function returns the thermal_instance corresponding to a given
> -{thermal_zone, cooling_device, trip_point} combination. Returns NULL
> -if such an instance does not exist.
> -
> -5.3:notify_thermal_framework:
> +5.1:notify_thermal_framework:
>   This function handles the trip events from sensor drivers. It starts
>   throttling the cooling devices according to the policy configured.
>   For CRITICAL and HOT trip points, this notifies the respective drivers,
>   and does actual throttling for other trip points i.e ACTIVE and PASSIVE.
>   The throttling policy is based on the configured platform data; if no
>   platform data is provided, this uses the step_wise throttling policy.
> -
> -5.4:thermal_cdev_update:
> -This function serves as an arbitrator to set the state of a cooling
> -device. It sets the cooling device to the deepest cooling state if
> -possible.
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 4cdc3e3..ac380fc 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -166,7 +166,6 @@ int get_tz_trend(struct thermal_zone_device *tz, int trip)
>
>   	return trend;
>   }
> -EXPORT_SYMBOL(get_tz_trend);
>
>   struct thermal_instance *get_thermal_instance(struct thermal_zone_device *tz,
>   			struct thermal_cooling_device *cdev, int trip)
> @@ -189,7 +188,6 @@ struct thermal_instance *get_thermal_instance(struct thermal_zone_device *tz,
>
>   	return target_instance;
>   }
> -EXPORT_SYMBOL(get_thermal_instance);
>
>   static void print_bind_err_msg(struct thermal_zone_device *tz,
>   			struct thermal_cooling_device *cdev, int ret)
> @@ -1415,7 +1413,6 @@ void thermal_cdev_update(struct thermal_cooling_device *cdev)
>   	cdev->ops->set_cur_state(cdev, target);
>   	cdev->updated = true;
>   }
> -EXPORT_SYMBOL(thermal_cdev_update);
>
>   /**
>    * notify_thermal_framework - Sensor drivers use this API to notify framework
> diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
> index 7cf2f66..0bb98d2 100644
> --- a/drivers/thermal/thermal_core.h
> +++ b/drivers/thermal/thermal_core.h
> @@ -50,6 +50,11 @@ struct thermal_instance {
>   	struct list_head cdev_node; /* node in cdev->thermal_instances */
>   };
>
> +int get_tz_trend(struct thermal_zone_device *, int);
> +struct thermal_instance *get_thermal_instance(struct thermal_zone_device *,
> +                struct thermal_cooling_device *, int);
> +void thermal_cdev_update(struct thermal_cooling_device *);
> +
>   int thermal_register_governor(struct thermal_governor *);
>   void thermal_unregister_governor(struct thermal_governor *);
>
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index 4445b95..097e674 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -240,10 +240,6 @@ struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
>   		const struct thermal_cooling_device_ops *);
>   void thermal_cooling_device_unregister(struct thermal_cooling_device *);
>
> -int get_tz_trend(struct thermal_zone_device *, int);
> -struct thermal_instance *get_thermal_instance(struct thermal_zone_device *,
> -		struct thermal_cooling_device *, int);
> -void thermal_cdev_update(struct thermal_cooling_device *);
>   void notify_thermal_framework(struct thermal_zone_device *, int);
>
>   #ifdef CONFIG_NET
>


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

end of thread, other threads:[~2013-04-17 17:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-17 15:18 [PATCH] Thermal: thermal API cleanup Zhang Rui
2013-04-17 16:17 ` R, Durgadoss
2013-04-17 17:13 ` Eduardo Valentin

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).