aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRafael J. Wysocki <[email protected]>2024-07-02 16:41:03 +0200
committerRafael J. Wysocki <[email protected]>2024-07-09 18:22:59 +0200
commitd1fbf18a0f9403df2edeffa1c7f5a2d66e82c20a (patch)
treec2f5eba88c11128df42f56c62070b4bccbcdac46 /include/linux
parent463b86fed2b25ddb5f576376bfea00134dd23030 (diff)
thermal: trip: Add conversion macros for thermal trip priv field
Some drivers will need to store integers in the priv field of struct thermal_trip, so add conversion macros for doing this in a consistent way and switch over the int340x_thermal driver that already does it and uses custom conversion functions to using the new macros. Signed-off-by: Rafael J. Wysocki <[email protected]> Link: https://patch.msgid.link/[email protected]
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/thermal.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 5a0b66bd34f0..3bd1b361ec34 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 {