[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220426221523.3056696-12-daniel.lezcano@linexp.org>
Date: Wed, 27 Apr 2022 00:15:19 +0200
From: Daniel Lezcano <daniel.lezcano@...exp.org>
To: rafael@...nel.org, daniel.lezcano@...aro.org
Cc: khilman@...libre.com, abailon@...libre.com,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 11/15] thermal/core: Add thermal_trip in thermal_zone
The thermal trip points are properties of a thermal zone and the
different sub systems should be able to save them in the thermal zone
structure instead of having their own definition.
Give the opportunity to the drivers to create a thermal zone with
thermal trips which will be accessible directly from the thermal core
framework.
Cc: Alexandre Bailon <abailon@...libre.com>
Cc: Kevin Hilman <khilman@...libre.com>
Cc; Eduardo Valentin <eduval@...zon.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@...exp.org>
---
drivers/thermal/thermal_core.h | 10 ++++++++++
include/linux/thermal.h | 1 +
2 files changed, 11 insertions(+)
diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h
index ea92a959ad59..04f3d9f80db2 100644
--- a/drivers/thermal/thermal_core.h
+++ b/drivers/thermal/thermal_core.h
@@ -113,6 +113,16 @@ int thermal_build_list_of_policies(char *buf);
/* Helpers */
void thermal_zone_set_trips(struct thermal_zone *tz);
+static inline struct thermal_trip *thermal_zone_get_trips(struct thermal_zone *tz)
+{
+ return tz->trips;
+}
+
+static inline int thermal_zone_get_ntrips(struct thermal_zone *tz)
+{
+ return tz->ntrips;
+}
+
/* sysfs I/F */
int thermal_zone_create_device_groups(struct thermal_zone *, int);
void thermal_zone_destroy_device_groups(struct thermal_zone *);
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index e58a2f053e1c..9c75afff517a 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -184,6 +184,7 @@ struct thermal_zone {
struct thermal_sensor sensor;
struct thermal_zone_params *tzp;
struct thermal_governor *governor;
+ struct thermal_trip *trips;
void *governor_data;
struct list_head thermal_instances;
struct ida ida;
--
2.25.1
Powered by blists - more mailing lists