From dd6e683e308d39fc697cd58e854fdcd13100e57c Mon Sep 17 00:00:00 2001 From: Hyungwoo Yang Date: Tue, 25 Nov 2014 15:08:54 -0800 Subject: tegra: therm_est: support multiple sets of coefficients Edit original commit to use 'thermal_zone_of_device_ops'. enable multlple sets of coefficients. Bug 1582735 (cherry-picked from commit If0c31037fdf1d8004c9ee241e0387ceef1bb022f) Signed-off-by: Hyungwoo Yang Reviewed-on: http://git-master/r/655573 Change-Id: If8ec11e80238f70227d473891076a04a8cd1301d Signed-off-by: Srikar Srimath Tirumala --- include/linux/therm_est.h | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'include/linux') diff --git a/include/linux/therm_est.h b/include/linux/therm_est.h index 9630bd046..a67739483 100644 --- a/include/linux/therm_est.h +++ b/include/linux/therm_est.h @@ -26,13 +26,25 @@ #define MAX_ACTIVE_STATES 10 #define MAX_TIMER_TRIPS 10 -struct therm_est_subdevice { - void *dev_data; - struct thermal_zone_device *sub_thz; - long coeffs[HIST_LEN]; +struct therm_est_sub_thz { + struct thermal_zone_device *thz; long hist[HIST_LEN]; }; +struct therm_est_coeffs { + long toffset; + long (*coeffs)[HIST_LEN]; +}; + +struct therm_est_subdevice { + struct therm_est_sub_thz *sub_thz; + struct therm_est_coeffs *coeffs_set; + int num_devs; + int num_coeffs; + int active_coeffs; + int ntemp; +}; + /* * Timer trip provides a way to change trip temp dynamically based on timestamp * when the trip is enabled. @@ -74,13 +86,11 @@ struct therm_est_data { /* zone parameters */ struct thermal_zone_params *tzp; - long toffset; long polling_period; int passive_delay; int tc1; int tc2; - int ndevs; - struct therm_est_subdevice *devs; + struct therm_est_subdevice subdevice; int use_activator; }; -- cgit v1.2.2