All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linexp.org>
To: daniel.lezcano@linaro.org, rafael@kernel.org
Cc: khilman@baylibre.com, abailon@baylibre.com,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Amit Kucheria" <amitk@kernel.org>,
	"Zhang Rui" <rui.zhang@intel.com>,
	"Jonathan Corbet" <corbet@lwn.net>, "Len Brown" <lenb@kernel.org>,
	"Raju Rangoju" <rajur@chelsio.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Ido Schimmel" <idosch@nvidia.com>,
	"Petr Machata" <petrm@nvidia.com>,
	"Luca Coelho" <luciano.coelho@intel.com>,
	"Kalle Valo" <kvalo@kernel.org>, "Peter Kaestle" <peter@piie.net>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Mark Gross" <markgross@kernel.org>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Support Opensource" <support.opensource@diasemi.com>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	"NXP Linux Team" <linux-imx@nxp.com>,
	"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
	"Miri Korenblit" <miriam.rachel.korenblit@intel.com>,
	"Johannes Berg" <johannes.berg@intel.com>,
	"Srinivas Pandruvada" <srinivas.pandruvada@linux.intel.com>,
	"Sumeet Pawnikar" <sumeet.r.pawnikar@intel.com>,
	"Dan Carpenter" <dan.carpenter@oracle.com>,
	"Chuansheng Liu" <chuansheng.liu@intel.com>,
	"Jiasheng Jiang" <jiasheng@iscas.ac.cn>,
	"Antoine Tenart" <atenart@kernel.org>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	linux-doc@vger.kernel.org (open list:DOCUMENTATION),
	linux-acpi@vger.kernel.org (open list:ACPI THERMAL DRIVER),
	netdev@vger.kernel.org (open list:CXGB4 ETHERNET DRIVER (CXGB4)),
	linux-wireless@vger.kernel.org (open list:INTEL WIRELESS WIFI
	LINK (iwlwifi)),
	platform-driver-x86@vger.kernel.org (open list:ACER ASPIRE ONE
	TEMPERATURE AND FAN DRIVER),
	linux-arm-kernel@lists.infradead.org (moderated
	list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE),
	linux-renesas-soc@vger.kernel.org (open list:RENESAS R-CAR
	THERMAL DRIVERS)
Subject: [PATCH v2 01/14] thermal/core: Change thermal_zone_ops to thermal_sensor_ops
Date: Sat,  7 May 2022 14:54:29 +0200	[thread overview]
Message-ID: <20220507125443.2766939-2-daniel.lezcano@linexp.org> (raw)
In-Reply-To: <20220507125443.2766939-1-daniel.lezcano@linexp.org>

A thermal zone is software abstraction of a sensor associated with
properties and cooling devices if any.

The fact that we have thermal_zone and thermal_zone_ops mixed is
confusing and does not clearly identify the different components
entering in the thermal management process. A thermal zone appears to
be a sensor while it is not.

In order to set the scene for multiple thermal sensors aggregated into
a single thermal zone. Rename the thermal_zone_ops to
thermal_sensor_ops, that will appear clearyl the thermal zone is not a
sensor but an abstraction of one [or multiple] sensor(s).

Cc: Alexandre Bailon <abailon@baylibre.com>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc; Eduardo Valentin <eduval@amazon.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linexp.org>
---
 Documentation/driver-api/thermal/sysfs-api.rst            | 2 +-
 drivers/acpi/thermal.c                                    | 6 +++---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c        | 2 +-
 drivers/net/ethernet/mellanox/mlxsw/core_thermal.c        | 6 +++---
 drivers/net/wireless/intel/iwlwifi/mvm/tt.c               | 2 +-
 drivers/platform/x86/acerhdf.c                            | 2 +-
 drivers/power/supply/power_supply_core.c                  | 2 +-
 drivers/thermal/armada_thermal.c                          | 2 +-
 drivers/thermal/da9062-thermal.c                          | 2 +-
 drivers/thermal/dove_thermal.c                            | 2 +-
 drivers/thermal/imx_thermal.c                             | 2 +-
 drivers/thermal/intel/int340x_thermal/int3400_thermal.c   | 2 +-
 .../thermal/intel/int340x_thermal/int340x_thermal_zone.c  | 6 +++---
 .../thermal/intel/int340x_thermal/int340x_thermal_zone.h  | 4 ++--
 .../intel/int340x_thermal/processor_thermal_device.c      | 4 ++--
 .../intel/int340x_thermal/processor_thermal_device_pci.c  | 2 +-
 drivers/thermal/intel/intel_pch_thermal.c                 | 2 +-
 drivers/thermal/intel/intel_quark_dts_thermal.c           | 2 +-
 drivers/thermal/intel/intel_soc_dts_iosf.c                | 2 +-
 drivers/thermal/intel/x86_pkg_temp_thermal.c              | 2 +-
 drivers/thermal/kirkwood_thermal.c                        | 2 +-
 drivers/thermal/rcar_thermal.c                            | 4 ++--
 drivers/thermal/spear_thermal.c                           | 2 +-
 drivers/thermal/st/st_thermal.c                           | 2 +-
 drivers/thermal/thermal_core.c                            | 2 +-
 drivers/thermal/thermal_of.c                              | 4 ++--
 include/linux/thermal.h                                   | 8 ++++----
 27 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/Documentation/driver-api/thermal/sysfs-api.rst b/Documentation/driver-api/thermal/sysfs-api.rst
index 2e0f79a9e2ee..6dff5e6e1166 100644
--- a/Documentation/driver-api/thermal/sysfs-api.rst
+++ b/Documentation/driver-api/thermal/sysfs-api.rst
@@ -41,7 +41,7 @@ temperature) and throttle appropriate devices.
 	struct thermal_zone_device
 	*thermal_zone_device_register(char *type,
 				      int trips, int mask, void *devdata,
-				      struct thermal_zone_device_ops *ops,
+				      struct thermal_sensor_ops *ops,
 				      const struct thermal_zone_params *tzp,
 				      int passive_delay, int polling_delay))
 
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 539660ef93c7..c2b8100f9cd8 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -774,7 +774,7 @@ acpi_thermal_unbind_cooling_device(struct thermal_zone_device *thermal,
 	return acpi_thermal_cooling_device_cb(thermal, cdev, false);
 }
 
-static struct thermal_zone_device_ops acpi_thermal_zone_ops = {
+static struct thermal_sensor_ops acpi_thermal_sensor_ops = {
 	.bind = acpi_thermal_bind_cooling_device,
 	.unbind	= acpi_thermal_unbind_cooling_device,
 	.get_temp = thermal_get_temp,
@@ -808,13 +808,13 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
 	if (tz->trips.passive.flags.valid)
 		tz->thermal_zone =
 			thermal_zone_device_register("acpitz", trips, 0, tz,
-						&acpi_thermal_zone_ops, NULL,
+						&acpi_thermal_sensor_ops, NULL,
 						     tz->trips.passive.tsp*100,
 						     tz->polling_frequency*100);
 	else
 		tz->thermal_zone =
 			thermal_zone_device_register("acpitz", trips, 0, tz,
-						&acpi_thermal_zone_ops, NULL,
+						&acpi_thermal_sensor_ops, NULL,
 						0, tz->polling_frequency*100);
 	if (IS_ERR(tz->thermal_zone))
 		return -ENODEV;
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c
index 9a6d65243334..239824e90fbe 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c
@@ -53,7 +53,7 @@ static int cxgb4_thermal_get_trip_temp(struct thermal_zone_device *tzdev,
 	return 0;
 }
 
-static struct thermal_zone_device_ops cxgb4_thermal_ops = {
+static struct thermal_sensor_ops cxgb4_thermal_ops = {
 	.get_temp = cxgb4_thermal_get_temp,
 	.get_trip_type = cxgb4_thermal_get_trip_type,
 	.get_trip_temp = cxgb4_thermal_get_trip_temp,
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
index 05f54bd982c0..cf609dc39acd 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
@@ -361,7 +361,7 @@ static struct thermal_zone_params mlxsw_thermal_params = {
 	.no_hwmon = true,
 };
 
-static struct thermal_zone_device_ops mlxsw_thermal_ops = {
+static struct thermal_sensor_ops mlxsw_thermal_ops = {
 	.bind = mlxsw_thermal_bind,
 	.unbind = mlxsw_thermal_unbind,
 	.get_temp = mlxsw_thermal_get_temp,
@@ -553,7 +553,7 @@ static int mlxsw_thermal_module_trend_get(struct thermal_zone_device *tzdev,
 	return 0;
 }
 
-static struct thermal_zone_device_ops mlxsw_thermal_module_ops = {
+static struct thermal_sensor_ops mlxsw_thermal_module_ops = {
 	.bind		= mlxsw_thermal_module_bind,
 	.unbind		= mlxsw_thermal_module_unbind,
 	.get_temp	= mlxsw_thermal_module_temp_get,
@@ -590,7 +590,7 @@ static int mlxsw_thermal_gearbox_temp_get(struct thermal_zone_device *tzdev,
 	return 0;
 }
 
-static struct thermal_zone_device_ops mlxsw_thermal_gearbox_ops = {
+static struct thermal_sensor_ops mlxsw_thermal_gearbox_ops = {
 	.bind		= mlxsw_thermal_module_bind,
 	.unbind		= mlxsw_thermal_module_unbind,
 	.get_temp	= mlxsw_thermal_gearbox_temp_get,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
index 69cf3a372759..74109a7d329f 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
@@ -718,7 +718,7 @@ static int iwl_mvm_tzone_set_trip_temp(struct thermal_zone_device *device,
 	return ret;
 }
 
-static  struct thermal_zone_device_ops tzone_ops = {
+static  struct thermal_sensor_ops tzone_ops = {
 	.get_temp = iwl_mvm_tzone_get_temp,
 	.get_trip_temp = iwl_mvm_tzone_get_trip_temp,
 	.get_trip_type = iwl_mvm_tzone_get_trip_type,
diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
index 3463629f8764..b9e8f6c60714 100644
--- a/drivers/platform/x86/acerhdf.c
+++ b/drivers/platform/x86/acerhdf.c
@@ -469,7 +469,7 @@ static int acerhdf_get_crit_temp(struct thermal_zone_device *thermal,
 }
 
 /* bind callback functions to thermalzone */
-static struct thermal_zone_device_ops acerhdf_dev_ops = {
+static struct thermal_sensor_ops acerhdf_dev_ops = {
 	.bind = acerhdf_bind,
 	.unbind = acerhdf_unbind,
 	.get_temp = acerhdf_get_ec_temp,
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index d925cb137e12..5ada4a94b4e3 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -1149,7 +1149,7 @@ static int power_supply_read_temp(struct thermal_zone_device *tzd,
 	return ret;
 }
 
-static struct thermal_zone_device_ops psy_tzd_ops = {
+static struct thermal_sensor_ops psy_tzd_ops = {
 	.get_temp = power_supply_read_temp,
 };
 
diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index c2ebfb5be4b3..703ace32a217 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -416,7 +416,7 @@ static int armada_get_temp_legacy(struct thermal_zone_device *thermal,
 	return ret;
 }
 
-static struct thermal_zone_device_ops legacy_ops = {
+static struct thermal_sensor_ops legacy_ops = {
 	.get_temp = armada_get_temp_legacy,
 };
 
diff --git a/drivers/thermal/da9062-thermal.c b/drivers/thermal/da9062-thermal.c
index 180edec34e07..d29953eee39f 100644
--- a/drivers/thermal/da9062-thermal.c
+++ b/drivers/thermal/da9062-thermal.c
@@ -170,7 +170,7 @@ static int da9062_thermal_get_temp(struct thermal_zone_device *z,
 	return 0;
 }
 
-static struct thermal_zone_device_ops da9062_thermal_ops = {
+static struct thermal_sensor_ops da9062_thermal_ops = {
 	.get_temp	= da9062_thermal_get_temp,
 	.get_trip_type	= da9062_thermal_get_trip_type,
 	.get_trip_temp	= da9062_thermal_get_trip_temp,
diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c
index 73182eb94bc0..170a1168ae38 100644
--- a/drivers/thermal/dove_thermal.c
+++ b/drivers/thermal/dove_thermal.c
@@ -109,7 +109,7 @@ static int dove_get_temp(struct thermal_zone_device *thermal,
 	return 0;
 }
 
-static struct thermal_zone_device_ops ops = {
+static struct thermal_sensor_ops ops = {
 	.get_temp = dove_get_temp,
 };
 
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index 16663373b682..c57fa2029ee0 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -418,7 +418,7 @@ static int imx_unbind(struct thermal_zone_device *tz,
 	return 0;
 }
 
-static struct thermal_zone_device_ops imx_tz_ops = {
+static struct thermal_sensor_ops imx_tz_ops = {
 	.bind = imx_bind,
 	.unbind = imx_unbind,
 	.get_temp = imx_get_temp,
diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
index 4954800b9850..cad48a886888 100644
--- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
@@ -485,7 +485,7 @@ static int int3400_thermal_change_mode(struct thermal_zone_device *thermal,
 	return result;
 }
 
-static struct thermal_zone_device_ops int3400_thermal_ops = {
+static struct thermal_sensor_ops int3400_thermal_ops = {
 	.get_temp = int3400_thermal_get_temp,
 	.change_mode = int3400_thermal_change_mode,
 };
diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
index 62c0aa5d0783..d78f29208352 100644
--- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
+++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
@@ -151,7 +151,7 @@ static void int340x_thermal_critical(struct thermal_zone_device *zone)
 	dev_dbg(&zone->device, "%s: critical temperature reached\n", zone->type);
 }
 
-static struct thermal_zone_device_ops int340x_thermal_zone_ops = {
+static struct thermal_sensor_ops int340x_thermal_sensor_ops = {
 	.get_temp       = int340x_thermal_get_zone_temp,
 	.get_trip_temp	= int340x_thermal_get_trip_temp,
 	.get_trip_type	= int340x_thermal_get_trip_type,
@@ -217,7 +217,7 @@ static struct thermal_zone_params int340x_thermal_params = {
 };
 
 struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
-				struct thermal_zone_device_ops *override_ops)
+				struct thermal_sensor_ops *override_ops)
 {
 	struct int34x_thermal_zone *int34x_thermal_zone;
 	acpi_status status;
@@ -262,7 +262,7 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
 						acpi_device_bid(adev),
 						trip_cnt,
 						trip_mask, int34x_thermal_zone,
-						&int340x_thermal_zone_ops,
+						&int340x_thermal_sensor_ops,
 						&int340x_thermal_params,
 						0, 0);
 	if (IS_ERR(int34x_thermal_zone->zone)) {
diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.h b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.h
index 3b4971df1b33..a25c45e2eb66 100644
--- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.h
+++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.h
@@ -29,13 +29,13 @@ struct int34x_thermal_zone {
 	int hot_temp;
 	int hot_trip_id;
 	struct thermal_zone_device *zone;
-	struct thermal_zone_device_ops *override_ops;
+	struct thermal_sensor_ops *override_ops;
 	void *priv_data;
 	struct acpi_lpat_conversion_table *lpat_table;
 };
 
 struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *,
-				struct thermal_zone_device_ops *override_ops);
+				struct thermal_sensor_ops *override_ops);
 void int340x_thermal_zone_remove(struct int34x_thermal_zone *);
 int int340x_thermal_read_trips(struct int34x_thermal_zone *int34x_zone);
 
diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
index a8d98f1bd6c6..4b8544f72a23 100644
--- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
+++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
@@ -207,7 +207,7 @@ static int proc_thermal_get_zone_temp(struct thermal_zone_device *zone,
 	return ret;
 }
 
-static struct thermal_zone_device_ops proc_thermal_local_ops = {
+static struct thermal_sensor_ops proc_thermal_local_ops = {
 	.get_temp       = proc_thermal_get_zone_temp,
 };
 
@@ -285,7 +285,7 @@ int proc_thermal_add(struct device *dev, struct proc_thermal_device *proc_priv)
 	struct acpi_device *adev;
 	acpi_status status;
 	unsigned long long tmp;
-	struct thermal_zone_device_ops *ops = NULL;
+	struct thermal_sensor_ops *ops = NULL;
 	int ret;
 
 	adev = ACPI_COMPANION(dev);
diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
index ca40b0967cdd..5316143b09b2 100644
--- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
+++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
@@ -200,7 +200,7 @@ static int sys_set_trip_temp(struct thermal_zone_device *tzd, int trip, int temp
 	return 0;
 }
 
-static struct thermal_zone_device_ops tzone_ops = {
+static struct thermal_sensor_ops tzone_ops = {
 	.get_temp = sys_get_curr_temp,
 	.get_trip_temp = sys_get_trip_temp,
 	.get_trip_type = sys_get_trip_type,
diff --git a/drivers/thermal/intel/intel_pch_thermal.c b/drivers/thermal/intel/intel_pch_thermal.c
index 527c91f5960b..e2161ab647b0 100644
--- a/drivers/thermal/intel/intel_pch_thermal.c
+++ b/drivers/thermal/intel/intel_pch_thermal.c
@@ -331,7 +331,7 @@ static void pch_critical(struct thermal_zone_device *tzd)
 	dev_dbg(&tzd->device, "%s: critical temperature reached\n", tzd->type);
 }
 
-static struct thermal_zone_device_ops tzd_ops = {
+static struct thermal_sensor_ops tzd_ops = {
 	.get_temp = pch_thermal_get_temp,
 	.get_trip_type = pch_get_trip_type,
 	.get_trip_temp = pch_get_trip_temp,
diff --git a/drivers/thermal/intel/intel_quark_dts_thermal.c b/drivers/thermal/intel/intel_quark_dts_thermal.c
index 3eafc6b0e6c3..636286dc90fc 100644
--- a/drivers/thermal/intel/intel_quark_dts_thermal.c
+++ b/drivers/thermal/intel/intel_quark_dts_thermal.c
@@ -313,7 +313,7 @@ static int sys_change_mode(struct thermal_zone_device *tzd,
 	return ret;
 }
 
-static struct thermal_zone_device_ops tzone_ops = {
+static struct thermal_sensor_ops tzone_ops = {
 	.get_temp = sys_get_curr_temp,
 	.get_trip_temp = sys_get_trip_temp,
 	.get_trip_type = sys_get_trip_type,
diff --git a/drivers/thermal/intel/intel_soc_dts_iosf.c b/drivers/thermal/intel/intel_soc_dts_iosf.c
index 342b0bb5a56d..38ce8426fc35 100644
--- a/drivers/thermal/intel/intel_soc_dts_iosf.c
+++ b/drivers/thermal/intel/intel_soc_dts_iosf.c
@@ -243,7 +243,7 @@ static int sys_get_curr_temp(struct thermal_zone_device *tzd,
 	return 0;
 }
 
-static struct thermal_zone_device_ops tzone_ops = {
+static struct thermal_sensor_ops tzone_ops = {
 	.get_temp = sys_get_curr_temp,
 	.get_trip_temp = sys_get_trip_temp,
 	.get_trip_type = sys_get_trip_type,
diff --git a/drivers/thermal/intel/x86_pkg_temp_thermal.c b/drivers/thermal/intel/x86_pkg_temp_thermal.c
index 4d8edc61a78b..047e27db72fe 100644
--- a/drivers/thermal/intel/x86_pkg_temp_thermal.c
+++ b/drivers/thermal/intel/x86_pkg_temp_thermal.c
@@ -220,7 +220,7 @@ static int sys_get_trip_type(struct thermal_zone_device *thermal, int trip,
 }
 
 /* Thermal zone callback registry */
-static struct thermal_zone_device_ops tzone_ops = {
+static struct thermal_sensor_ops tzone_ops = {
 	.get_temp = sys_get_curr_temp,
 	.get_trip_temp = sys_get_trip_temp,
 	.get_trip_type = sys_get_trip_type,
diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
index 7fb6e476c82a..d8e24549428d 100644
--- a/drivers/thermal/kirkwood_thermal.c
+++ b/drivers/thermal/kirkwood_thermal.c
@@ -51,7 +51,7 @@ static int kirkwood_get_temp(struct thermal_zone_device *thermal,
 	return 0;
 }
 
-static struct thermal_zone_device_ops ops = {
+static struct thermal_sensor_ops ops = {
 	.get_temp = kirkwood_get_temp,
 };
 
diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index b49f04daaf47..a7c22e85adc6 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -327,7 +327,7 @@ static const struct thermal_zone_of_device_ops rcar_thermal_zone_of_ops = {
 	.get_temp	= rcar_thermal_of_get_temp,
 };
 
-static struct thermal_zone_device_ops rcar_thermal_zone_ops = {
+static struct thermal_sensor_ops rcar_thermal_sensor_ops = {
 	.get_temp	= rcar_thermal_get_temp,
 	.get_trip_type	= rcar_thermal_get_trip_type,
 	.get_trip_temp	= rcar_thermal_get_trip_temp,
@@ -534,7 +534,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 			priv->zone = thermal_zone_device_register(
 						"rcar_thermal",
 						1, 0, priv,
-						&rcar_thermal_zone_ops, NULL, 0,
+						&rcar_thermal_sensor_ops, NULL, 0,
 						idle);
 
 			ret = thermal_zone_device_enable(priv->zone);
diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c
index ee33ed692e4f..462a8d4bd1c8 100644
--- a/drivers/thermal/spear_thermal.c
+++ b/drivers/thermal/spear_thermal.c
@@ -41,7 +41,7 @@ static inline int thermal_get_temp(struct thermal_zone_device *thermal,
 	return 0;
 }
 
-static struct thermal_zone_device_ops ops = {
+static struct thermal_sensor_ops ops = {
 	.get_temp = thermal_get_temp,
 };
 
diff --git a/drivers/thermal/st/st_thermal.c b/drivers/thermal/st/st_thermal.c
index 1276b95604fe..c42d9cae5e52 100644
--- a/drivers/thermal/st/st_thermal.c
+++ b/drivers/thermal/st/st_thermal.c
@@ -170,7 +170,7 @@ static int st_thermal_get_trip_temp(struct thermal_zone_device *th,
 	return 0;
 }
 
-static struct thermal_zone_device_ops st_tz_ops = {
+static struct thermal_sensor_ops st_tz_ops = {
 	.get_temp	= st_thermal_get_temp,
 	.get_trip_type	= st_thermal_get_trip_type,
 	.get_trip_temp	= st_thermal_get_trip_temp,
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 82654dc8382b..065dfc179e53 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -1184,7 +1184,7 @@ static void bind_tz(struct thermal_zone_device *tz)
  */
 struct thermal_zone_device *
 thermal_zone_device_register(const char *type, int trips, int mask,
-			     void *devdata, struct thermal_zone_device_ops *ops,
+			     void *devdata, struct thermal_sensor_ops *ops,
 			     struct thermal_zone_params *tzp, int passive_delay,
 			     int polling_delay)
 {
diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
index 9233f7e74454..ef953cba3504 100644
--- a/drivers/thermal/thermal_of.c
+++ b/drivers/thermal/thermal_of.c
@@ -360,7 +360,7 @@ static int of_thermal_get_crit_temp(struct thermal_zone_device *tz,
 	return -EINVAL;
 }
 
-static struct thermal_zone_device_ops of_thermal_ops = {
+static struct thermal_sensor_ops of_thermal_ops = {
 	.get_trip_type = of_thermal_get_trip_type,
 	.get_trip_temp = of_thermal_get_trip_temp,
 	.set_trip_temp = of_thermal_set_trip_temp,
@@ -1046,7 +1046,7 @@ int __init of_parse_thermal_zones(void)
 {
 	struct device_node *np, *child;
 	struct __thermal_zone *tz;
-	struct thermal_zone_device_ops *ops;
+	struct thermal_sensor_ops *ops;
 
 	np = of_find_node_by_name(NULL, "thermal-zones");
 	if (!np) {
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index c314893970b3..991f7bc02d51 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -57,7 +57,7 @@ enum thermal_notify_event {
 	THERMAL_EVENT_KEEP_ALIVE, /* Request for user space handler to respond */
 };
 
-struct thermal_zone_device_ops {
+struct thermal_sensor_ops {
 	int (*bind) (struct thermal_zone_device *,
 		     struct thermal_cooling_device *);
 	int (*unbind) (struct thermal_zone_device *,
@@ -164,7 +164,7 @@ struct thermal_zone_device {
 	int prev_low_trip;
 	int prev_high_trip;
 	atomic_t need_update;
-	struct thermal_zone_device_ops *ops;
+	struct thermal_sensor_ops *ops;
 	struct thermal_zone_params *tzp;
 	struct thermal_governor *governor;
 	void *governor_data;
@@ -361,7 +361,7 @@ void devm_thermal_zone_of_sensor_unregister(struct device *dev,
 
 #ifdef CONFIG_THERMAL
 struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
-		void *, struct thermal_zone_device_ops *,
+		void *, struct thermal_sensor_ops *,
 		struct thermal_zone_params *, int, int);
 void thermal_zone_device_unregister(struct thermal_zone_device *);
 
@@ -396,7 +396,7 @@ void thermal_zone_device_critical(struct thermal_zone_device *tz);
 #else
 static inline struct thermal_zone_device *thermal_zone_device_register(
 	const char *type, int trips, int mask, void *devdata,
-	struct thermal_zone_device_ops *ops,
+	struct thermal_sensor_ops *ops,
 	struct thermal_zone_params *tzp,
 	int passive_delay, int polling_delay)
 { return ERR_PTR(-ENODEV); }
-- 
2.25.1


WARNING: multiple messages have this Message-ID (diff)
From: Daniel Lezcano <daniel.lezcano@linexp.org>
To: daniel.lezcano@linaro.org, rafael@kernel.org
Cc: khilman@baylibre.com, abailon@baylibre.com,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Amit Kucheria" <amitk@kernel.org>,
	"Zhang Rui" <rui.zhang@intel.com>,
	"Jonathan Corbet" <corbet@lwn.net>, "Len Brown" <lenb@kernel.org>,
	"Raju Rangoju" <rajur@chelsio.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Ido Schimmel" <idosch@nvidia.com>,
	"Petr Machata" <petrm@nvidia.com>,
	"Luca Coelho" <luciano.coelho@intel.com>,
	"Kalle Valo" <kvalo@kernel.org>, "Peter Kaestle" <peter@piie.net>,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Mark Gross" <markgross@kernel.org>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Support Opensource" <support.opensource@diasemi.com>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	"NXP Linux Team" <linux-imx@nxp.com>,
	"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
	"Miri Korenblit" <miriam.rachel.korenblit@intel.com>,
	"Johannes Berg" <johannes.berg@intel.com>,
	"Srinivas Pandruvada" <srinivas.pandruvada@linux.intel.com>,
	"Sumeet Pawnikar" <sumeet.r.pawnikar@intel.com>,
	"Dan Carpenter" <dan.carpenter@oracle.com>,
	"Chuansheng Liu" <chuansheng.liu@intel.com>,
	"Jiasheng Jiang" <jiasheng@iscas.ac.cn>,
	"Antoine Tenart" <atenart@kernel.org>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	linux-doc@vger.kernel.org (open list:DOCUMENTATION),
	linux-acpi@vger.kernel.org (open list:ACPI THERMAL DRIVER),
	netdev@vger.kernel.org (open list:CXGB4 ETHERNET DRIVER (CXGB4)),
	linux-wireless@vger.kernel.org (open list:INTEL WIRELESS WIFI
	LINK (iwlwifi)),
	platform-driver-x86@vger.kernel.org (open list:ACER ASPIRE ONE
	TEMPERATURE AND FAN DRIVER),
	linux-arm-kernel@lists.infradead.org (moderated
	list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE),
	linux-renesas-soc@vger.kernel.org (open list:RENESAS R-CAR
	THERMAL DRIVERS)
Subject: [PATCH v2 01/14] thermal/core: Change thermal_zone_ops to thermal_sensor_ops
Date: Sat,  7 May 2022 14:54:29 +0200	[thread overview]
Message-ID: <20220507125443.2766939-2-daniel.lezcano@linexp.org> (raw)
In-Reply-To: <20220507125443.2766939-1-daniel.lezcano@linexp.org>

A thermal zone is software abstraction of a sensor associated with
properties and cooling devices if any.

The fact that we have thermal_zone and thermal_zone_ops mixed is
confusing and does not clearly identify the different components
entering in the thermal management process. A thermal zone appears to
be a sensor while it is not.

In order to set the scene for multiple thermal sensors aggregated into
a single thermal zone. Rename the thermal_zone_ops to
thermal_sensor_ops, that will appear clearyl the thermal zone is not a
sensor but an abstraction of one [or multiple] sensor(s).

Cc: Alexandre Bailon <abailon@baylibre.com>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc; Eduardo Valentin <eduval@amazon.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linexp.org>
---
 Documentation/driver-api/thermal/sysfs-api.rst            | 2 +-
 drivers/acpi/thermal.c                                    | 6 +++---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c        | 2 +-
 drivers/net/ethernet/mellanox/mlxsw/core_thermal.c        | 6 +++---
 drivers/net/wireless/intel/iwlwifi/mvm/tt.c               | 2 +-
 drivers/platform/x86/acerhdf.c                            | 2 +-
 drivers/power/supply/power_supply_core.c                  | 2 +-
 drivers/thermal/armada_thermal.c                          | 2 +-
 drivers/thermal/da9062-thermal.c                          | 2 +-
 drivers/thermal/dove_thermal.c                            | 2 +-
 drivers/thermal/imx_thermal.c                             | 2 +-
 drivers/thermal/intel/int340x_thermal/int3400_thermal.c   | 2 +-
 .../thermal/intel/int340x_thermal/int340x_thermal_zone.c  | 6 +++---
 .../thermal/intel/int340x_thermal/int340x_thermal_zone.h  | 4 ++--
 .../intel/int340x_thermal/processor_thermal_device.c      | 4 ++--
 .../intel/int340x_thermal/processor_thermal_device_pci.c  | 2 +-
 drivers/thermal/intel/intel_pch_thermal.c                 | 2 +-
 drivers/thermal/intel/intel_quark_dts_thermal.c           | 2 +-
 drivers/thermal/intel/intel_soc_dts_iosf.c                | 2 +-
 drivers/thermal/intel/x86_pkg_temp_thermal.c              | 2 +-
 drivers/thermal/kirkwood_thermal.c                        | 2 +-
 drivers/thermal/rcar_thermal.c                            | 4 ++--
 drivers/thermal/spear_thermal.c                           | 2 +-
 drivers/thermal/st/st_thermal.c                           | 2 +-
 drivers/thermal/thermal_core.c                            | 2 +-
 drivers/thermal/thermal_of.c                              | 4 ++--
 include/linux/thermal.h                                   | 8 ++++----
 27 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/Documentation/driver-api/thermal/sysfs-api.rst b/Documentation/driver-api/thermal/sysfs-api.rst
index 2e0f79a9e2ee..6dff5e6e1166 100644
--- a/Documentation/driver-api/thermal/sysfs-api.rst
+++ b/Documentation/driver-api/thermal/sysfs-api.rst
@@ -41,7 +41,7 @@ temperature) and throttle appropriate devices.
 	struct thermal_zone_device
 	*thermal_zone_device_register(char *type,
 				      int trips, int mask, void *devdata,
-				      struct thermal_zone_device_ops *ops,
+				      struct thermal_sensor_ops *ops,
 				      const struct thermal_zone_params *tzp,
 				      int passive_delay, int polling_delay))
 
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 539660ef93c7..c2b8100f9cd8 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -774,7 +774,7 @@ acpi_thermal_unbind_cooling_device(struct thermal_zone_device *thermal,
 	return acpi_thermal_cooling_device_cb(thermal, cdev, false);
 }
 
-static struct thermal_zone_device_ops acpi_thermal_zone_ops = {
+static struct thermal_sensor_ops acpi_thermal_sensor_ops = {
 	.bind = acpi_thermal_bind_cooling_device,
 	.unbind	= acpi_thermal_unbind_cooling_device,
 	.get_temp = thermal_get_temp,
@@ -808,13 +808,13 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
 	if (tz->trips.passive.flags.valid)
 		tz->thermal_zone =
 			thermal_zone_device_register("acpitz", trips, 0, tz,
-						&acpi_thermal_zone_ops, NULL,
+						&acpi_thermal_sensor_ops, NULL,
 						     tz->trips.passive.tsp*100,
 						     tz->polling_frequency*100);
 	else
 		tz->thermal_zone =
 			thermal_zone_device_register("acpitz", trips, 0, tz,
-						&acpi_thermal_zone_ops, NULL,
+						&acpi_thermal_sensor_ops, NULL,
 						0, tz->polling_frequency*100);
 	if (IS_ERR(tz->thermal_zone))
 		return -ENODEV;
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c
index 9a6d65243334..239824e90fbe 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c
@@ -53,7 +53,7 @@ static int cxgb4_thermal_get_trip_temp(struct thermal_zone_device *tzdev,
 	return 0;
 }
 
-static struct thermal_zone_device_ops cxgb4_thermal_ops = {
+static struct thermal_sensor_ops cxgb4_thermal_ops = {
 	.get_temp = cxgb4_thermal_get_temp,
 	.get_trip_type = cxgb4_thermal_get_trip_type,
 	.get_trip_temp = cxgb4_thermal_get_trip_temp,
diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
index 05f54bd982c0..cf609dc39acd 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c
@@ -361,7 +361,7 @@ static struct thermal_zone_params mlxsw_thermal_params = {
 	.no_hwmon = true,
 };
 
-static struct thermal_zone_device_ops mlxsw_thermal_ops = {
+static struct thermal_sensor_ops mlxsw_thermal_ops = {
 	.bind = mlxsw_thermal_bind,
 	.unbind = mlxsw_thermal_unbind,
 	.get_temp = mlxsw_thermal_get_temp,
@@ -553,7 +553,7 @@ static int mlxsw_thermal_module_trend_get(struct thermal_zone_device *tzdev,
 	return 0;
 }
 
-static struct thermal_zone_device_ops mlxsw_thermal_module_ops = {
+static struct thermal_sensor_ops mlxsw_thermal_module_ops = {
 	.bind		= mlxsw_thermal_module_bind,
 	.unbind		= mlxsw_thermal_module_unbind,
 	.get_temp	= mlxsw_thermal_module_temp_get,
@@ -590,7 +590,7 @@ static int mlxsw_thermal_gearbox_temp_get(struct thermal_zone_device *tzdev,
 	return 0;
 }
 
-static struct thermal_zone_device_ops mlxsw_thermal_gearbox_ops = {
+static struct thermal_sensor_ops mlxsw_thermal_gearbox_ops = {
 	.bind		= mlxsw_thermal_module_bind,
 	.unbind		= mlxsw_thermal_module_unbind,
 	.get_temp	= mlxsw_thermal_gearbox_temp_get,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
index 69cf3a372759..74109a7d329f 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
@@ -718,7 +718,7 @@ static int iwl_mvm_tzone_set_trip_temp(struct thermal_zone_device *device,
 	return ret;
 }
 
-static  struct thermal_zone_device_ops tzone_ops = {
+static  struct thermal_sensor_ops tzone_ops = {
 	.get_temp = iwl_mvm_tzone_get_temp,
 	.get_trip_temp = iwl_mvm_tzone_get_trip_temp,
 	.get_trip_type = iwl_mvm_tzone_get_trip_type,
diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
index 3463629f8764..b9e8f6c60714 100644
--- a/drivers/platform/x86/acerhdf.c
+++ b/drivers/platform/x86/acerhdf.c
@@ -469,7 +469,7 @@ static int acerhdf_get_crit_temp(struct thermal_zone_device *thermal,
 }
 
 /* bind callback functions to thermalzone */
-static struct thermal_zone_device_ops acerhdf_dev_ops = {
+static struct thermal_sensor_ops acerhdf_dev_ops = {
 	.bind = acerhdf_bind,
 	.unbind = acerhdf_unbind,
 	.get_temp = acerhdf_get_ec_temp,
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index d925cb137e12..5ada4a94b4e3 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -1149,7 +1149,7 @@ static int power_supply_read_temp(struct thermal_zone_device *tzd,
 	return ret;
 }
 
-static struct thermal_zone_device_ops psy_tzd_ops = {
+static struct thermal_sensor_ops psy_tzd_ops = {
 	.get_temp = power_supply_read_temp,
 };
 
diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index c2ebfb5be4b3..703ace32a217 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -416,7 +416,7 @@ static int armada_get_temp_legacy(struct thermal_zone_device *thermal,
 	return ret;
 }
 
-static struct thermal_zone_device_ops legacy_ops = {
+static struct thermal_sensor_ops legacy_ops = {
 	.get_temp = armada_get_temp_legacy,
 };
 
diff --git a/drivers/thermal/da9062-thermal.c b/drivers/thermal/da9062-thermal.c
index 180edec34e07..d29953eee39f 100644
--- a/drivers/thermal/da9062-thermal.c
+++ b/drivers/thermal/da9062-thermal.c
@@ -170,7 +170,7 @@ static int da9062_thermal_get_temp(struct thermal_zone_device *z,
 	return 0;
 }
 
-static struct thermal_zone_device_ops da9062_thermal_ops = {
+static struct thermal_sensor_ops da9062_thermal_ops = {
 	.get_temp	= da9062_thermal_get_temp,
 	.get_trip_type	= da9062_thermal_get_trip_type,
 	.get_trip_temp	= da9062_thermal_get_trip_temp,
diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c
index 73182eb94bc0..170a1168ae38 100644
--- a/drivers/thermal/dove_thermal.c
+++ b/drivers/thermal/dove_thermal.c
@@ -109,7 +109,7 @@ static int dove_get_temp(struct thermal_zone_device *thermal,
 	return 0;
 }
 
-static struct thermal_zone_device_ops ops = {
+static struct thermal_sensor_ops ops = {
 	.get_temp = dove_get_temp,
 };
 
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index 16663373b682..c57fa2029ee0 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -418,7 +418,7 @@ static int imx_unbind(struct thermal_zone_device *tz,
 	return 0;
 }
 
-static struct thermal_zone_device_ops imx_tz_ops = {
+static struct thermal_sensor_ops imx_tz_ops = {
 	.bind = imx_bind,
 	.unbind = imx_unbind,
 	.get_temp = imx_get_temp,
diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
index 4954800b9850..cad48a886888 100644
--- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
@@ -485,7 +485,7 @@ static int int3400_thermal_change_mode(struct thermal_zone_device *thermal,
 	return result;
 }
 
-static struct thermal_zone_device_ops int3400_thermal_ops = {
+static struct thermal_sensor_ops int3400_thermal_ops = {
 	.get_temp = int3400_thermal_get_temp,
 	.change_mode = int3400_thermal_change_mode,
 };
diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
index 62c0aa5d0783..d78f29208352 100644
--- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
+++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.c
@@ -151,7 +151,7 @@ static void int340x_thermal_critical(struct thermal_zone_device *zone)
 	dev_dbg(&zone->device, "%s: critical temperature reached\n", zone->type);
 }
 
-static struct thermal_zone_device_ops int340x_thermal_zone_ops = {
+static struct thermal_sensor_ops int340x_thermal_sensor_ops = {
 	.get_temp       = int340x_thermal_get_zone_temp,
 	.get_trip_temp	= int340x_thermal_get_trip_temp,
 	.get_trip_type	= int340x_thermal_get_trip_type,
@@ -217,7 +217,7 @@ static struct thermal_zone_params int340x_thermal_params = {
 };
 
 struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
-				struct thermal_zone_device_ops *override_ops)
+				struct thermal_sensor_ops *override_ops)
 {
 	struct int34x_thermal_zone *int34x_thermal_zone;
 	acpi_status status;
@@ -262,7 +262,7 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
 						acpi_device_bid(adev),
 						trip_cnt,
 						trip_mask, int34x_thermal_zone,
-						&int340x_thermal_zone_ops,
+						&int340x_thermal_sensor_ops,
 						&int340x_thermal_params,
 						0, 0);
 	if (IS_ERR(int34x_thermal_zone->zone)) {
diff --git a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.h b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.h
index 3b4971df1b33..a25c45e2eb66 100644
--- a/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.h
+++ b/drivers/thermal/intel/int340x_thermal/int340x_thermal_zone.h
@@ -29,13 +29,13 @@ struct int34x_thermal_zone {
 	int hot_temp;
 	int hot_trip_id;
 	struct thermal_zone_device *zone;
-	struct thermal_zone_device_ops *override_ops;
+	struct thermal_sensor_ops *override_ops;
 	void *priv_data;
 	struct acpi_lpat_conversion_table *lpat_table;
 };
 
 struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *,
-				struct thermal_zone_device_ops *override_ops);
+				struct thermal_sensor_ops *override_ops);
 void int340x_thermal_zone_remove(struct int34x_thermal_zone *);
 int int340x_thermal_read_trips(struct int34x_thermal_zone *int34x_zone);
 
diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
index a8d98f1bd6c6..4b8544f72a23 100644
--- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
+++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device.c
@@ -207,7 +207,7 @@ static int proc_thermal_get_zone_temp(struct thermal_zone_device *zone,
 	return ret;
 }
 
-static struct thermal_zone_device_ops proc_thermal_local_ops = {
+static struct thermal_sensor_ops proc_thermal_local_ops = {
 	.get_temp       = proc_thermal_get_zone_temp,
 };
 
@@ -285,7 +285,7 @@ int proc_thermal_add(struct device *dev, struct proc_thermal_device *proc_priv)
 	struct acpi_device *adev;
 	acpi_status status;
 	unsigned long long tmp;
-	struct thermal_zone_device_ops *ops = NULL;
+	struct thermal_sensor_ops *ops = NULL;
 	int ret;
 
 	adev = ACPI_COMPANION(dev);
diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
index ca40b0967cdd..5316143b09b2 100644
--- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
+++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
@@ -200,7 +200,7 @@ static int sys_set_trip_temp(struct thermal_zone_device *tzd, int trip, int temp
 	return 0;
 }
 
-static struct thermal_zone_device_ops tzone_ops = {
+static struct thermal_sensor_ops tzone_ops = {
 	.get_temp = sys_get_curr_temp,
 	.get_trip_temp = sys_get_trip_temp,
 	.get_trip_type = sys_get_trip_type,
diff --git a/drivers/thermal/intel/intel_pch_thermal.c b/drivers/thermal/intel/intel_pch_thermal.c
index 527c91f5960b..e2161ab647b0 100644
--- a/drivers/thermal/intel/intel_pch_thermal.c
+++ b/drivers/thermal/intel/intel_pch_thermal.c
@@ -331,7 +331,7 @@ static void pch_critical(struct thermal_zone_device *tzd)
 	dev_dbg(&tzd->device, "%s: critical temperature reached\n", tzd->type);
 }
 
-static struct thermal_zone_device_ops tzd_ops = {
+static struct thermal_sensor_ops tzd_ops = {
 	.get_temp = pch_thermal_get_temp,
 	.get_trip_type = pch_get_trip_type,
 	.get_trip_temp = pch_get_trip_temp,
diff --git a/drivers/thermal/intel/intel_quark_dts_thermal.c b/drivers/thermal/intel/intel_quark_dts_thermal.c
index 3eafc6b0e6c3..636286dc90fc 100644
--- a/drivers/thermal/intel/intel_quark_dts_thermal.c
+++ b/drivers/thermal/intel/intel_quark_dts_thermal.c
@@ -313,7 +313,7 @@ static int sys_change_mode(struct thermal_zone_device *tzd,
 	return ret;
 }
 
-static struct thermal_zone_device_ops tzone_ops = {
+static struct thermal_sensor_ops tzone_ops = {
 	.get_temp = sys_get_curr_temp,
 	.get_trip_temp = sys_get_trip_temp,
 	.get_trip_type = sys_get_trip_type,
diff --git a/drivers/thermal/intel/intel_soc_dts_iosf.c b/drivers/thermal/intel/intel_soc_dts_iosf.c
index 342b0bb5a56d..38ce8426fc35 100644
--- a/drivers/thermal/intel/intel_soc_dts_iosf.c
+++ b/drivers/thermal/intel/intel_soc_dts_iosf.c
@@ -243,7 +243,7 @@ static int sys_get_curr_temp(struct thermal_zone_device *tzd,
 	return 0;
 }
 
-static struct thermal_zone_device_ops tzone_ops = {
+static struct thermal_sensor_ops tzone_ops = {
 	.get_temp = sys_get_curr_temp,
 	.get_trip_temp = sys_get_trip_temp,
 	.get_trip_type = sys_get_trip_type,
diff --git a/drivers/thermal/intel/x86_pkg_temp_thermal.c b/drivers/thermal/intel/x86_pkg_temp_thermal.c
index 4d8edc61a78b..047e27db72fe 100644
--- a/drivers/thermal/intel/x86_pkg_temp_thermal.c
+++ b/drivers/thermal/intel/x86_pkg_temp_thermal.c
@@ -220,7 +220,7 @@ static int sys_get_trip_type(struct thermal_zone_device *thermal, int trip,
 }
 
 /* Thermal zone callback registry */
-static struct thermal_zone_device_ops tzone_ops = {
+static struct thermal_sensor_ops tzone_ops = {
 	.get_temp = sys_get_curr_temp,
 	.get_trip_temp = sys_get_trip_temp,
 	.get_trip_type = sys_get_trip_type,
diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
index 7fb6e476c82a..d8e24549428d 100644
--- a/drivers/thermal/kirkwood_thermal.c
+++ b/drivers/thermal/kirkwood_thermal.c
@@ -51,7 +51,7 @@ static int kirkwood_get_temp(struct thermal_zone_device *thermal,
 	return 0;
 }
 
-static struct thermal_zone_device_ops ops = {
+static struct thermal_sensor_ops ops = {
 	.get_temp = kirkwood_get_temp,
 };
 
diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index b49f04daaf47..a7c22e85adc6 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -327,7 +327,7 @@ static const struct thermal_zone_of_device_ops rcar_thermal_zone_of_ops = {
 	.get_temp	= rcar_thermal_of_get_temp,
 };
 
-static struct thermal_zone_device_ops rcar_thermal_zone_ops = {
+static struct thermal_sensor_ops rcar_thermal_sensor_ops = {
 	.get_temp	= rcar_thermal_get_temp,
 	.get_trip_type	= rcar_thermal_get_trip_type,
 	.get_trip_temp	= rcar_thermal_get_trip_temp,
@@ -534,7 +534,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 			priv->zone = thermal_zone_device_register(
 						"rcar_thermal",
 						1, 0, priv,
-						&rcar_thermal_zone_ops, NULL, 0,
+						&rcar_thermal_sensor_ops, NULL, 0,
 						idle);
 
 			ret = thermal_zone_device_enable(priv->zone);
diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c
index ee33ed692e4f..462a8d4bd1c8 100644
--- a/drivers/thermal/spear_thermal.c
+++ b/drivers/thermal/spear_thermal.c
@@ -41,7 +41,7 @@ static inline int thermal_get_temp(struct thermal_zone_device *thermal,
 	return 0;
 }
 
-static struct thermal_zone_device_ops ops = {
+static struct thermal_sensor_ops ops = {
 	.get_temp = thermal_get_temp,
 };
 
diff --git a/drivers/thermal/st/st_thermal.c b/drivers/thermal/st/st_thermal.c
index 1276b95604fe..c42d9cae5e52 100644
--- a/drivers/thermal/st/st_thermal.c
+++ b/drivers/thermal/st/st_thermal.c
@@ -170,7 +170,7 @@ static int st_thermal_get_trip_temp(struct thermal_zone_device *th,
 	return 0;
 }
 
-static struct thermal_zone_device_ops st_tz_ops = {
+static struct thermal_sensor_ops st_tz_ops = {
 	.get_temp	= st_thermal_get_temp,
 	.get_trip_type	= st_thermal_get_trip_type,
 	.get_trip_temp	= st_thermal_get_trip_temp,
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 82654dc8382b..065dfc179e53 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -1184,7 +1184,7 @@ static void bind_tz(struct thermal_zone_device *tz)
  */
 struct thermal_zone_device *
 thermal_zone_device_register(const char *type, int trips, int mask,
-			     void *devdata, struct thermal_zone_device_ops *ops,
+			     void *devdata, struct thermal_sensor_ops *ops,
 			     struct thermal_zone_params *tzp, int passive_delay,
 			     int polling_delay)
 {
diff --git a/drivers/thermal/thermal_of.c b/drivers/thermal/thermal_of.c
index 9233f7e74454..ef953cba3504 100644
--- a/drivers/thermal/thermal_of.c
+++ b/drivers/thermal/thermal_of.c
@@ -360,7 +360,7 @@ static int of_thermal_get_crit_temp(struct thermal_zone_device *tz,
 	return -EINVAL;
 }
 
-static struct thermal_zone_device_ops of_thermal_ops = {
+static struct thermal_sensor_ops of_thermal_ops = {
 	.get_trip_type = of_thermal_get_trip_type,
 	.get_trip_temp = of_thermal_get_trip_temp,
 	.set_trip_temp = of_thermal_set_trip_temp,
@@ -1046,7 +1046,7 @@ int __init of_parse_thermal_zones(void)
 {
 	struct device_node *np, *child;
 	struct __thermal_zone *tz;
-	struct thermal_zone_device_ops *ops;
+	struct thermal_sensor_ops *ops;
 
 	np = of_find_node_by_name(NULL, "thermal-zones");
 	if (!np) {
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index c314893970b3..991f7bc02d51 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -57,7 +57,7 @@ enum thermal_notify_event {
 	THERMAL_EVENT_KEEP_ALIVE, /* Request for user space handler to respond */
 };
 
-struct thermal_zone_device_ops {
+struct thermal_sensor_ops {
 	int (*bind) (struct thermal_zone_device *,
 		     struct thermal_cooling_device *);
 	int (*unbind) (struct thermal_zone_device *,
@@ -164,7 +164,7 @@ struct thermal_zone_device {
 	int prev_low_trip;
 	int prev_high_trip;
 	atomic_t need_update;
-	struct thermal_zone_device_ops *ops;
+	struct thermal_sensor_ops *ops;
 	struct thermal_zone_params *tzp;
 	struct thermal_governor *governor;
 	void *governor_data;
@@ -361,7 +361,7 @@ void devm_thermal_zone_of_sensor_unregister(struct device *dev,
 
 #ifdef CONFIG_THERMAL
 struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
-		void *, struct thermal_zone_device_ops *,
+		void *, struct thermal_sensor_ops *,
 		struct thermal_zone_params *, int, int);
 void thermal_zone_device_unregister(struct thermal_zone_device *);
 
@@ -396,7 +396,7 @@ void thermal_zone_device_critical(struct thermal_zone_device *tz);
 #else
 static inline struct thermal_zone_device *thermal_zone_device_register(
 	const char *type, int trips, int mask, void *devdata,
-	struct thermal_zone_device_ops *ops,
+	struct thermal_sensor_ops *ops,
 	struct thermal_zone_params *tzp,
 	int passive_delay, int polling_delay)
 { return ERR_PTR(-ENODEV); }
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-05-07 12:55 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-07 12:54 [PATCH v2 00/14] thermal OF rework Daniel Lezcano
2022-05-07 12:54 ` Daniel Lezcano [this message]
2022-05-07 12:54   ` [PATCH v2 01/14] thermal/core: Change thermal_zone_ops to thermal_sensor_ops Daniel Lezcano
2022-05-08 10:26   ` Andy Shevchenko
2022-05-08 10:26     ` Andy Shevchenko
2022-05-09  9:20   ` Geert Uytterhoeven
2022-05-09  9:20     ` Geert Uytterhoeven
2022-05-17 15:42   ` Rafael J. Wysocki
2022-05-17 15:42     ` Rafael J. Wysocki
2022-05-17 16:50     ` srinivas pandruvada
2022-05-17 16:50       ` srinivas pandruvada
2022-05-17 18:53       ` Rafael J. Wysocki
2022-05-17 18:53         ` Rafael J. Wysocki
2022-05-17 19:02         ` srinivas pandruvada
2022-05-17 19:02           ` srinivas pandruvada
2022-05-17 19:07           ` Rafael J. Wysocki
2022-05-17 19:07             ` Rafael J. Wysocki
2022-06-26 17:33     ` Daniel Lezcano
2022-06-26 17:33       ` Daniel Lezcano
2022-05-07 12:54 ` [PATCH v2 02/14] thermal/core: Add a thermal sensor structure in the thermal zone Daniel Lezcano
2022-05-07 12:54   ` Daniel Lezcano
2022-05-09  7:00   ` Krzysztof Kozlowski
2022-05-09  7:00     ` Krzysztof Kozlowski
2022-05-09  9:28   ` Geert Uytterhoeven
2022-05-09  9:28     ` Geert Uytterhoeven
2022-05-07 12:54 ` [PATCH v2 03/14] thermal/core: Remove duplicate information when an error occurs Daniel Lezcano
2022-05-17 15:45   ` Rafael J. Wysocki
2022-05-07 12:54 ` [PATCH v2 04/14] thermal/of: Replace device node match with device node search Daniel Lezcano
2022-05-07 12:54 ` [PATCH v2 05/14] thermal/of: Remove the device node pointer for thermal_trip Daniel Lezcano
2022-05-07 12:54 ` [PATCH v2 06/14] thermal/of: Move thermal_trip structure to thermal.h Daniel Lezcano
2022-05-07 12:54 ` [PATCH v2 07/14] thermal/core: Remove unneeded EXPORT_SYMBOLS Daniel Lezcano
2022-05-07 12:54 ` [PATCH v2 08/14] thermal/core: Move thermal_set_delay_jiffies to static Daniel Lezcano
2022-05-07 12:54 ` [PATCH v2 09/14] thermal/core: Rename trips to ntrips Daniel Lezcano
2022-05-07 12:54 ` [PATCH v2 10/14] thermal/core: Add thermal_trip in thermal_zone Daniel Lezcano
2022-05-07 12:54 ` [PATCH v2 11/14] thermal/core: Register with the trip points Daniel Lezcano
2022-05-07 12:54 ` [PATCH v2 12/14] thermal/of: Store the trips in the thermal zone Daniel Lezcano
2022-05-07 12:54 ` [PATCH v2 13/14] thermal/of: Use thermal trips stored " Daniel Lezcano
2022-05-07 12:54 ` [PATCH v2 14/14] thermal/of: Initialize trip points separately Daniel Lezcano
2022-05-13 17:23 ` [PATCH v2 00/14] thermal OF rework Daniel Lezcano
2022-05-13 17:56   ` Rafael J. Wysocki
2022-05-13 19:18     ` Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220507125443.2766939-2-daniel.lezcano@linexp.org \
    --to=daniel.lezcano@linexp.org \
    --cc=abailon@baylibre.com \
    --cc=amitk@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=atenart@kernel.org \
    --cc=chuansheng.liu@intel.com \
    --cc=corbet@lwn.net \
    --cc=dan.carpenter@oracle.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=davem@davemloft.net \
    --cc=festevam@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=idosch@nvidia.com \
    --cc=jiasheng@iscas.ac.cn \
    --cc=johannes.berg@intel.com \
    --cc=kernel@pengutronix.de \
    --cc=khilman@baylibre.com \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=markgross@kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=miriam.rachel.korenblit@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=pabeni@redhat.com \
    --cc=peter@piie.net \
    --cc=petrm@nvidia.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rajur@chelsio.com \
    --cc=rui.zhang@intel.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=sre@kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=sumeet.r.pawnikar@intel.com \
    --cc=support.opensource@diasemi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.