Blob Blame History Raw
From: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Date: Mon, 29 Jun 2020 14:29:17 +0200
Subject: thermal: Add current mode to thermal zone device
Patch-mainline: v5.9-rc1
Git-commit: cbba1d719534b77b857267890b0f54f0f0a90de4
References: jsc#SLE-16407

Prepare for changing the place where the mode is stored: now it is in
drivers, which might or might not implement get_mode()/set_mode() methods.
A lot of cleanup can be done thanks to storing it in struct tzd. The
get_mode() methods will become redundant.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200629122925.21729-4-andrzej.p@collabora.com
Acked-by: Lee, Chun-Yi <jlee@suse.com>
---
 include/linux/thermal.h |    2 ++
 1 file changed, 2 insertions(+)

--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -154,6 +154,7 @@ struct thermal_attr {
  * @trip_temp_attrs:	attributes for trip points for sysfs: trip temperature
  * @trip_type_attrs:	attributes for trip points for sysfs: trip type
  * @trip_hyst_attrs:	attributes for trip points for sysfs: trip hysteresis
+ * @mode:		current mode of this thermal zone
  * @devdata:	private pointer for device private data
  * @trips:	number of trip points the thermal zone supports
  * @trips_disabled;	bitmap for disabled trips
@@ -196,6 +197,7 @@ struct thermal_zone_device {
 	struct thermal_attr *trip_temp_attrs;
 	struct thermal_attr *trip_type_attrs;
 	struct thermal_attr *trip_hyst_attrs;
+	enum thermal_device_mode mode;
 	void *devdata;
 	int trips;
 	unsigned long trips_disabled;	/* bitmap for disabled trips */