Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b17d98c5 authored by Ram Chandrasekar's avatar Ram Chandrasekar
Browse files

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: default avatarRam Chandrasekar <rkumbako@codeaurora.org>
parent 84cf4451
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -418,7 +418,8 @@ 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,
		thermal_zone_device_set_polling(
				system_freezable_power_efficient_wq,
				tz, tz->polling_delay);
	else
		thermal_zone_device_set_polling(NULL, tz, 0);
@@ -2134,7 +2135,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. */