drivers: thermal: Use deferrable work and power efficient workqueue

Thermal core uses work events to poll for sensor driver temperature
crossing a threshold. Since it is not using a deferrable workqueue, it
might wake-up the device from sleep.

Use a deferrable work event and post the work in the power efficient
workqueue for estimating virtual sensor temperature.

Change-Id: I9dd21d8fc4e5ca96e06db9ecb57a628618494a01
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
This commit is contained in:
Ram Chandrasekar 2017-06-23 10:41:23 -06:00 committed by Timi
parent 0781014985
commit e0a33f5957

View file

@ -820,8 +820,9 @@ static void monitor_thermal_zone(struct thermal_zone_device *tz)
thermal_zone_device_set_polling(thermal_passive_wq,
tz, tz->passive_delay);
else if (tz->polling_delay)
thermal_zone_device_set_polling(system_freezable_wq,
tz, tz->polling_delay);
thermal_zone_device_set_polling(
system_freezable_power_efficient_wq,
tz, tz->polling_delay);
else
thermal_zone_device_set_polling(NULL, tz, 0);
@ -2404,7 +2405,7 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
/* Bind cooling devices for this zone */
bind_tz(tz);
INIT_DELAYED_WORK(&(tz->poll_queue), thermal_zone_device_check);
INIT_DEFERRABLE_WORK(&(tz->poll_queue), thermal_zone_device_check);
thermal_zone_device_reset(tz);
/* Update the new thermal zone and mark it as already updated. */