aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal
diff options
context:
space:
mode:
authorRanganath Krishnan <ranganath@ti.com>2013-08-23 12:08:22 -0400
committerEduardo Valentin <eduardo.valentin@ti.com>2013-08-29 09:36:16 -0400
commit10ccff1b578cc7842a0bab959f662305f3dfabc0 (patch)
treebe58f17291ca2fe810687c3b5bb6dfdecce23108 /drivers/thermal
parent547f72ab7da5e01c2170ca2abfca5f98c40318fa (diff)
thermal: ti-soc-thermal: Set the bandgap mask counter delay value
Set the bandgap mask counter_delay with the polling_delay value on registering the thermal zone. This patch will ensure to get the correct update interval for computing the thermal trend. Signed-off-by: Ranganath Krishnan <ranganath@ti.com> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/ti-soc-thermal/ti-thermal-common.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
index 4c5f55c37349..4f8b9af54a5a 100644
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
@@ -174,6 +174,9 @@ static int ti_thermal_set_mode(struct thermal_zone_device *thermal,
174 enum thermal_device_mode mode) 174 enum thermal_device_mode mode)
175{ 175{
176 struct ti_thermal_data *data = thermal->devdata; 176 struct ti_thermal_data *data = thermal->devdata;
177 struct ti_bandgap *bgp;
178
179 bgp = data->bgp;
177 180
178 if (!data->ti_thermal) { 181 if (!data->ti_thermal) {
179 dev_notice(&thermal->device, "thermal zone not registered\n"); 182 dev_notice(&thermal->device, "thermal zone not registered\n");
@@ -190,6 +193,8 @@ static int ti_thermal_set_mode(struct thermal_zone_device *thermal,
190 mutex_unlock(&data->ti_thermal->lock); 193 mutex_unlock(&data->ti_thermal->lock);
191 194
192 data->mode = mode; 195 data->mode = mode;
196 ti_bandgap_write_update_interval(bgp, data->sensor_id,
197 data->ti_thermal->polling_delay);
193 thermal_zone_device_update(data->ti_thermal); 198 thermal_zone_device_update(data->ti_thermal);
194 dev_dbg(&thermal->device, "thermal polling set for duration=%d msec\n", 199 dev_dbg(&thermal->device, "thermal polling set for duration=%d msec\n",
195 data->ti_thermal->polling_delay); 200 data->ti_thermal->polling_delay);
@@ -313,6 +318,8 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
313 } 318 }
314 data->ti_thermal->polling_delay = FAST_TEMP_MONITORING_RATE; 319 data->ti_thermal->polling_delay = FAST_TEMP_MONITORING_RATE;
315 ti_bandgap_set_sensor_data(bgp, id, data); 320 ti_bandgap_set_sensor_data(bgp, id, data);
321 ti_bandgap_write_update_interval(bgp, data->sensor_id,
322 data->ti_thermal->polling_delay);
316 323
317 return 0; 324 return 0;
318} 325}