Thermal: Introduce simple arbitrator for setting device cooling state

This fixes the problem that a cooling device may be referenced by
by multiple trip points in multiple thermal zones.

With this patch, we have two stages for updating a thermal zone,
1. check if a thermal_instance needs to be updated or not
2. update the cooling device, based on the target cooling state
   of all its instances.

Note that, currently, the cooling device is set to the deepest
cooling state required.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: Eduardo Valentin <eduardo.valentin@ti.com>
This commit is contained in:
Zhang Rui
2012-06-27 14:13:04 +08:00
parent b5e4ae620b
commit ce119f8325
2 changed files with 42 additions and 3 deletions

View File

@@ -94,6 +94,7 @@ struct thermal_cooling_device {
struct device device;
void *devdata;
const struct thermal_cooling_device_ops *ops;
bool updated; /* true if the cooling device does not need update */
struct list_head thermal_instances;
struct list_head node;
};