generic: kernel 6.6: fixes thermal driver

This commit is contained in:
coolsnowwolf 2024-08-23 22:28:15 +08:00
parent 166b4bd84e
commit d856657965
3 changed files with 2 additions and 35 deletions

View File

@ -5961,6 +5961,7 @@ CONFIG_SERIAL_EARLYCON=y
# CONFIG_SG_SPLIT is not set # CONFIG_SG_SPLIT is not set
# CONFIG_SHADOW_CALL_STACK is not set # CONFIG_SHADOW_CALL_STACK is not set
CONFIG_SHMEM=y CONFIG_SHMEM=y
# CONFIG_SHORTCUT_FE is not set
# CONFIG_SHRINKER_DEBUG is not set # CONFIG_SHRINKER_DEBUG is not set
# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set # CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set
# CONFIG_SH_ETH is not set # CONFIG_SH_ETH is not set

View File

@ -5630,6 +5630,7 @@ CONFIG_SERIAL_EARLYCON=y
# CONFIG_SG_SPLIT is not set # CONFIG_SG_SPLIT is not set
# CONFIG_SHADOW_CALL_STACK is not set # CONFIG_SHADOW_CALL_STACK is not set
CONFIG_SHMEM=y CONFIG_SHMEM=y
# CONFIG_SHORTCUT_FE is not set
# CONFIG_SHRINKER_DEBUG is not set # CONFIG_SHRINKER_DEBUG is not set
# CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set # CONFIG_SHUFFLE_PAGE_ALLOCATOR is not set
# CONFIG_SH_ETH is not set # CONFIG_SH_ETH is not set

View File

@ -71,41 +71,6 @@
struct thermal_zone_device *thermal_tripless_zone_device_register( struct thermal_zone_device *thermal_tripless_zone_device_register(
const char *type, const char *type,
void *devdata, void *devdata,
--- a/drivers/thermal/thermal_trip.c
+++ b/drivers/thermal/thermal_trip.c
@@ -113,11 +113,29 @@ void __thermal_zone_set_trips(struct the
int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
struct thermal_trip *trip)
{
- if (!tz || !tz->trips || trip_id < 0 || trip_id >= tz->num_trips || !trip)
+ int ret;
+
+ if (!tz || trip_id < 0 || trip_id >= tz->num_trips || !trip)
return -EINVAL;
- *trip = tz->trips[trip_id];
- return 0;
+ if (tz->trips) {
+ *trip = tz->trips[trip_id];
+ return 0;
+ }
+
+ if (tz->ops->get_trip_hyst) {
+ ret = tz->ops->get_trip_hyst(tz, trip_id, &trip->hysteresis);
+ if (ret)
+ return ret;
+ } else {
+ trip->hysteresis = 0;
+ }
+
+ ret = tz->ops->get_trip_temp(tz, trip_id, &trip->temperature);
+ if (ret)
+ return ret;
+
+ return tz->ops->get_trip_type(tz, trip_id, &trip->type);
}
EXPORT_SYMBOL_GPL(__thermal_zone_get_trip);
--- a/include/linux/thermal.h --- a/include/linux/thermal.h
+++ b/include/linux/thermal.h +++ b/include/linux/thermal.h
@@ -76,7 +76,11 @@ struct thermal_zone_device_ops { @@ -76,7 +76,11 @@ struct thermal_zone_device_ops {