@@ -14,24 +14,57 @@ 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)
+#if LINUX_VERSION_IS_LESS(6,9,0) && LINUX_VERSION_IS_GEQ(5,10,0)
struct thermal_trip {
int temperature;
int hysteresis;
+ int threshold;
enum thermal_trip_type type;
+ u8 flags;
+ void *priv;
};
#endif
-#if LINUX_VERSION_IS_LESS(6,0,0)
+#if LINUX_VERSION_IS_LESS(6,9,0)
+#define THERMAL_TRIP_FLAG_RW_TEMP BIT(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,
+ int num_trips, void *devdata,
struct thermal_zone_device_ops *ops,
struct thermal_zone_params *tzp,
int passive_delay,
int polling_delay);
-#endif /* <6,0,0 */
+#endif /* <6,9,0 */
+
+#if LINUX_VERSION_IS_LESS(6,6,0) && LINUX_VERSION_IS_GEQ(6,0,0)
+static inline
+int for_each_thermal_trip(struct thermal_zone_device *tz,
+ int (*cb)(struct thermal_trip *, void *),
+ void *data)
+{
+ int ret;
+
+ for (trip = tz->trips; trip - tz->trips < tz->num_trips; trip++) {
+ ret = cb(trip, data);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
+}
+#endif /* < 6,6,0 && >= 6,0,0 */
+
+/* for < 6,0,0 the trips are invalid anyway*/
+#if LINUX_VERSION_IS_LESS(6,0,0)
+static inline
+int for_each_thermal_trip(struct thermal_zone_device *tz,
+ int (*cb)(struct thermal_trip *, void *),
+ void *data)
+{
+ return 0;
+}
+#endif
#if LINUX_VERSION_IS_LESS(6,4,0)
#define thermal_zone_device_priv LINUX_BACKPORT(thermal_zone_device_priv)
@@ -51,12 +84,12 @@ 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)
+#if LINUX_VERSION_IS_LESS(6,9,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,
+ int num_trips, void *devdata,
struct thermal_zone_device_ops *ops,
struct thermal_zone_params *tzp,
int passive_delay,
@@ -16,7 +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_9) += backport-6.9.o
compat-$(CPTCFG_KERNEL_6_5) += backport-6.5.o
compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += verification/verify.o
similarity index 79%
rename from backport/compat/backport-6.0.c
rename to backport/compat/backport-6.9.c
@@ -7,12 +7,12 @@
struct thermal_zone_device *
thermal_zone_device_register_with_trips(const char *type,
struct thermal_trip *trips,
- int num_trips, int mask, void *devdata,
+ int num_trips, 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,
+ return thermal_zone_device_register(type, num_trips, 0, devdata, ops, tzp,
passive_delay, polling_delay);
}
EXPORT_SYMBOL_GPL(thermal_zone_device_register_with_trips);