提交 10ccff1b 编写于 作者: R Ranganath Krishnan 提交者: Eduardo Valentin

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: NRanganath Krishnan <ranganath@ti.com>
Signed-off-by: NEduardo Valentin <eduardo.valentin@ti.com>
上级 547f72ab
...@@ -174,6 +174,9 @@ static int ti_thermal_set_mode(struct thermal_zone_device *thermal, ...@@ -174,6 +174,9 @@ static int ti_thermal_set_mode(struct thermal_zone_device *thermal,
enum thermal_device_mode mode) enum thermal_device_mode mode)
{ {
struct ti_thermal_data *data = thermal->devdata; struct ti_thermal_data *data = thermal->devdata;
struct ti_bandgap *bgp;
bgp = data->bgp;
if (!data->ti_thermal) { if (!data->ti_thermal) {
dev_notice(&thermal->device, "thermal zone not registered\n"); 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,6 +193,8 @@ static int ti_thermal_set_mode(struct thermal_zone_device *thermal,
mutex_unlock(&data->ti_thermal->lock); mutex_unlock(&data->ti_thermal->lock);
data->mode = mode; data->mode = mode;
ti_bandgap_write_update_interval(bgp, data->sensor_id,
data->ti_thermal->polling_delay);
thermal_zone_device_update(data->ti_thermal); thermal_zone_device_update(data->ti_thermal);
dev_dbg(&thermal->device, "thermal polling set for duration=%d msec\n", dev_dbg(&thermal->device, "thermal polling set for duration=%d msec\n",
data->ti_thermal->polling_delay); data->ti_thermal->polling_delay);
...@@ -313,6 +318,8 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id, ...@@ -313,6 +318,8 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
} }
data->ti_thermal->polling_delay = FAST_TEMP_MONITORING_RATE; data->ti_thermal->polling_delay = FAST_TEMP_MONITORING_RATE;
ti_bandgap_set_sensor_data(bgp, id, data); ti_bandgap_set_sensor_data(bgp, id, data);
ti_bandgap_write_update_interval(bgp, data->sensor_id,
data->ti_thermal->polling_delay);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册