@@ -14,6 +14,25 @@ static inline int thermal_zone_device_disable(struct thermal_zone_device *tz)
{ return 0; }
#endif /* < 5.9 */
+#if LINUX_VERSION_IS_LESS(6,0,0) && LINUX_VERSION_IS_GEQ(5,10,0)
+struct thermal_trip {
+ int temperature;
+ int hysteresis;
+ enum thermal_trip_type type;
+};
+#endif
+
+#if LINUX_VERSION_IS_LESS(6,0,0)
+struct thermal_zone_device *
+thermal_zone_device_register_with_trips(const char *type,
+ struct thermal_trip *trips,
+ int num_trips, int mask, void *devdata,
+ struct thermal_zone_device_ops *ops,
+ struct thermal_zone_params *tzp,
+ int passive_delay,
+ int polling_delay);
+#endif /* <6,0,0 */
+
#if LINUX_VERSION_IS_LESS(6,4,0)
void *thermal_zone_device_priv(struct thermal_zone_device *tzd);
#endif /* < 6.4.0 */
@@ -28,6 +47,21 @@ static inline int thermal_zone_device_disable(struct thermal_zone_device *tz)
{ return -ENODEV; }
#endif /* < 5.9 */
+#if LINUX_VERSION_IS_LESS(6,0,0)
+#define thermal_zone_device_register_with_trips LINUX_BACKPORT(thermal_zone_device_register_with_trips)
+static inline struct thermal_zone_device *
+thermal_zone_device_register_with_trips(const char *type,
+ struct thermal_trip *trips,
+ int num_trips, int mask, void *devdata,
+ struct thermal_zone_device_ops *ops,
+ struct thermal_zone_params *tzp,
+ int passive_delay,
+ int polling_delay)
+{
+ return NULL;
+}
+#endif
+
#if LINUX_VERSION_IS_LESS(6,4,0)
#define thermal_zone_device_priv LINUX_BACKPORT(thermal_zone_device_priv)
static inline void *thermal_zone_device_priv(struct thermal_zone_device *tzd)
@@ -16,6 +16,7 @@ compat-$(CPTCFG_KERNEL_5_10) += backport-5.10.o
compat-$(CPTCFG_KERNEL_5_11) += backport-5.11.o
compat-$(CPTCFG_KERNEL_5_13) += backport-5.13.o
compat-$(CPTCFG_KERNEL_5_15) += backport-5.15.o
+compat-$(CPTCFG_KERNEL_6_0) += backport-6.0.o
compat-$(CPTCFG_KERNEL_6_4) += backport-6.4.o
compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/verify.o
new file mode 100644
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/types.h>
+#include <linux/thermal.h>
+
+#ifdef CONFIG_THERMAL
+struct thermal_zone_device *
+thermal_zone_device_register_with_trips(const char *type,
+ struct thermal_trip *trips,
+ int num_trips, int mask, void *devdata,
+ struct thermal_zone_device_ops *ops,
+ struct thermal_zone_params *tzp, int passive_delay,
+ int polling_delay)
+{
+ return thermal_zone_device_register(type, num_trips, mask, devdata, ops, tzp,
+ passive_delay, polling_delay);
+}
+EXPORT_SYMBOL_GPL(thermal_zone_device_register_with_trips);
+#endif /* CONFIG_THERMAL */