Skip to content

Commit 0c492be

Browse files
committed
thermal/drivers/ti: Use fixed update interval
Currently the TI thermal driver sets the sensor update interval based on the polling of the thermal zone. In order to get the polling rate, the code inspects the thermal zone device structure internals, thus breaking the self-encapsulation of the thermal framework core framework. On the other side, we see the common polling rates set in the device tree for the platforms using this driver are 500 or 1000 ms. Setting the polling rate to 250 ms would be far enough to cover the combination we found in the device tree. Instead of accessing the thermal zone device structure polling rate, let's use a common update interval of 250 ms for the driver. Cc: Keerthy <j-keerthy@ti.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Dhruva Gole <d-gole@ti.com> Acked-by: Keerthy <j-keerthy@ti.com> Link: https://lore.kernel.org/r/20230307133735.90772-7-daniel.lezcano@linaro.org
1 parent 0fb6c64 commit 0c492be

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/thermal/ti-soc-thermal/ti-thermal-common.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include "ti-bandgap.h"
2424
#include "../thermal_hwmon.h"
2525

26+
#define TI_BANDGAP_UPDATE_INTERVAL_MS 250
27+
2628
/* common data structures */
2729
struct ti_thermal_data {
2830
struct cpufreq_policy *policy;
@@ -159,7 +161,6 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
159161
char *domain)
160162
{
161163
struct ti_thermal_data *data;
162-
int interval;
163164

164165
data = ti_bandgap_get_sensor_data(bgp, id);
165166

@@ -177,10 +178,9 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
177178
return PTR_ERR(data->ti_thermal);
178179
}
179180

180-
interval = jiffies_to_msecs(data->ti_thermal->polling_delay_jiffies);
181-
182181
ti_bandgap_set_sensor_data(bgp, id, data);
183-
ti_bandgap_write_update_interval(bgp, data->sensor_id, interval);
182+
ti_bandgap_write_update_interval(bgp, data->sensor_id,
183+
TI_BANDGAP_UPDATE_INTERVAL_MS);
184184

185185
if (devm_thermal_add_hwmon_sysfs(bgp->dev, data->ti_thermal))
186186
dev_warn(bgp->dev, "failed to add hwmon sysfs attributes\n");

0 commit comments

Comments
 (0)