2015-11-02 10:18:50 +00:00
|
|
|
From 29e6031548373b9e7ec0c17e85da6a4cf4fee7f5 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
Date: Wed, 13 May 2015 10:52:29 +0200
|
|
|
|
Subject: [PATCH 10/76] thermal: consistently use int for temperatures
|
|
|
|
|
|
|
|
The thermal code uses int, long and unsigned long for temperatures
|
|
|
|
in different places. Using an unsigned type limits the thermal framework
|
|
|
|
to positive temperatures without need. 'long' is 64bit on several
|
|
|
|
architectures which is not needed. Consistently use a plain 'int'
|
|
|
|
for temperatures.
|
|
|
|
|
|
|
|
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
|
|
|
|
---
|
|
|
|
drivers/acpi/thermal.c | 12 ++++-----
|
|
|
|
drivers/hwmon/lm75.c | 2 +-
|
|
|
|
drivers/hwmon/ntc_thermistor.c | 2 +-
|
|
|
|
drivers/hwmon/tmp102.c | 2 +-
|
|
|
|
drivers/input/touchscreen/sun4i-ts.c | 8 +++---
|
|
|
|
drivers/platform/x86/acerhdf.c | 9 +++----
|
|
|
|
drivers/power/power_supply_core.c | 2 +-
|
|
|
|
drivers/thermal/armada_thermal.c | 2 +-
|
|
|
|
drivers/thermal/db8500_thermal.c | 7 +++--
|
|
|
|
drivers/thermal/dove_thermal.c | 2 +-
|
|
|
|
drivers/thermal/fair_share.c | 2 +-
|
|
|
|
drivers/thermal/gov_bang_bang.c | 5 ++--
|
|
|
|
drivers/thermal/imx_thermal.c | 27 ++++++++++----------
|
|
|
|
.../thermal/int340x_thermal/int340x_thermal_zone.c | 10 ++++----
|
|
|
|
.../thermal/int340x_thermal/int340x_thermal_zone.h | 8 +++---
|
|
|
|
drivers/thermal/intel_soc_dts_thermal.c | 7 +++--
|
|
|
|
drivers/thermal/of-thermal.c | 14 +++++-----
|
|
|
|
drivers/thermal/rcar_thermal.c | 7 +++--
|
|
|
|
drivers/thermal/rockchip_thermal.c | 10 ++++----
|
|
|
|
drivers/thermal/samsung/exynos_tmu.c | 19 +++++++-------
|
|
|
|
drivers/thermal/spear_thermal.c | 2 +-
|
|
|
|
drivers/thermal/st/st_thermal.c | 5 ++--
|
|
|
|
drivers/thermal/step_wise.c | 4 +--
|
|
|
|
drivers/thermal/tegra_soctherm.c | 4 +--
|
|
|
|
drivers/thermal/thermal_core.c | 26 +++++++++----------
|
|
|
|
drivers/thermal/thermal_hwmon.c | 10 ++++----
|
|
|
|
drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 10 ++++----
|
|
|
|
drivers/thermal/x86_pkg_temp_thermal.c | 10 ++++----
|
|
|
|
include/linux/thermal.h | 26 ++++++++-----------
|
|
|
|
29 files changed, 120 insertions(+), 134 deletions(-)
|
|
|
|
|
|
|
|
--- a/drivers/acpi/thermal.c
|
|
|
|
+++ b/drivers/acpi/thermal.c
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -529,8 +529,7 @@ static void acpi_thermal_check(void *dat
|
2015-11-02 10:18:50 +00:00
|
|
|
|
|
|
|
/* sys I/F for generic thermal sysfs support */
|
|
|
|
|
|
|
|
-static int thermal_get_temp(struct thermal_zone_device *thermal,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
|
|
|
|
{
|
|
|
|
struct acpi_thermal *tz = thermal->devdata;
|
|
|
|
int result;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -637,7 +636,7 @@ static int thermal_get_trip_type(struct
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
|
|
|
|
- int trip, unsigned long *temp)
|
|
|
|
+ int trip, int *temp)
|
|
|
|
{
|
|
|
|
struct acpi_thermal *tz = thermal->devdata;
|
|
|
|
int i;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -690,7 +689,8 @@ static int thermal_get_trip_temp(struct
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int thermal_get_crit_temp(struct thermal_zone_device *thermal,
|
|
|
|
- unsigned long *temperature) {
|
|
|
|
+ int *temperature)
|
|
|
|
+{
|
|
|
|
struct acpi_thermal *tz = thermal->devdata;
|
|
|
|
|
|
|
|
if (tz->trips.critical.flags.valid) {
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -713,8 +713,8 @@ static int thermal_get_trend(struct ther
|
2015-11-02 10:18:50 +00:00
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
if (type == THERMAL_TRIP_ACTIVE) {
|
|
|
|
- unsigned long trip_temp;
|
|
|
|
- unsigned long temp = DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(
|
|
|
|
+ int trip_temp;
|
|
|
|
+ int temp = DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(
|
|
|
|
tz->temperature, tz->kelvin_offset);
|
|
|
|
if (thermal_get_trip_temp(thermal, trip, &trip_temp))
|
|
|
|
return -EINVAL;
|
|
|
|
--- a/drivers/hwmon/lm75.c
|
|
|
|
+++ b/drivers/hwmon/lm75.c
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -104,7 +104,7 @@ static inline long lm75_reg_to_mc(s16 te
|
2015-11-02 10:18:50 +00:00
|
|
|
|
|
|
|
/* sysfs attributes for hwmon */
|
|
|
|
|
|
|
|
-static int lm75_read_temp(void *dev, long *temp)
|
|
|
|
+static int lm75_read_temp(void *dev, int *temp)
|
|
|
|
{
|
|
|
|
struct lm75_data *data = lm75_update_device(dev);
|
|
|
|
|
|
|
|
--- a/drivers/hwmon/ntc_thermistor.c
|
|
|
|
+++ b/drivers/hwmon/ntc_thermistor.c
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -439,7 +439,7 @@ static int ntc_thermistor_get_ohm(struct
|
2015-11-02 10:18:50 +00:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int ntc_read_temp(void *dev, long *temp)
|
|
|
|
+static int ntc_read_temp(void *dev, int *temp)
|
|
|
|
{
|
|
|
|
struct ntc_data *data = dev_get_drvdata(dev);
|
|
|
|
int ohm;
|
|
|
|
--- a/drivers/hwmon/tmp102.c
|
|
|
|
+++ b/drivers/hwmon/tmp102.c
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -98,7 +98,7 @@ static struct tmp102 *tmp102_update_devi
|
2015-11-02 10:18:50 +00:00
|
|
|
return tmp102;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int tmp102_read_temp(void *dev, long *temp)
|
|
|
|
+static int tmp102_read_temp(void *dev, int *temp)
|
|
|
|
{
|
|
|
|
struct tmp102 *tmp102 = tmp102_update_device(dev);
|
|
|
|
|
|
|
|
--- a/drivers/input/touchscreen/sun4i-ts.c
|
|
|
|
+++ b/drivers/input/touchscreen/sun4i-ts.c
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -191,7 +191,7 @@ static void sun4i_ts_close(struct input_
|
2015-11-02 10:18:50 +00:00
|
|
|
writel(TEMP_IRQ_EN(1), ts->base + TP_INT_FIFOC);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int sun4i_get_temp(const struct sun4i_ts_data *ts, long *temp)
|
|
|
|
+static int sun4i_get_temp(const struct sun4i_ts_data *ts, int *temp)
|
|
|
|
{
|
|
|
|
/* No temp_data until the first irq */
|
|
|
|
if (ts->temp_data == -1)
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -202,7 +202,7 @@ static int sun4i_get_temp(const struct s
|
2015-11-02 10:18:50 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int sun4i_get_tz_temp(void *data, long *temp)
|
|
|
|
+static int sun4i_get_tz_temp(void *data, int *temp)
|
|
|
|
{
|
|
|
|
return sun4i_get_temp(data, temp);
|
|
|
|
}
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -215,14 +215,14 @@ static ssize_t show_temp(struct device *
|
2015-11-02 10:18:50 +00:00
|
|
|
char *buf)
|
|
|
|
{
|
|
|
|
struct sun4i_ts_data *ts = dev_get_drvdata(dev);
|
|
|
|
- long temp;
|
|
|
|
+ int temp;
|
|
|
|
int error;
|
|
|
|
|
|
|
|
error = sun4i_get_temp(ts, &temp);
|
|
|
|
if (error)
|
|
|
|
return error;
|
|
|
|
|
|
|
|
- return sprintf(buf, "%ld\n", temp);
|
|
|
|
+ return sprintf(buf, "%d\n", temp);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ssize_t show_temp_label(struct device *dev,
|
|
|
|
--- a/drivers/platform/x86/acerhdf.c
|
|
|
|
+++ b/drivers/platform/x86/acerhdf.c
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -346,8 +346,7 @@ static void acerhdf_check_param(struct t
|
2015-11-02 10:18:50 +00:00
|
|
|
* as late as the polling interval is since we can't do that in the respective
|
|
|
|
* accessors of the module parameters.
|
|
|
|
*/
|
|
|
|
-static int acerhdf_get_ec_temp(struct thermal_zone_device *thermal,
|
|
|
|
- unsigned long *t)
|
|
|
|
+static int acerhdf_get_ec_temp(struct thermal_zone_device *thermal, int *t)
|
|
|
|
{
|
|
|
|
int temp, err = 0;
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -452,7 +451,7 @@ static int acerhdf_get_trip_type(struct
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int acerhdf_get_trip_hyst(struct thermal_zone_device *thermal, int trip,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+ int *temp)
|
|
|
|
{
|
|
|
|
if (trip != 0)
|
|
|
|
return -EINVAL;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -463,7 +462,7 @@ static int acerhdf_get_trip_hyst(struct
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int acerhdf_get_trip_temp(struct thermal_zone_device *thermal, int trip,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+ int *temp)
|
|
|
|
{
|
|
|
|
if (trip == 0)
|
|
|
|
*temp = fanon;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -476,7 +475,7 @@ static int acerhdf_get_trip_temp(struct
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int acerhdf_get_crit_temp(struct thermal_zone_device *thermal,
|
|
|
|
- unsigned long *temperature)
|
|
|
|
+ int *temperature)
|
|
|
|
{
|
|
|
|
*temperature = ACERHDF_TEMP_CRIT;
|
|
|
|
return 0;
|
|
|
|
--- a/drivers/power/power_supply_core.c
|
|
|
|
+++ b/drivers/power/power_supply_core.c
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -518,7 +518,7 @@ EXPORT_SYMBOL_GPL(power_supply_unreg_not
|
2015-11-02 10:18:50 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_THERMAL
|
|
|
|
static int power_supply_read_temp(struct thermal_zone_device *tzd,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+ int *temp)
|
|
|
|
{
|
|
|
|
struct power_supply *psy;
|
|
|
|
union power_supply_propval val;
|
|
|
|
--- a/drivers/thermal/armada_thermal.c
|
|
|
|
+++ b/drivers/thermal/armada_thermal.c
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -155,7 +155,7 @@ static bool armada_is_valid(struct armad
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int armada_get_temp(struct thermal_zone_device *thermal,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+ int *temp)
|
|
|
|
{
|
|
|
|
struct armada_thermal_priv *priv = thermal->devdata;
|
|
|
|
unsigned long reg;
|
|
|
|
--- a/drivers/thermal/db8500_thermal.c
|
|
|
|
+++ b/drivers/thermal/db8500_thermal.c
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -107,8 +107,7 @@ static int db8500_cdev_unbind(struct the
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Callback to get current temperature */
|
|
|
|
-static int db8500_sys_get_temp(struct thermal_zone_device *thermal,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+static int db8500_sys_get_temp(struct thermal_zone_device *thermal, int *temp)
|
|
|
|
{
|
|
|
|
struct db8500_thermal_zone *pzone = thermal->devdata;
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -180,7 +179,7 @@ static int db8500_sys_get_trip_type(stru
|
2015-11-02 10:18:50 +00:00
|
|
|
|
|
|
|
/* Callback to get trip point temperature */
|
|
|
|
static int db8500_sys_get_trip_temp(struct thermal_zone_device *thermal,
|
|
|
|
- int trip, unsigned long *temp)
|
|
|
|
+ int trip, int *temp)
|
|
|
|
{
|
|
|
|
struct db8500_thermal_zone *pzone = thermal->devdata;
|
|
|
|
struct db8500_thsens_platform_data *ptrips = pzone->trip_tab;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -195,7 +194,7 @@ static int db8500_sys_get_trip_temp(stru
|
2015-11-02 10:18:50 +00:00
|
|
|
|
|
|
|
/* Callback to get critical trip point temperature */
|
|
|
|
static int db8500_sys_get_crit_temp(struct thermal_zone_device *thermal,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+ int *temp)
|
|
|
|
{
|
|
|
|
struct db8500_thermal_zone *pzone = thermal->devdata;
|
|
|
|
struct db8500_thsens_platform_data *ptrips = pzone->trip_tab;
|
|
|
|
--- a/drivers/thermal/dove_thermal.c
|
|
|
|
+++ b/drivers/thermal/dove_thermal.c
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -93,7 +93,7 @@ static int dove_init_sensor(const struct
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int dove_get_temp(struct thermal_zone_device *thermal,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+ int *temp)
|
|
|
|
{
|
|
|
|
unsigned long reg;
|
|
|
|
struct dove_thermal_priv *priv = thermal->devdata;
|
|
|
|
--- a/drivers/thermal/fair_share.c
|
|
|
|
+++ b/drivers/thermal/fair_share.c
|
|
|
|
@@ -34,7 +34,7 @@
|
|
|
|
static int get_trip_level(struct thermal_zone_device *tz)
|
|
|
|
{
|
|
|
|
int count = 0;
|
|
|
|
- unsigned long trip_temp;
|
|
|
|
+ int trip_temp;
|
|
|
|
enum thermal_trip_type trip_type;
|
|
|
|
|
|
|
|
if (tz->trips == 0 || !tz->ops->get_trip_temp)
|
|
|
|
--- a/drivers/thermal/gov_bang_bang.c
|
|
|
|
+++ b/drivers/thermal/gov_bang_bang.c
|
|
|
|
@@ -25,14 +25,13 @@
|
|
|
|
|
|
|
|
static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
|
|
|
|
{
|
|
|
|
- long trip_temp;
|
|
|
|
- unsigned long trip_hyst;
|
|
|
|
+ int trip_temp, trip_hyst;
|
|
|
|
struct thermal_instance *instance;
|
|
|
|
|
|
|
|
tz->ops->get_trip_temp(tz, trip, &trip_temp);
|
|
|
|
tz->ops->get_trip_hyst(tz, trip, &trip_hyst);
|
|
|
|
|
|
|
|
- dev_dbg(&tz->device, "Trip%d[temp=%ld]:temp=%d:hyst=%ld\n",
|
|
|
|
+ dev_dbg(&tz->device, "Trip%d[temp=%d]:temp=%d:hyst=%d\n",
|
|
|
|
trip, trip_temp, tz->temperature,
|
|
|
|
trip_hyst);
|
|
|
|
|
|
|
|
--- a/drivers/thermal/imx_thermal.c
|
|
|
|
+++ b/drivers/thermal/imx_thermal.c
|
|
|
|
@@ -98,10 +98,10 @@ struct imx_thermal_data {
|
|
|
|
enum thermal_device_mode mode;
|
|
|
|
struct regmap *tempmon;
|
|
|
|
u32 c1, c2; /* See formula in imx_get_sensor_data() */
|
|
|
|
- unsigned long temp_passive;
|
|
|
|
- unsigned long temp_critical;
|
|
|
|
- unsigned long alarm_temp;
|
|
|
|
- unsigned long last_temp;
|
|
|
|
+ int temp_passive;
|
|
|
|
+ int temp_critical;
|
|
|
|
+ int alarm_temp;
|
|
|
|
+ int last_temp;
|
|
|
|
bool irq_enabled;
|
|
|
|
int irq;
|
|
|
|
struct clk *thermal_clk;
|
|
|
|
@@ -109,7 +109,7 @@ struct imx_thermal_data {
|
|
|
|
};
|
|
|
|
|
|
|
|
static void imx_set_panic_temp(struct imx_thermal_data *data,
|
|
|
|
- signed long panic_temp)
|
|
|
|
+ int panic_temp)
|
|
|
|
{
|
|
|
|
struct regmap *map = data->tempmon;
|
|
|
|
int critical_value;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -121,7 +121,7 @@ static void imx_set_panic_temp(struct im
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void imx_set_alarm_temp(struct imx_thermal_data *data,
|
|
|
|
- signed long alarm_temp)
|
|
|
|
+ int alarm_temp)
|
|
|
|
{
|
|
|
|
struct regmap *map = data->tempmon;
|
|
|
|
int alarm_value;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -133,7 +133,7 @@ static void imx_set_alarm_temp(struct im
|
2015-11-02 10:18:50 +00:00
|
|
|
TEMPSENSE0_ALARM_VALUE_SHIFT);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int imx_get_temp(struct thermal_zone_device *tz, unsigned long *temp)
|
|
|
|
+static int imx_get_temp(struct thermal_zone_device *tz, int *temp)
|
|
|
|
{
|
|
|
|
struct imx_thermal_data *data = tz->devdata;
|
|
|
|
struct regmap *map = data->tempmon;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -189,13 +189,13 @@ static int imx_get_temp(struct thermal_z
|
2015-11-02 10:18:50 +00:00
|
|
|
if (data->alarm_temp == data->temp_critical &&
|
|
|
|
*temp < data->temp_passive) {
|
|
|
|
imx_set_alarm_temp(data, data->temp_passive);
|
|
|
|
- dev_dbg(&tz->device, "thermal alarm off: T < %lu\n",
|
|
|
|
+ dev_dbg(&tz->device, "thermal alarm off: T < %d\n",
|
|
|
|
data->alarm_temp / 1000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (*temp != data->last_temp) {
|
|
|
|
- dev_dbg(&tz->device, "millicelsius: %ld\n", *temp);
|
|
|
|
+ dev_dbg(&tz->device, "millicelsius: %d\n", *temp);
|
|
|
|
data->last_temp = *temp;
|
|
|
|
}
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -262,8 +262,7 @@ static int imx_get_trip_type(struct ther
|
2015-11-02 10:18:50 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int imx_get_crit_temp(struct thermal_zone_device *tz,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+static int imx_get_crit_temp(struct thermal_zone_device *tz, int *temp)
|
|
|
|
{
|
|
|
|
struct imx_thermal_data *data = tz->devdata;
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -272,7 +271,7 @@ static int imx_get_crit_temp(struct ther
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int imx_get_trip_temp(struct thermal_zone_device *tz, int trip,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+ int *temp)
|
|
|
|
{
|
|
|
|
struct imx_thermal_data *data = tz->devdata;
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -282,7 +281,7 @@ static int imx_get_trip_temp(struct ther
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int imx_set_trip_temp(struct thermal_zone_device *tz, int trip,
|
|
|
|
- unsigned long temp)
|
|
|
|
+ int temp)
|
|
|
|
{
|
|
|
|
struct imx_thermal_data *data = tz->devdata;
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -433,7 +432,7 @@ static irqreturn_t imx_thermal_alarm_irq
|
2015-11-02 10:18:50 +00:00
|
|
|
{
|
|
|
|
struct imx_thermal_data *data = dev;
|
|
|
|
|
|
|
|
- dev_dbg(&data->tz->device, "THERMAL ALARM: T > %lu\n",
|
|
|
|
+ dev_dbg(&data->tz->device, "THERMAL ALARM: T > %d\n",
|
|
|
|
data->alarm_temp / 1000);
|
|
|
|
|
|
|
|
thermal_zone_device_update(data->tz);
|
|
|
|
--- a/drivers/thermal/int340x_thermal/int340x_thermal_zone.c
|
|
|
|
+++ b/drivers/thermal/int340x_thermal/int340x_thermal_zone.c
|
|
|
|
@@ -20,7 +20,7 @@
|
|
|
|
#include "int340x_thermal_zone.h"
|
|
|
|
|
|
|
|
static int int340x_thermal_get_zone_temp(struct thermal_zone_device *zone,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+ int *temp)
|
|
|
|
{
|
|
|
|
struct int34x_thermal_zone *d = zone->devdata;
|
|
|
|
unsigned long long tmp;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -49,7 +49,7 @@ static int int340x_thermal_get_zone_temp
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int int340x_thermal_get_trip_temp(struct thermal_zone_device *zone,
|
|
|
|
- int trip, unsigned long *temp)
|
|
|
|
+ int trip, int *temp)
|
|
|
|
{
|
|
|
|
struct int34x_thermal_zone *d = zone->devdata;
|
|
|
|
int i;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -114,7 +114,7 @@ static int int340x_thermal_get_trip_type
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int int340x_thermal_set_trip_temp(struct thermal_zone_device *zone,
|
|
|
|
- int trip, unsigned long temp)
|
|
|
|
+ int trip, int temp)
|
|
|
|
{
|
|
|
|
struct int34x_thermal_zone *d = zone->devdata;
|
|
|
|
acpi_status status;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -136,7 +136,7 @@ static int int340x_thermal_set_trip_temp
|
2015-11-02 10:18:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
static int int340x_thermal_get_trip_hyst(struct thermal_zone_device *zone,
|
|
|
|
- int trip, unsigned long *temp)
|
|
|
|
+ int trip, int *temp)
|
|
|
|
{
|
|
|
|
struct int34x_thermal_zone *d = zone->devdata;
|
|
|
|
acpi_status status;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -163,7 +163,7 @@ static struct thermal_zone_device_ops in
|
2015-11-02 10:18:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static int int340x_thermal_get_trip_config(acpi_handle handle, char *name,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+ int *temp)
|
|
|
|
{
|
|
|
|
unsigned long long r;
|
|
|
|
acpi_status status;
|
|
|
|
--- a/drivers/thermal/int340x_thermal/int340x_thermal_zone.h
|
|
|
|
+++ b/drivers/thermal/int340x_thermal/int340x_thermal_zone.h
|
|
|
|
@@ -21,7 +21,7 @@
|
|
|
|
#define INT340X_THERMAL_MAX_ACT_TRIP_COUNT 10
|
|
|
|
|
|
|
|
struct active_trip {
|
|
|
|
- unsigned long temp;
|
|
|
|
+ int temp;
|
|
|
|
int id;
|
|
|
|
bool valid;
|
|
|
|
};
|
|
|
|
@@ -31,11 +31,11 @@ struct int34x_thermal_zone {
|
|
|
|
struct active_trip act_trips[INT340X_THERMAL_MAX_ACT_TRIP_COUNT];
|
|
|
|
unsigned long *aux_trips;
|
|
|
|
int aux_trip_nr;
|
|
|
|
- unsigned long psv_temp;
|
|
|
|
+ int psv_temp;
|
|
|
|
int psv_trip_id;
|
|
|
|
- unsigned long crt_temp;
|
|
|
|
+ int crt_temp;
|
|
|
|
int crt_trip_id;
|
|
|
|
- unsigned long hot_temp;
|
|
|
|
+ int hot_temp;
|
|
|
|
int hot_trip_id;
|
|
|
|
struct thermal_zone_device *zone;
|
|
|
|
struct thermal_zone_device_ops *override_ops;
|
|
|
|
--- a/drivers/thermal/intel_soc_dts_thermal.c
|
|
|
|
+++ b/drivers/thermal/intel_soc_dts_thermal.c
|
|
|
|
@@ -106,7 +106,7 @@ err_ret:
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sys_get_trip_temp(struct thermal_zone_device *tzd,
|
|
|
|
- int trip, unsigned long *temp)
|
|
|
|
+ int trip, int *temp)
|
|
|
|
{
|
|
|
|
int status;
|
|
|
|
u32 out;
|
|
|
|
@@ -224,7 +224,7 @@ err_restore_ptps:
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sys_set_trip_temp(struct thermal_zone_device *tzd, int trip,
|
|
|
|
- unsigned long temp)
|
|
|
|
+ int temp)
|
|
|
|
{
|
|
|
|
struct soc_sensor_entry *aux_entry = tzd->devdata;
|
|
|
|
int status;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -250,8 +250,7 @@ static int sys_get_trip_type(struct ther
|
2015-11-02 10:18:50 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int sys_get_curr_temp(struct thermal_zone_device *tzd,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+static int sys_get_curr_temp(struct thermal_zone_device *tzd, int *temp)
|
|
|
|
{
|
|
|
|
int status;
|
|
|
|
u32 out;
|
|
|
|
--- a/drivers/thermal/of-thermal.c
|
|
|
|
+++ b/drivers/thermal/of-thermal.c
|
|
|
|
@@ -87,7 +87,7 @@ struct __thermal_zone {
|
|
|
|
/*** DT thermal zone device callbacks ***/
|
|
|
|
|
|
|
|
static int of_thermal_get_temp(struct thermal_zone_device *tz,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+ int *temp)
|
|
|
|
{
|
|
|
|
struct __thermal_zone *data = tz->devdata;
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -173,7 +173,7 @@ EXPORT_SYMBOL_GPL(of_thermal_get_trip_po
|
2015-11-02 10:18:50 +00:00
|
|
|
* Return: zero on success, error code otherwise
|
|
|
|
*/
|
|
|
|
static int of_thermal_set_emul_temp(struct thermal_zone_device *tz,
|
|
|
|
- unsigned long temp)
|
|
|
|
+ int temp)
|
|
|
|
{
|
|
|
|
struct __thermal_zone *data = tz->devdata;
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -306,7 +306,7 @@ static int of_thermal_get_trip_type(stru
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int of_thermal_get_trip_temp(struct thermal_zone_device *tz, int trip,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+ int *temp)
|
|
|
|
{
|
|
|
|
struct __thermal_zone *data = tz->devdata;
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -319,7 +319,7 @@ static int of_thermal_get_trip_temp(stru
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int of_thermal_set_trip_temp(struct thermal_zone_device *tz, int trip,
|
|
|
|
- unsigned long temp)
|
|
|
|
+ int temp)
|
|
|
|
{
|
|
|
|
struct __thermal_zone *data = tz->devdata;
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -333,7 +333,7 @@ static int of_thermal_set_trip_temp(stru
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int of_thermal_get_trip_hyst(struct thermal_zone_device *tz, int trip,
|
|
|
|
- unsigned long *hyst)
|
|
|
|
+ int *hyst)
|
|
|
|
{
|
|
|
|
struct __thermal_zone *data = tz->devdata;
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -346,7 +346,7 @@ static int of_thermal_get_trip_hyst(stru
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int of_thermal_set_trip_hyst(struct thermal_zone_device *tz, int trip,
|
|
|
|
- unsigned long hyst)
|
|
|
|
+ int hyst)
|
|
|
|
{
|
|
|
|
struct __thermal_zone *data = tz->devdata;
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -360,7 +360,7 @@ static int of_thermal_set_trip_hyst(stru
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int of_thermal_get_crit_temp(struct thermal_zone_device *tz,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+ int *temp)
|
|
|
|
{
|
|
|
|
struct __thermal_zone *data = tz->devdata;
|
|
|
|
int i;
|
|
|
|
--- a/drivers/thermal/rcar_thermal.c
|
|
|
|
+++ b/drivers/thermal/rcar_thermal.c
|
|
|
|
@@ -200,8 +200,7 @@ err_out_unlock:
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int rcar_thermal_get_temp(struct thermal_zone_device *zone,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+static int rcar_thermal_get_temp(struct thermal_zone_device *zone, int *temp)
|
|
|
|
{
|
|
|
|
struct rcar_thermal_priv *priv = rcar_zone_to_priv(zone);
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -235,7 +234,7 @@ static int rcar_thermal_get_trip_type(st
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int rcar_thermal_get_trip_temp(struct thermal_zone_device *zone,
|
|
|
|
- int trip, unsigned long *temp)
|
|
|
|
+ int trip, int *temp)
|
|
|
|
{
|
|
|
|
struct rcar_thermal_priv *priv = rcar_zone_to_priv(zone);
|
|
|
|
struct device *dev = rcar_priv_to_dev(priv);
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -299,7 +298,7 @@ static void _rcar_thermal_irq_ctrl(struc
|
2015-11-02 10:18:50 +00:00
|
|
|
static void rcar_thermal_work(struct work_struct *work)
|
|
|
|
{
|
|
|
|
struct rcar_thermal_priv *priv;
|
|
|
|
- unsigned long cctemp, nctemp;
|
|
|
|
+ int cctemp, nctemp;
|
|
|
|
|
|
|
|
priv = container_of(work, struct rcar_thermal_priv, work.work);
|
|
|
|
|
|
|
|
--- a/drivers/thermal/rockchip_thermal.c
|
|
|
|
+++ b/drivers/thermal/rockchip_thermal.c
|
|
|
|
@@ -64,7 +64,7 @@ struct rockchip_tsadc_chip {
|
|
|
|
void (*control)(void __iomem *reg, bool on);
|
|
|
|
|
|
|
|
/* Per-sensor methods */
|
|
|
|
- int (*get_temp)(int chn, void __iomem *reg, long *temp);
|
|
|
|
+ int (*get_temp)(int chn, void __iomem *reg, int *temp);
|
|
|
|
void (*set_tshut_temp)(int chn, void __iomem *reg, long temp);
|
|
|
|
void (*set_tshut_mode)(int chn, void __iomem *reg, enum tshut_mode m);
|
|
|
|
};
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -191,7 +191,7 @@ static u32 rk_tsadcv2_temp_to_code(long
|
2015-11-02 10:18:50 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static long rk_tsadcv2_code_to_temp(u32 code)
|
|
|
|
+static int rk_tsadcv2_code_to_temp(u32 code)
|
|
|
|
{
|
|
|
|
unsigned int low = 0;
|
|
|
|
unsigned int high = ARRAY_SIZE(v2_code_table) - 1;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -277,7 +277,7 @@ static void rk_tsadcv2_control(void __io
|
2015-11-02 10:18:50 +00:00
|
|
|
writel_relaxed(val, regs + TSADCV2_AUTO_CON);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int rk_tsadcv2_get_temp(int chn, void __iomem *regs, long *temp)
|
|
|
|
+static int rk_tsadcv2_get_temp(int chn, void __iomem *regs, int *temp)
|
|
|
|
{
|
|
|
|
u32 val;
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -366,7 +366,7 @@ static irqreturn_t rockchip_thermal_alar
|
2015-11-02 10:18:50 +00:00
|
|
|
return IRQ_HANDLED;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int rockchip_thermal_get_temp(void *_sensor, long *out_temp)
|
|
|
|
+static int rockchip_thermal_get_temp(void *_sensor, int *out_temp)
|
|
|
|
{
|
|
|
|
struct rockchip_thermal_sensor *sensor = _sensor;
|
|
|
|
struct rockchip_thermal_data *thermal = sensor->thermal;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -374,7 +374,7 @@ static int rockchip_thermal_get_temp(voi
|
2015-11-02 10:18:50 +00:00
|
|
|
int retval;
|
|
|
|
|
|
|
|
retval = tsadc->get_temp(sensor->id, thermal->regs, out_temp);
|
|
|
|
- dev_dbg(&thermal->pdev->dev, "sensor %d - temp: %ld, retval: %d\n",
|
|
|
|
+ dev_dbg(&thermal->pdev->dev, "sensor %d - temp: %d, retval: %d\n",
|
|
|
|
sensor->id, *out_temp, retval);
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
--- a/drivers/thermal/samsung/exynos_tmu.c
|
|
|
|
+++ b/drivers/thermal/samsung/exynos_tmu.c
|
|
|
|
@@ -181,8 +181,7 @@ struct exynos_tmu_data {
|
|
|
|
int (*tmu_initialize)(struct platform_device *pdev);
|
|
|
|
void (*tmu_control)(struct platform_device *pdev, bool on);
|
|
|
|
int (*tmu_read)(struct exynos_tmu_data *data);
|
|
|
|
- void (*tmu_set_emulation)(struct exynos_tmu_data *data,
|
|
|
|
- unsigned long temp);
|
|
|
|
+ void (*tmu_set_emulation)(struct exynos_tmu_data *data, int temp);
|
|
|
|
void (*tmu_clear_irqs)(struct exynos_tmu_data *data);
|
|
|
|
};
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -190,7 +189,7 @@ static void exynos_report_trigger(struct
|
2015-11-02 10:18:50 +00:00
|
|
|
{
|
|
|
|
char data[10], *envp[] = { data, NULL };
|
|
|
|
struct thermal_zone_device *tz = p->tzd;
|
|
|
|
- unsigned long temp;
|
|
|
|
+ int temp;
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
if (!tz) {
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -489,7 +488,7 @@ static int exynos5440_tmu_initialize(str
|
2015-11-02 10:18:50 +00:00
|
|
|
struct exynos_tmu_data *data = platform_get_drvdata(pdev);
|
|
|
|
unsigned int trim_info = 0, con, rising_threshold;
|
|
|
|
int ret = 0, threshold_code;
|
|
|
|
- unsigned long crit_temp = 0;
|
|
|
|
+ int crit_temp = 0;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* For exynos5440 soc triminfo value is swapped between TMU0 and
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -542,7 +541,7 @@ static int exynos7_tmu_initialize(struct
|
2015-11-02 10:18:50 +00:00
|
|
|
unsigned int status, trim_info;
|
|
|
|
unsigned int rising_threshold = 0, falling_threshold = 0;
|
|
|
|
int ret = 0, threshold_code, i;
|
|
|
|
- unsigned long temp, temp_hist;
|
|
|
|
+ int temp, temp_hist;
|
|
|
|
unsigned int reg_off, bit_off;
|
|
|
|
|
|
|
|
status = readb(data->base + EXYNOS_TMU_REG_STATUS);
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -713,7 +712,7 @@ static void exynos7_tmu_control(struct p
|
2015-11-02 10:18:50 +00:00
|
|
|
writel(con, data->base + EXYNOS_TMU_REG_CONTROL);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int exynos_get_temp(void *p, long *temp)
|
|
|
|
+static int exynos_get_temp(void *p, int *temp)
|
|
|
|
{
|
|
|
|
struct exynos_tmu_data *data = p;
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -733,7 +732,7 @@ static int exynos_get_temp(void *p, long
|
2015-11-02 10:18:50 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_THERMAL_EMULATION
|
|
|
|
static u32 get_emul_con_reg(struct exynos_tmu_data *data, unsigned int val,
|
|
|
|
- unsigned long temp)
|
|
|
|
+ int temp)
|
|
|
|
{
|
|
|
|
if (temp) {
|
|
|
|
temp /= MCELSIUS;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -763,7 +762,7 @@ static u32 get_emul_con_reg(struct exyno
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void exynos4412_tmu_set_emulation(struct exynos_tmu_data *data,
|
|
|
|
- unsigned long temp)
|
|
|
|
+ int temp)
|
|
|
|
{
|
|
|
|
unsigned int val;
|
|
|
|
u32 emul_con;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -781,7 +780,7 @@ static void exynos4412_tmu_set_emulation
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void exynos5440_tmu_set_emulation(struct exynos_tmu_data *data,
|
|
|
|
- unsigned long temp)
|
|
|
|
+ int temp)
|
|
|
|
{
|
|
|
|
unsigned int val;
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -790,7 +789,7 @@ static void exynos5440_tmu_set_emulation
|
2015-11-02 10:18:50 +00:00
|
|
|
writel(val, data->base + EXYNOS5440_TMU_S0_7_DEBUG);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int exynos_tmu_set_emulation(void *drv_data, unsigned long temp)
|
|
|
|
+static int exynos_tmu_set_emulation(void *drv_data, int temp)
|
|
|
|
{
|
|
|
|
struct exynos_tmu_data *data = drv_data;
|
|
|
|
int ret = -EINVAL;
|
|
|
|
--- a/drivers/thermal/spear_thermal.c
|
|
|
|
+++ b/drivers/thermal/spear_thermal.c
|
|
|
|
@@ -38,7 +38,7 @@ struct spear_thermal_dev {
|
|
|
|
};
|
|
|
|
|
|
|
|
static inline int thermal_get_temp(struct thermal_zone_device *thermal,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+ int *temp)
|
|
|
|
{
|
|
|
|
struct spear_thermal_dev *stdev = thermal->devdata;
|
|
|
|
|
|
|
|
--- a/drivers/thermal/st/st_thermal.c
|
|
|
|
+++ b/drivers/thermal/st/st_thermal.c
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -111,8 +111,7 @@ static int st_thermal_calibration(struct
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Callback to get temperature from HW*/
|
|
|
|
-static int st_thermal_get_temp(struct thermal_zone_device *th,
|
|
|
|
- unsigned long *temperature)
|
|
|
|
+static int st_thermal_get_temp(struct thermal_zone_device *th, int *temperature)
|
|
|
|
{
|
|
|
|
struct st_thermal_sensor *sensor = th->devdata;
|
|
|
|
struct device *dev = sensor->dev;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -159,7 +158,7 @@ static int st_thermal_get_trip_type(stru
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int st_thermal_get_trip_temp(struct thermal_zone_device *th,
|
|
|
|
- int trip, unsigned long *temp)
|
|
|
|
+ int trip, int *temp)
|
|
|
|
{
|
|
|
|
struct st_thermal_sensor *sensor = th->devdata;
|
|
|
|
struct device *dev = sensor->dev;
|
|
|
|
--- a/drivers/thermal/step_wise.c
|
|
|
|
+++ b/drivers/thermal/step_wise.c
|
2016-03-18 23:41:21 +00:00
|
|
|
@@ -126,7 +126,7 @@ static void update_passive_instance(stru
|
2015-11-02 10:18:50 +00:00
|
|
|
|
|
|
|
static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
|
|
|
|
{
|
|
|
|
- long trip_temp;
|
|
|
|
+ int trip_temp;
|
|
|
|
enum thermal_trip_type trip_type;
|
|
|
|
enum thermal_trend trend;
|
|
|
|
struct thermal_instance *instance;
|
2016-03-18 23:41:21 +00:00
|
|
|
@@ -148,7 +148,7 @@ static void thermal_zone_trip_update(str
|
2015-11-02 10:18:50 +00:00
|
|
|
trace_thermal_zone_trip(tz, trip, trip_type);
|
|
|
|
}
|
|
|
|
|
|
|
|
- dev_dbg(&tz->device, "Trip%d[type=%d,temp=%ld]:trend=%d,throttle=%d\n",
|
|
|
|
+ dev_dbg(&tz->device, "Trip%d[type=%d,temp=%d]:trend=%d,throttle=%d\n",
|
|
|
|
trip, trip_type, trip_temp, trend, throttle);
|
|
|
|
|
|
|
|
mutex_lock(&tz->lock);
|
|
|
|
--- a/drivers/thermal/tegra_soctherm.c
|
|
|
|
+++ b/drivers/thermal/tegra_soctherm.c
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -293,7 +293,7 @@ static int enable_tsensor(struct tegra_s
|
2015-11-02 10:18:50 +00:00
|
|
|
* H denotes an addition of 0.5 Celsius and N denotes negation
|
|
|
|
* of the final value.
|
|
|
|
*/
|
|
|
|
-static long translate_temp(u16 val)
|
|
|
|
+static int translate_temp(u16 val)
|
|
|
|
{
|
|
|
|
long t;
|
|
|
|
|
|
|
|
@@ -306,7 +306,7 @@ static long translate_temp(u16 val)
|
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int tegra_thermctl_get_temp(void *data, long *out_temp)
|
|
|
|
+static int tegra_thermctl_get_temp(void *data, int *out_temp)
|
|
|
|
{
|
|
|
|
struct tegra_thermctl_zone *zone = data;
|
|
|
|
u32 val;
|
|
|
|
--- a/drivers/thermal/thermal_core.c
|
|
|
|
+++ b/drivers/thermal/thermal_core.c
|
2016-03-18 23:41:21 +00:00
|
|
|
@@ -366,7 +366,7 @@ static void handle_non_critical_trips(st
|
2015-11-02 10:18:50 +00:00
|
|
|
static void handle_critical_trips(struct thermal_zone_device *tz,
|
|
|
|
int trip, enum thermal_trip_type trip_type)
|
|
|
|
{
|
|
|
|
- long trip_temp;
|
|
|
|
+ int trip_temp;
|
|
|
|
|
|
|
|
tz->ops->get_trip_temp(tz, trip, &trip_temp);
|
|
|
|
|
2016-03-18 23:41:21 +00:00
|
|
|
@@ -414,12 +414,12 @@ static void handle_thermal_trip(struct t
|
2015-11-02 10:18:50 +00:00
|
|
|
*
|
|
|
|
* Return: On success returns 0, an error code otherwise
|
|
|
|
*/
|
|
|
|
-int thermal_zone_get_temp(struct thermal_zone_device *tz, unsigned long *temp)
|
|
|
|
+int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp)
|
|
|
|
{
|
|
|
|
int ret = -EINVAL;
|
|
|
|
#ifdef CONFIG_THERMAL_EMULATION
|
|
|
|
int count;
|
|
|
|
- unsigned long crit_temp = -1UL;
|
|
|
|
+ int crit_temp = INT_MAX;
|
|
|
|
enum thermal_trip_type type;
|
|
|
|
#endif
|
|
|
|
|
2016-03-18 23:41:21 +00:00
|
|
|
@@ -456,8 +456,7 @@ EXPORT_SYMBOL_GPL(thermal_zone_get_temp)
|
2015-11-02 10:18:50 +00:00
|
|
|
|
|
|
|
static void update_temperature(struct thermal_zone_device *tz)
|
|
|
|
{
|
|
|
|
- long temp;
|
|
|
|
- int ret;
|
|
|
|
+ int temp, ret;
|
|
|
|
|
|
|
|
ret = thermal_zone_get_temp(tz, &temp);
|
|
|
|
if (ret) {
|
2016-03-18 23:41:21 +00:00
|
|
|
@@ -534,15 +533,14 @@ static ssize_t
|
2015-11-02 10:18:50 +00:00
|
|
|
temp_show(struct device *dev, struct device_attribute *attr, char *buf)
|
|
|
|
{
|
|
|
|
struct thermal_zone_device *tz = to_thermal_zone(dev);
|
|
|
|
- long temperature;
|
|
|
|
- int ret;
|
|
|
|
+ int temperature, ret;
|
|
|
|
|
|
|
|
ret = thermal_zone_get_temp(tz, &temperature);
|
|
|
|
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
- return sprintf(buf, "%ld\n", temperature);
|
|
|
|
+ return sprintf(buf, "%d\n", temperature);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ssize_t
|
2016-03-18 23:41:21 +00:00
|
|
|
@@ -646,7 +644,7 @@ trip_point_temp_show(struct device *dev,
|
2015-11-02 10:18:50 +00:00
|
|
|
{
|
|
|
|
struct thermal_zone_device *tz = to_thermal_zone(dev);
|
|
|
|
int trip, ret;
|
|
|
|
- long temperature;
|
|
|
|
+ int temperature;
|
|
|
|
|
|
|
|
if (!tz->ops->get_trip_temp)
|
|
|
|
return -EPERM;
|
2016-03-18 23:41:21 +00:00
|
|
|
@@ -659,7 +657,7 @@ trip_point_temp_show(struct device *dev,
|
2015-11-02 10:18:50 +00:00
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
- return sprintf(buf, "%ld\n", temperature);
|
|
|
|
+ return sprintf(buf, "%d\n", temperature);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ssize_t
|
2016-03-18 23:41:21 +00:00
|
|
|
@@ -668,7 +666,7 @@ trip_point_hyst_store(struct device *dev
|
2015-11-02 10:18:50 +00:00
|
|
|
{
|
|
|
|
struct thermal_zone_device *tz = to_thermal_zone(dev);
|
|
|
|
int trip, ret;
|
|
|
|
- unsigned long temperature;
|
|
|
|
+ int temperature;
|
|
|
|
|
|
|
|
if (!tz->ops->set_trip_hyst)
|
|
|
|
return -EPERM;
|
2016-03-18 23:41:21 +00:00
|
|
|
@@ -676,7 +674,7 @@ trip_point_hyst_store(struct device *dev
|
2015-11-02 10:18:50 +00:00
|
|
|
if (!sscanf(attr->attr.name, "trip_point_%d_hyst", &trip))
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
- if (kstrtoul(buf, 10, &temperature))
|
|
|
|
+ if (kstrtoint(buf, 10, &temperature))
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
/*
|
2016-03-18 23:41:21 +00:00
|
|
|
@@ -695,7 +693,7 @@ trip_point_hyst_show(struct device *dev,
|
2015-11-02 10:18:50 +00:00
|
|
|
{
|
|
|
|
struct thermal_zone_device *tz = to_thermal_zone(dev);
|
|
|
|
int trip, ret;
|
|
|
|
- unsigned long temperature;
|
|
|
|
+ int temperature;
|
|
|
|
|
|
|
|
if (!tz->ops->get_trip_hyst)
|
|
|
|
return -EPERM;
|
2016-03-18 23:41:21 +00:00
|
|
|
@@ -705,7 +703,7 @@ trip_point_hyst_show(struct device *dev,
|
2015-11-02 10:18:50 +00:00
|
|
|
|
|
|
|
ret = tz->ops->get_trip_hyst(tz, trip, &temperature);
|
|
|
|
|
|
|
|
- return ret ? ret : sprintf(buf, "%ld\n", temperature);
|
|
|
|
+ return ret ? ret : sprintf(buf, "%d\n", temperature);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ssize_t
|
|
|
|
--- a/drivers/thermal/thermal_hwmon.c
|
|
|
|
+++ b/drivers/thermal/thermal_hwmon.c
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -69,7 +69,7 @@ static DEVICE_ATTR(name, 0444, name_show
|
2015-11-02 10:18:50 +00:00
|
|
|
static ssize_t
|
|
|
|
temp_input_show(struct device *dev, struct device_attribute *attr, char *buf)
|
|
|
|
{
|
|
|
|
- long temperature;
|
|
|
|
+ int temperature;
|
|
|
|
int ret;
|
|
|
|
struct thermal_hwmon_attr *hwmon_attr
|
|
|
|
= container_of(attr, struct thermal_hwmon_attr, attr);
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -83,7 +83,7 @@ temp_input_show(struct device *dev, stru
|
2015-11-02 10:18:50 +00:00
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
- return sprintf(buf, "%ld\n", temperature);
|
|
|
|
+ return sprintf(buf, "%d\n", temperature);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ssize_t
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -95,14 +95,14 @@ temp_crit_show(struct device *dev, struc
|
2015-11-02 10:18:50 +00:00
|
|
|
= container_of(hwmon_attr, struct thermal_hwmon_temp,
|
|
|
|
temp_crit);
|
|
|
|
struct thermal_zone_device *tz = temp->tz;
|
|
|
|
- long temperature;
|
|
|
|
+ int temperature;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
ret = tz->ops->get_trip_temp(tz, 0, &temperature);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
- return sprintf(buf, "%ld\n", temperature);
|
|
|
|
+ return sprintf(buf, "%d\n", temperature);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -142,7 +142,7 @@ thermal_hwmon_lookup_temp(const struct t
|
2015-11-02 10:18:50 +00:00
|
|
|
|
|
|
|
static bool thermal_zone_crit_temp_valid(struct thermal_zone_device *tz)
|
|
|
|
{
|
|
|
|
- unsigned long temp;
|
|
|
|
+ int temp;
|
|
|
|
return tz->ops->get_crit_temp && !tz->ops->get_crit_temp(tz, &temp);
|
|
|
|
}
|
|
|
|
|
|
|
|
--- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
|
|
|
|
+++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -76,14 +76,14 @@ static inline int ti_thermal_hotspot_tem
|
2015-11-02 10:18:50 +00:00
|
|
|
|
|
|
|
/* thermal zone ops */
|
|
|
|
/* Get temperature callback function for thermal zone*/
|
|
|
|
-static inline int __ti_thermal_get_temp(void *devdata, long *temp)
|
|
|
|
+static inline int __ti_thermal_get_temp(void *devdata, int *temp)
|
|
|
|
{
|
|
|
|
struct thermal_zone_device *pcb_tz = NULL;
|
|
|
|
struct ti_thermal_data *data = devdata;
|
|
|
|
struct ti_bandgap *bgp;
|
|
|
|
const struct ti_temp_sensor *s;
|
|
|
|
int ret, tmp, slope, constant;
|
|
|
|
- unsigned long pcb_temp;
|
|
|
|
+ int pcb_temp;
|
|
|
|
|
|
|
|
if (!data)
|
|
|
|
return 0;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -119,7 +119,7 @@ static inline int __ti_thermal_get_temp(
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline int ti_thermal_get_temp(struct thermal_zone_device *thermal,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+ int *temp)
|
|
|
|
{
|
|
|
|
struct ti_thermal_data *data = thermal->devdata;
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -228,7 +228,7 @@ static int ti_thermal_get_trip_type(stru
|
2015-11-02 10:18:50 +00:00
|
|
|
|
|
|
|
/* Get trip temperature callback functions for thermal zone */
|
|
|
|
static int ti_thermal_get_trip_temp(struct thermal_zone_device *thermal,
|
|
|
|
- int trip, unsigned long *temp)
|
|
|
|
+ int trip, int *temp)
|
|
|
|
{
|
|
|
|
if (!ti_thermal_is_valid_trip(trip))
|
|
|
|
return -EINVAL;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -279,7 +279,7 @@ static int ti_thermal_get_trend(struct t
|
2015-11-02 10:18:50 +00:00
|
|
|
|
|
|
|
/* Get critical temperature callback functions for thermal zone */
|
|
|
|
static int ti_thermal_get_crit_temp(struct thermal_zone_device *thermal,
|
|
|
|
- unsigned long *temp)
|
|
|
|
+ int *temp)
|
|
|
|
{
|
|
|
|
/* shutdown zone */
|
|
|
|
return ti_thermal_get_trip_temp(thermal, OMAP_TRIP_NUMBER - 1, temp);
|
|
|
|
--- a/drivers/thermal/x86_pkg_temp_thermal.c
|
|
|
|
+++ b/drivers/thermal/x86_pkg_temp_thermal.c
|
|
|
|
@@ -164,7 +164,7 @@ err_ret:
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
|
|
|
-static int sys_get_curr_temp(struct thermal_zone_device *tzd, unsigned long *temp)
|
|
|
|
+static int sys_get_curr_temp(struct thermal_zone_device *tzd, int *temp)
|
|
|
|
{
|
|
|
|
u32 eax, edx;
|
|
|
|
struct phy_dev_entry *phy_dev_entry;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -175,7 +175,7 @@ static int sys_get_curr_temp(struct ther
|
2015-11-02 10:18:50 +00:00
|
|
|
if (eax & 0x80000000) {
|
|
|
|
*temp = phy_dev_entry->tj_max -
|
|
|
|
((eax >> 16) & 0x7f) * 1000;
|
|
|
|
- pr_debug("sys_get_curr_temp %ld\n", *temp);
|
|
|
|
+ pr_debug("sys_get_curr_temp %d\n", *temp);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -183,7 +183,7 @@ static int sys_get_curr_temp(struct ther
|
2015-11-02 10:18:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int sys_get_trip_temp(struct thermal_zone_device *tzd,
|
|
|
|
- int trip, unsigned long *temp)
|
|
|
|
+ int trip, int *temp)
|
|
|
|
{
|
|
|
|
u32 eax, edx;
|
|
|
|
struct phy_dev_entry *phy_dev_entry;
|
2015-12-02 21:52:41 +00:00
|
|
|
@@ -214,13 +214,13 @@ static int sys_get_trip_temp(struct ther
|
2015-11-02 10:18:50 +00:00
|
|
|
*temp = phy_dev_entry->tj_max - thres_reg_value * 1000;
|
|
|
|
else
|
|
|
|
*temp = 0;
|
|
|
|
- pr_debug("sys_get_trip_temp %ld\n", *temp);
|
|
|
|
+ pr_debug("sys_get_trip_temp %d\n", *temp);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int sys_set_trip_temp(struct thermal_zone_device *tzd, int trip,
|
|
|
|
- unsigned long temp)
|
|
|
|
+ int temp)
|
|
|
|
{
|
|
|
|
u32 l, h;
|
|
|
|
struct phy_dev_entry *phy_dev_entry;
|
|
|
|
--- a/include/linux/thermal.h
|
|
|
|
+++ b/include/linux/thermal.h
|
2016-03-18 23:41:21 +00:00
|
|
|
@@ -89,23 +89,19 @@ struct thermal_zone_device_ops {
|
2015-11-02 10:18:50 +00:00
|
|
|
struct thermal_cooling_device *);
|
|
|
|
int (*unbind) (struct thermal_zone_device *,
|
|
|
|
struct thermal_cooling_device *);
|
|
|
|
- int (*get_temp) (struct thermal_zone_device *, unsigned long *);
|
|
|
|
+ int (*get_temp) (struct thermal_zone_device *, int *);
|
|
|
|
int (*get_mode) (struct thermal_zone_device *,
|
|
|
|
enum thermal_device_mode *);
|
|
|
|
int (*set_mode) (struct thermal_zone_device *,
|
|
|
|
enum thermal_device_mode);
|
|
|
|
int (*get_trip_type) (struct thermal_zone_device *, int,
|
|
|
|
enum thermal_trip_type *);
|
|
|
|
- int (*get_trip_temp) (struct thermal_zone_device *, int,
|
|
|
|
- unsigned long *);
|
|
|
|
- int (*set_trip_temp) (struct thermal_zone_device *, int,
|
|
|
|
- unsigned long);
|
|
|
|
- int (*get_trip_hyst) (struct thermal_zone_device *, int,
|
|
|
|
- unsigned long *);
|
|
|
|
- int (*set_trip_hyst) (struct thermal_zone_device *, int,
|
|
|
|
- unsigned long);
|
|
|
|
- int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *);
|
|
|
|
- int (*set_emul_temp) (struct thermal_zone_device *, unsigned long);
|
|
|
|
+ int (*get_trip_temp) (struct thermal_zone_device *, int, int *);
|
|
|
|
+ int (*set_trip_temp) (struct thermal_zone_device *, int, int);
|
|
|
|
+ int (*get_trip_hyst) (struct thermal_zone_device *, int, int *);
|
|
|
|
+ int (*set_trip_hyst) (struct thermal_zone_device *, int, int);
|
|
|
|
+ int (*get_crit_temp) (struct thermal_zone_device *, int *);
|
|
|
|
+ int (*set_emul_temp) (struct thermal_zone_device *, int);
|
|
|
|
int (*get_trend) (struct thermal_zone_device *, int,
|
|
|
|
enum thermal_trend *);
|
|
|
|
int (*notify) (struct thermal_zone_device *, int,
|
2016-03-18 23:41:21 +00:00
|
|
|
@@ -277,9 +273,9 @@ struct thermal_genl_event {
|
2015-11-02 10:18:50 +00:00
|
|
|
* temperature.
|
|
|
|
*/
|
|
|
|
struct thermal_zone_of_device_ops {
|
|
|
|
- int (*get_temp)(void *, long *);
|
|
|
|
+ int (*get_temp)(void *, int *);
|
|
|
|
int (*get_trend)(void *, long *);
|
|
|
|
- int (*set_emul_temp)(void *, unsigned long);
|
|
|
|
+ int (*set_emul_temp)(void *, int);
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2016-03-18 23:41:21 +00:00
|
|
|
@@ -340,7 +336,7 @@ thermal_of_cooling_device_register(struc
|
2015-11-02 10:18:50 +00:00
|
|
|
const struct thermal_cooling_device_ops *);
|
|
|
|
void thermal_cooling_device_unregister(struct thermal_cooling_device *);
|
|
|
|
struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name);
|
|
|
|
-int thermal_zone_get_temp(struct thermal_zone_device *tz, unsigned long *temp);
|
|
|
|
+int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp);
|
|
|
|
|
|
|
|
int get_tz_trend(struct thermal_zone_device *, int);
|
|
|
|
struct thermal_instance *get_thermal_instance(struct thermal_zone_device *,
|
2016-03-18 23:41:21 +00:00
|
|
|
@@ -383,7 +379,7 @@ static inline struct thermal_zone_device
|
2015-11-02 10:18:50 +00:00
|
|
|
const char *name)
|
|
|
|
{ return ERR_PTR(-ENODEV); }
|
|
|
|
static inline int thermal_zone_get_temp(
|
|
|
|
- struct thermal_zone_device *tz, unsigned long *temp)
|
|
|
|
+ struct thermal_zone_device *tz, int *temp)
|
|
|
|
{ return -ENODEV; }
|
|
|
|
static inline int get_tz_trend(struct thermal_zone_device *tz, int trip)
|
|
|
|
{ return -ENODEV; }
|