summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-07-15 20:43:21 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-07-15 20:43:21 +0200
commitab33da3a220809e4b18fd8782785c90d02a96795 (patch)
tree6b33f083df10daa88198c8ab7870c219a8bd2cb4 /include
parent3fdd8ea39f0bcb6acff160a1fc6e331e7b21cbfc (diff)
parent3669716401921c4c545ac2998d7c67f9727ee056 (diff)
Merge branch 'thermal-core'
Merge updates related to the thermal core for 6.11-rc1: - Redesign the .set_trip_temp() thermal zone callback to take a trip pointer instead of a trip ID and update its users (Rafael Wysocki). - Avoid using invalid combinations of polling_delay and passive_delay thermal zone parameters (Rafael Wysocki). - Update a cooling device registration function to take a const argument (Krzysztof Kozlowski). - Make the uniphier thermal driver use thermal_zone_for_each_trip() for walking trip points (Rafael Wysocki). * thermal-core: thermal: core: Add sanity checks for polling_delay and passive_delay thermal: trip: Fold __thermal_zone_get_trip() into its caller thermal: trip: Pass trip pointer to .set_trip_temp() thermal zone callback thermal: imx: Drop critical trip check from imx_set_trip_temp() thermal: trip: Add conversion macros for thermal trip priv field thermal: helpers: Introduce thermal_trip_is_bound_to_cdev() thermal: core: Change passive_delay and polling_delay data type thermal: core: constify 'type' in devm_thermal_of_cooling_device_register() thermal: uniphier: Use thermal_zone_for_each_trip() for walking trip points
Diffstat (limited to 'include')
-rw-r--r--include/linux/thermal.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index f1155c0439c4..25fbf960b474 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -79,6 +79,9 @@ struct thermal_trip {
#define THERMAL_TRIP_FLAG_RW (THERMAL_TRIP_FLAG_RW_TEMP | \
THERMAL_TRIP_FLAG_RW_HYST)
+#define THERMAL_TRIP_PRIV_TO_INT(_val_) (uintptr_t)(_val_)
+#define THERMAL_INT_TO_TRIP_PRIV(_val_) (void *)(uintptr_t)(_val_)
+
struct thermal_zone_device;
struct thermal_zone_device_ops {
@@ -90,7 +93,8 @@ struct thermal_zone_device_ops {
int (*set_trips) (struct thermal_zone_device *, int, int);
int (*change_mode) (struct thermal_zone_device *,
enum thermal_device_mode);
- int (*set_trip_temp) (struct thermal_zone_device *, int, int);
+ int (*set_trip_temp) (struct thermal_zone_device *,
+ const struct thermal_trip *, int);
int (*get_crit_temp) (struct thermal_zone_device *, int *);
int (*set_emul_temp) (struct thermal_zone_device *, int);
int (*get_trend) (struct thermal_zone_device *,
@@ -198,8 +202,6 @@ static inline void devm_thermal_of_zone_unregister(struct device *dev,
}
#endif
-int __thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
- struct thermal_trip *trip);
int thermal_zone_get_trip(struct thermal_zone_device *tz, int trip_id,
struct thermal_trip *trip);
int for_each_thermal_trip(struct thermal_zone_device *tz,
@@ -221,7 +223,8 @@ struct thermal_zone_device *thermal_zone_device_register_with_trips(
int num_trips, void *devdata,
const struct thermal_zone_device_ops *ops,
const struct thermal_zone_params *tzp,
- int passive_delay, int polling_delay);
+ unsigned int passive_delay,
+ unsigned int polling_delay);
struct thermal_zone_device *thermal_tripless_zone_device_register(
const char *type,
@@ -261,7 +264,7 @@ thermal_of_cooling_device_register(struct device_node *np, const char *, void *,
struct thermal_cooling_device *
devm_thermal_of_cooling_device_register(struct device *dev,
struct device_node *np,
- char *type, void *devdata,
+ const char *type, void *devdata,
const struct thermal_cooling_device_ops *ops);
void thermal_cooling_device_update(struct thermal_cooling_device *);
void thermal_cooling_device_unregister(struct thermal_cooling_device *);
@@ -269,6 +272,9 @@ struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name);
int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);
int thermal_zone_get_slope(struct thermal_zone_device *tz);
int thermal_zone_get_offset(struct thermal_zone_device *tz);
+bool thermal_trip_is_bound_to_cdev(struct thermal_zone_device *tz,
+ const struct thermal_trip *trip,
+ struct thermal_cooling_device *cdev);
int thermal_zone_device_enable(struct thermal_zone_device *tz);
int thermal_zone_device_disable(struct thermal_zone_device *tz);
@@ -305,7 +311,7 @@ thermal_of_cooling_device_register(struct device_node *np,
static inline struct thermal_cooling_device *
devm_thermal_of_cooling_device_register(struct device *dev,
struct device_node *np,
- char *type, void *devdata,
+ const char *type, void *devdata,
const struct thermal_cooling_device_ops *ops)
{
return ERR_PTR(-ENODEV);