aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/thermal.h
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2020-12-16 23:03:35 +0100
committerDaniel Lezcano <daniel.lezcano@linaro.org>2021-01-19 22:23:38 +0100
commit17d399cd9c8936909bc8936a5837b6da9af9c29e (patch)
tree6c7da345cc161493bc761054d62fca317a76050b /include/linux/thermal.h
parentthermal/core: Remove unused macro THERMAL_TRIPS_NONE (diff)
downloadlinux-dev-17d399cd9c8936909bc8936a5837b6da9af9c29e.tar.xz
linux-dev-17d399cd9c8936909bc8936a5837b6da9af9c29e.zip
thermal/core: Precompute the delays from msecs to jiffies
The delays are stored in ms units and when the polling function is called this delay is converted into jiffies at each call. Instead of doing the conversion again and again, compute the jiffies at init time and use the value directly when setting the polling. Cc: Thara Gopinath <thara.gopinath@linaro.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Reviewed-by: Thara Gopinath <thara.gopinath@linaro.org> Link: https://lore.kernel.org/r/20201216220337.839878-1-daniel.lezcano@linaro.org
Diffstat (limited to 'include/linux/thermal.h')
-rw-r--r--include/linux/thermal.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 060a2160add4..d1b82c70de69 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -117,9 +117,14 @@ struct thermal_cooling_device {
* @trips_disabled; bitmap for disabled trips
* @passive_delay: number of milliseconds to wait between polls when
* performing passive cooling.
+ * @passive_delay_jiffies: number of jiffies to wait between polls when
+ * performing passive cooling.
* @polling_delay: number of milliseconds to wait between polls when
* checking whether trip points have been crossed (0 for
* interrupt driven systems)
+ * @polling_delay_jiffies: number of jiffies to wait between polls when
+ * checking whether trip points have been crossed (0 for
+ * interrupt driven systems)
* @temperature: current temperature. This is only for core code,
* drivers should use thermal_zone_get_temp() to get the
* current temperature
@@ -155,6 +160,8 @@ struct thermal_zone_device {
void *devdata;
int trips;
unsigned long trips_disabled; /* bitmap for disabled trips */
+ unsigned long passive_delay_jiffies;
+ unsigned long polling_delay_jiffies;
int passive_delay;
int polling_delay;
int temperature;