@@ -41,7 +41,7 @@ temperature) and throttle appropriate devices.
struct thermal_zone
*thermal_zone_register(char *type,
int trips, int mask, void *devdata,
- struct thermal_zone_ops *ops,
+ struct thermal_sensor_ops *ops,
const struct thermal_zone_params *tzp,
int passive_delay, int polling_delay))
@@ -774,7 +774,7 @@ acpi_thermal_unbind_cooling_device(struct thermal_zone *thermal,
return acpi_thermal_cooling_device_cb(thermal, cdev, false);
}
-static struct thermal_zone_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_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_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;
@@ -53,7 +53,7 @@ static int cxgb4_thermal_get_trip_temp(struct thermal_zone *tzdev,
return 0;
}
-static struct thermal_zone_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,
@@ -361,7 +361,7 @@ static struct thermal_zone_params mlxsw_thermal_params = {
.no_hwmon = true,
};
-static struct thermal_zone_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 *tzdev,
return 0;
}
-static struct thermal_zone_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 *tzdev,
return 0;
}
-static struct thermal_zone_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,
@@ -718,7 +718,7 @@ static int iwl_mvm_tzone_set_trip_temp(struct thermal_zone *device,
return ret;
}
-static struct thermal_zone_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,
@@ -469,7 +469,7 @@ static int acerhdf_get_crit_temp(struct thermal_zone *thermal,
}
/* bind callback functions to thermalzone */
-static struct thermal_zone_ops acerhdf_dev_ops = {
+static struct thermal_sensor_ops acerhdf_dev_ops = {
.bind = acerhdf_bind,
.unbind = acerhdf_unbind,
.get_temp = acerhdf_get_ec_temp,
@@ -1149,7 +1149,7 @@ static int power_supply_read_temp(struct thermal_zone *tzd,
return ret;
}
-static struct thermal_zone_ops psy_tzd_ops = {
+static struct thermal_sensor_ops psy_tzd_ops = {
.get_temp = power_supply_read_temp,
};
@@ -416,7 +416,7 @@ static int armada_get_temp_legacy(struct thermal_zone *thermal,
return ret;
}
-static struct thermal_zone_ops legacy_ops = {
+static struct thermal_sensor_ops legacy_ops = {
.get_temp = armada_get_temp_legacy,
};
@@ -170,7 +170,7 @@ static int da9062_thermal_get_temp(struct thermal_zone *z,
return 0;
}
-static struct thermal_zone_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,
@@ -109,7 +109,7 @@ static int dove_get_temp(struct thermal_zone *thermal,
return 0;
}
-static struct thermal_zone_ops ops = {
+static struct thermal_sensor_ops ops = {
.get_temp = dove_get_temp,
};
@@ -418,7 +418,7 @@ static int imx_unbind(struct thermal_zone *tz,
return 0;
}
-static struct thermal_zone_ops imx_tz_ops = {
+static struct thermal_sensor_ops imx_tz_ops = {
.bind = imx_bind,
.unbind = imx_unbind,
.get_temp = imx_get_temp,
@@ -485,7 +485,7 @@ static int int3400_thermal_change_mode(struct thermal_zone *thermal,
return result;
}
-static struct thermal_zone_ops int3400_thermal_ops = {
+static struct thermal_sensor_ops int3400_thermal_ops = {
.get_temp = int3400_thermal_get_temp,
.change_mode = int3400_thermal_change_mode,
};
@@ -151,7 +151,7 @@ static void int340x_thermal_critical(struct thermal_zone *zone)
dev_dbg(&zone->device, "%s: critical temperature reached\n", zone->type);
}
-static struct thermal_zone_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_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)) {
@@ -29,13 +29,13 @@ struct int34x_thermal_zone {
int hot_temp;
int hot_trip_id;
struct thermal_zone *zone;
- struct thermal_zone_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_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);
@@ -207,7 +207,7 @@ static int proc_thermal_get_zone_temp(struct thermal_zone *zone,
return ret;
}
-static struct thermal_zone_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_ops *ops = NULL;
+ struct thermal_sensor_ops *ops = NULL;
int ret;
adev = ACPI_COMPANION(dev);
@@ -200,7 +200,7 @@ static int sys_set_trip_temp(struct thermal_zone *tzd, int trip, int temp)
return 0;
}
-static struct thermal_zone_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,
@@ -331,7 +331,7 @@ static void pch_critical(struct thermal_zone *tzd)
dev_dbg(&tzd->device, "%s: critical temperature reached\n", tzd->type);
}
-static struct thermal_zone_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,
@@ -313,7 +313,7 @@ static int sys_change_mode(struct thermal_zone *tzd,
return ret;
}
-static struct thermal_zone_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,
@@ -243,7 +243,7 @@ static int sys_get_curr_temp(struct thermal_zone *tzd,
return 0;
}
-static struct thermal_zone_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,
@@ -220,7 +220,7 @@ static int sys_get_trip_type(struct thermal_zone *thermal, int trip,
}
/* Thermal zone callback registry */
-static struct thermal_zone_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,
@@ -51,7 +51,7 @@ static int kirkwood_get_temp(struct thermal_zone *thermal,
return 0;
}
-static struct thermal_zone_ops ops = {
+static struct thermal_sensor_ops ops = {
.get_temp = kirkwood_get_temp,
};
@@ -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_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_register(
"rcar_thermal",
1, 0, priv,
- &rcar_thermal_zone_ops, NULL, 0,
+ &rcar_thermal_sensor_ops, NULL, 0,
idle);
ret = thermal_zone_enable(priv->zone);
@@ -41,7 +41,7 @@ static inline int thermal_get_temp(struct thermal_zone *thermal,
return 0;
}
-static struct thermal_zone_ops ops = {
+static struct thermal_sensor_ops ops = {
.get_temp = thermal_get_temp,
};
@@ -170,7 +170,7 @@ static int st_thermal_get_trip_temp(struct thermal_zone *th,
return 0;
}
-static struct thermal_zone_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,
@@ -1184,7 +1184,7 @@ static void bind_tz(struct thermal_zone *tz)
*/
struct thermal_zone *
thermal_zone_register(const char *type, int trips, int mask,
- void *devdata, struct thermal_zone_ops *ops,
+ void *devdata, struct thermal_sensor_ops *ops,
struct thermal_zone_params *tzp, int passive_delay,
int polling_delay)
{
@@ -360,7 +360,7 @@ static int of_thermal_get_crit_temp(struct thermal_zone *tz,
return -EINVAL;
}
-static struct thermal_zone_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_ops *ops;
+ struct thermal_sensor_ops *ops;
np = of_find_node_by_name(NULL, "thermal-zones");
if (!np) {
@@ -57,7 +57,7 @@ enum thermal_notify_event {
THERMAL_EVENT_KEEP_ALIVE, /* Request for user space handler to respond */
};
-struct thermal_zone_ops {
+struct thermal_sensor_ops {
int (*bind) (struct thermal_zone *,
struct thermal_cooling_device *);
int (*unbind) (struct thermal_zone *,
@@ -164,7 +164,7 @@ struct thermal_zone {
int prev_low_trip;
int prev_high_trip;
atomic_t need_update;
- struct thermal_zone_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 *thermal_zone_register(const char *, int, int,
- void *, struct thermal_zone_ops *,
+ void *, struct thermal_sensor_ops *,
struct thermal_zone_params *, int, int);
void thermal_zone_unregister(struct thermal_zone *);
@@ -396,7 +396,7 @@ void thermal_zone_critical(struct thermal_zone *tz);
#else
static inline struct thermal_zone *thermal_zone_register(
const char *type, int trips, int mask, void *devdata,
- struct thermal_zone_ops *ops,
+ struct thermal_sensor_ops *ops,
struct thermal_zone_params *tzp,
int passive_delay, int polling_delay)
{ return ERR_PTR(-ENODEV); }
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(-)