[PATCH 24/47] headers: Adapt signature of thermal_zone_device_update()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The function signature of thermal_zone_device_update() function changed
in kernel 4.9. Drop the event parameter for older kernel versions. This
function is used by iwlwifi.
The code was partly copied from the upstream kernel.

Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
---
 backport/backport-include/linux/thermal.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/backport/backport-include/linux/thermal.h b/backport/backport-include/linux/thermal.h
index d9b8153e..8210facf 100644
--- a/backport/backport-include/linux/thermal.h
+++ b/backport/backport-include/linux/thermal.h
@@ -13,4 +13,27 @@ static inline int thermal_zone_device_disable(struct thermal_zone_device *tz)
 { return 0; }
 #endif /* < 5.9 */
 
+#if LINUX_VERSION_IS_LESS(4,9,0)
+/* Thermal notification reason */
+enum thermal_notify_event {
+	THERMAL_EVENT_UNSPECIFIED, /* Unspecified event */
+	THERMAL_EVENT_TEMP_SAMPLE, /* New Temperature sample */
+	THERMAL_TRIP_VIOLATED, /* TRIP Point violation */
+	THERMAL_TRIP_CHANGED, /* TRIP Point temperature changed */
+	THERMAL_DEVICE_DOWN, /* Thermal device is down */
+	THERMAL_DEVICE_UP, /* Thermal device is up after a down event */
+	THERMAL_DEVICE_POWER_CAPABILITY_CHANGED, /* power capability changed */
+	THERMAL_TABLE_CHANGED, /* Thermal table(s) changed */
+	THERMAL_EVENT_KEEP_ALIVE, /* Request for user space handler to respond */
+};
+
+static inline void
+backport_thermal_zone_device_update(struct thermal_zone_device *tz,
+				    enum thermal_notify_event event)
+{
+	thermal_zone_device_update(tz);
+}
+#define thermal_zone_device_update LINUX_BACKPORT(thermal_zone_device_update)
+#endif /* < 4.9 */
+
 #endif /* __BACKPORT_LINUX_THERMAL_H */
-- 
2.30.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux