Thermal: Introduce simple arbitrator for setting device cooling state
authorZhang Rui <rui.zhang@intel.com>
Wed, 27 Jun 2012 06:13:04 +0000 (14:13 +0800)
committerSimone Willett <swillett@nvidia.com>
Mon, 5 Nov 2012 18:10:22 +0000 (10:10 -0800)
commitfc08f7e7584cfd4af4eb067f0081162f02e4d53f
tree40100a0880792ee23ebb7d4592ec196097b39367
parent8e47bf314910ef85bafbbabe673bd1a5b3d28627
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.

bug 1059470

Change-Id: I07b503a2c2ca61f4e5b4b2e6828209def480f5a8
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>
Reviewed-on: http://git-master/r/160233
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Joshua Primero <jprimero@nvidia.com>
Tested-by: Joshua Primero <jprimero@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
drivers/thermal/thermal_sys.c
include/linux/thermal.h