diff options
author | Eduardo Valentin <eduardo.valentin@ti.com> | 2013-07-03 15:35:39 -0400 |
---|---|---|
committer | Eduardo Valentin <eduardo.valentin@ti.com> | 2013-12-04 09:31:34 -0400 |
commit | 4e5e4705bf69ea450f58fc709ac5888f321a9299 (patch) | |
tree | 523e7c5a3f5459acdd5b81d81b0deeb68de79dc0 /drivers/thermal/thermal_core.c | |
parent | 81bd4e1cebed5efb85bd94a15342ee4d6965a416 (diff) | |
download | linux-4e5e4705bf69ea450f58fc709ac5888f321a9299.tar.gz linux-4e5e4705bf69ea450f58fc709ac5888f321a9299.tar.bz2 linux-4e5e4705bf69ea450f58fc709ac5888f321a9299.zip |
thermal: introduce device tree parser
This patch introduces a device tree bindings for
describing the hardware thermal behavior and limits.
Also a parser to read and interpret the data and feed
it in the thermal framework is presented.
This patch introduces a thermal data parser for device
tree. The parsed data is used to build thermal zones
and thermal binding parameters. The output data
can then be used to deploy thermal policies.
This patch adds also documentation regarding this
API and how to define tree nodes to use
this infrastructure.
Note that, in order to be able to have control
on the sensor registration on the DT thermal zone,
it was required to allow changing the thermal zone
.get_temp callback. For this reason, this patch
also removes the 'const' modifier from the .ops
field of thermal zone devices.
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Diffstat (limited to 'drivers/thermal/thermal_core.c')
-rw-r--r-- | drivers/thermal/thermal_core.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 0e43dc208fc6..3392fcb92796 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1373,7 +1373,7 @@ static void remove_trip_attrs(struct thermal_zone_device *tz) */ struct thermal_zone_device *thermal_zone_device_register(const char *type, int trips, int mask, void *devdata, - const struct thermal_zone_device_ops *ops, + struct thermal_zone_device_ops *ops, const struct thermal_zone_params *tzp, int passive_delay, int polling_delay) { @@ -1746,8 +1746,14 @@ static int __init thermal_init(void) if (result) goto unregister_class; + result = of_parse_thermal_zones(); + if (result) + goto exit_netlink; + return 0; +exit_netlink: + genetlink_exit(); unregister_governors: thermal_unregister_governors(); unregister_class: @@ -1763,6 +1769,7 @@ error: static void __exit thermal_exit(void) { + of_thermal_destroy_zones(); genetlink_exit(); class_unregister(&thermal_class); thermal_unregister_governors(); |