aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorKapileshwar Singh <[email protected]>2015-02-18 16:04:21 +0000
committerEduardo Valentin <[email protected]>2015-05-04 21:27:50 -0700
commit6cd9e9f629f11b9412d4e9aa294c029dbb36b3cf (patch)
tree33ef735ad3704b0596eab47e24a22853ca9c31a1 /include/linux
parent5ebe6afaf0057ac3eaeb98defd5456894b446d22 (diff)
thermal: of: fix cooling device weights in device tree
Currently you can specify the weight of the cooling device in the device tree but that information is not populated to the thermal_bind_params where the fair share governor expects it to be. The of thermal zone device doesn't have a thermal_bind_params structure and arguably it's better to pass the weight inside the thermal_instance as it is specific to the bind of a cooling device to a thermal zone parameter. Core thermal code is fixed to populate the weight in the instance from the thermal_bind_params, so platform code that was passing the weight inside the thermal_bind_params continue to work seamlessly. While we are at it, create a default value for the weight parameter for those thermal zones that currently don't define it and remove the hardcoded default in of-thermal. Cc: Zhang Rui <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Len Brown <[email protected]> Cc: Peter Feuerer <[email protected]> Cc: Darren Hart <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Kukjin Kim <[email protected]> Cc: Durgadoss R <[email protected]> Signed-off-by: Kapileshwar Singh <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/thermal.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 5eac316490ea..00dacd4dfdce 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -40,6 +40,9 @@
/* No upper/lower limit requirement */
#define THERMAL_NO_LIMIT ((u32)~0)
+/* Default weight of a bound cooling device */
+#define THERMAL_WEIGHT_DEFAULT 0
+
/* Unit conversion macros */
#define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732 >= 0) ? \
((long)t-2732+5)/10 : ((long)t-2732-5)/10)
@@ -323,7 +326,8 @@ void thermal_zone_device_unregister(struct thermal_zone_device *);
int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
struct thermal_cooling_device *,
- unsigned long, unsigned long);
+ unsigned long, unsigned long,
+ unsigned int);
int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int,
struct thermal_cooling_device *);
void thermal_zone_device_update(struct thermal_zone_device *);