aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2021-10-09 19:12:27 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2021-10-18 23:01:19 +0200
commit1f0f42737c22cb589b35730023ce71a114f5bba1 (patch)
treeb4c89982c53767a03bf91b956bba2b3e73cdd9ef
parent42fb268c4771eadff97d97655fee14203e2093d5 (diff)
downloadbackports-1f0f42737c22cb589b35730023ce71a114f5bba1.tar.gz
headers: Adapt signature of thermal_zone_device_update()
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@hauke-m.de>
-rw-r--r--backport/backport-include/linux/thermal.h23
1 files changed, 23 insertions, 0 deletions
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 */