Skip to content

Commit 5a924a0

Browse files
committed
Merge branches 'thermal-core' and 'thermal-intel' of .git into next
3 parents 64291f7 + 934c93b + d0a1262 commit 5a924a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+509
-197
lines changed

Documentation/thermal/sysfs-api.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ Thermal zone device sys I/F, created once it's registered:
180180
|---temp: Current temperature
181181
|---mode: Working mode of the thermal zone
182182
|---policy: Thermal governor used for this zone
183+
|---available_policies: Available thermal governors for this zone
183184
|---trip_point_[0-*]_temp: Trip point temperature
184185
|---trip_point_[0-*]_type: Trip point type
185186
|---trip_point_[0-*]_hyst: Hysteresis value for this trip point
@@ -256,6 +257,10 @@ policy
256257
One of the various thermal governors used for a particular zone.
257258
RW, Required
258259

260+
available_policies
261+
Available thermal governors which can be used for a particular zone.
262+
RO, Required
263+
259264
trip_point_[0-*]_temp
260265
The temperature above which trip point will be fired.
261266
Unit: millidegree Celsius
@@ -417,6 +422,7 @@ method, the sys I/F structure will be built like this:
417422
|---temp: 37000
418423
|---mode: enabled
419424
|---policy: step_wise
425+
|---available_policies: step_wise fair_share
420426
|---trip_point_0_temp: 100000
421427
|---trip_point_0_type: critical
422428
|---trip_point_1_temp: 80000

drivers/acpi/thermal.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,7 @@ static void acpi_thermal_check(void *data)
529529

530530
/* sys I/F for generic thermal sysfs support */
531531

532-
static int thermal_get_temp(struct thermal_zone_device *thermal,
533-
unsigned long *temp)
532+
static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
534533
{
535534
struct acpi_thermal *tz = thermal->devdata;
536535
int result;
@@ -637,7 +636,7 @@ static int thermal_get_trip_type(struct thermal_zone_device *thermal,
637636
}
638637

639638
static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
640-
int trip, unsigned long *temp)
639+
int trip, int *temp)
641640
{
642641
struct acpi_thermal *tz = thermal->devdata;
643642
int i;
@@ -690,7 +689,8 @@ static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
690689
}
691690

692691
static int thermal_get_crit_temp(struct thermal_zone_device *thermal,
693-
unsigned long *temperature) {
692+
int *temperature)
693+
{
694694
struct acpi_thermal *tz = thermal->devdata;
695695

696696
if (tz->trips.critical.flags.valid) {
@@ -713,8 +713,8 @@ static int thermal_get_trend(struct thermal_zone_device *thermal,
713713
return -EINVAL;
714714

715715
if (type == THERMAL_TRIP_ACTIVE) {
716-
unsigned long trip_temp;
717-
unsigned long temp = DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(
716+
int trip_temp;
717+
int temp = DECI_KELVIN_TO_MILLICELSIUS_WITH_OFFSET(
718718
tz->temperature, tz->kelvin_offset);
719719
if (thermal_get_trip_temp(thermal, trip, &trip_temp))
720720
return -EINVAL;

drivers/hwmon/lm75.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static inline long lm75_reg_to_mc(s16 temp, u8 resolution)
104104

105105
/* sysfs attributes for hwmon */
106106

107-
static int lm75_read_temp(void *dev, long *temp)
107+
static int lm75_read_temp(void *dev, int *temp)
108108
{
109109
struct lm75_data *data = lm75_update_device(dev);
110110

drivers/hwmon/ntc_thermistor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ static int ntc_thermistor_get_ohm(struct ntc_data *data)
477477
return -EINVAL;
478478
}
479479

480-
static int ntc_read_temp(void *dev, long *temp)
480+
static int ntc_read_temp(void *dev, int *temp)
481481
{
482482
struct ntc_data *data = dev_get_drvdata(dev);
483483
int ohm;

drivers/hwmon/tmp102.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static struct tmp102 *tmp102_update_device(struct device *dev)
9898
return tmp102;
9999
}
100100

101-
static int tmp102_read_temp(void *dev, long *temp)
101+
static int tmp102_read_temp(void *dev, int *temp)
102102
{
103103
struct tmp102 *tmp102 = tmp102_update_device(dev);
104104

drivers/input/touchscreen/sun4i-ts.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static void sun4i_ts_close(struct input_dev *dev)
191191
writel(TEMP_IRQ_EN(1), ts->base + TP_INT_FIFOC);
192192
}
193193

194-
static int sun4i_get_temp(const struct sun4i_ts_data *ts, long *temp)
194+
static int sun4i_get_temp(const struct sun4i_ts_data *ts, int *temp)
195195
{
196196
/* No temp_data until the first irq */
197197
if (ts->temp_data == -1)
@@ -202,7 +202,7 @@ static int sun4i_get_temp(const struct sun4i_ts_data *ts, long *temp)
202202
return 0;
203203
}
204204

205-
static int sun4i_get_tz_temp(void *data, long *temp)
205+
static int sun4i_get_tz_temp(void *data, int *temp)
206206
{
207207
return sun4i_get_temp(data, temp);
208208
}
@@ -215,14 +215,14 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *devattr,
215215
char *buf)
216216
{
217217
struct sun4i_ts_data *ts = dev_get_drvdata(dev);
218-
long temp;
218+
int temp;
219219
int error;
220220

221221
error = sun4i_get_temp(ts, &temp);
222222
if (error)
223223
return error;
224224

225-
return sprintf(buf, "%ld\n", temp);
225+
return sprintf(buf, "%d\n", temp);
226226
}
227227

228228
static ssize_t show_temp_label(struct device *dev,

drivers/platform/x86/acerhdf.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,7 @@ static void acerhdf_check_param(struct thermal_zone_device *thermal)
346346
* as late as the polling interval is since we can't do that in the respective
347347
* accessors of the module parameters.
348348
*/
349-
static int acerhdf_get_ec_temp(struct thermal_zone_device *thermal,
350-
unsigned long *t)
349+
static int acerhdf_get_ec_temp(struct thermal_zone_device *thermal, int *t)
351350
{
352351
int temp, err = 0;
353352

@@ -453,7 +452,7 @@ static int acerhdf_get_trip_type(struct thermal_zone_device *thermal, int trip,
453452
}
454453

455454
static int acerhdf_get_trip_hyst(struct thermal_zone_device *thermal, int trip,
456-
unsigned long *temp)
455+
int *temp)
457456
{
458457
if (trip != 0)
459458
return -EINVAL;
@@ -464,7 +463,7 @@ static int acerhdf_get_trip_hyst(struct thermal_zone_device *thermal, int trip,
464463
}
465464

466465
static int acerhdf_get_trip_temp(struct thermal_zone_device *thermal, int trip,
467-
unsigned long *temp)
466+
int *temp)
468467
{
469468
if (trip == 0)
470469
*temp = fanon;
@@ -477,7 +476,7 @@ static int acerhdf_get_trip_temp(struct thermal_zone_device *thermal, int trip,
477476
}
478477

479478
static int acerhdf_get_crit_temp(struct thermal_zone_device *thermal,
480-
unsigned long *temperature)
479+
int *temperature)
481480
{
482481
*temperature = ACERHDF_TEMP_CRIT;
483482
return 0;

drivers/platform/x86/intel_mid_thermal.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static int is_valid_adc(uint16_t adc_val, uint16_t min, uint16_t max)
132132
* to achieve very close approximate temp value with less than
133133
* 0.5C error
134134
*/
135-
static int adc_to_temp(int direct, uint16_t adc_val, unsigned long *tp)
135+
static int adc_to_temp(int direct, uint16_t adc_val, int *tp)
136136
{
137137
int temp;
138138

@@ -174,14 +174,13 @@ static int adc_to_temp(int direct, uint16_t adc_val, unsigned long *tp)
174174
*
175175
* Can sleep
176176
*/
177-
static int mid_read_temp(struct thermal_zone_device *tzd, unsigned long *temp)
177+
static int mid_read_temp(struct thermal_zone_device *tzd, int *temp)
178178
{
179179
struct thermal_device_info *td_info = tzd->devdata;
180180
uint16_t adc_val, addr;
181181
uint8_t data = 0;
182182
int ret;
183-
unsigned long curr_temp;
184-
183+
int curr_temp;
185184

186185
addr = td_info->chnl_addr;
187186

@@ -453,7 +452,7 @@ static SIMPLE_DEV_PM_OPS(mid_thermal_pm,
453452
*
454453
* Can sleep
455454
*/
456-
static int read_curr_temp(struct thermal_zone_device *tzd, unsigned long *temp)
455+
static int read_curr_temp(struct thermal_zone_device *tzd, int *temp)
457456
{
458457
WARN_ON(tzd == NULL);
459458
return mid_read_temp(tzd, temp);

drivers/power/charger-manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ static int cm_get_battery_temperature(struct charger_manager *cm,
619619

620620
#ifdef CONFIG_THERMAL
621621
if (cm->tzd_batt) {
622-
ret = thermal_zone_get_temp(cm->tzd_batt, (unsigned long *)temp);
622+
ret = thermal_zone_get_temp(cm->tzd_batt, temp);
623623
if (!ret)
624624
/* Calibrate temperature unit */
625625
*temp /= 100;

drivers/power/power_supply_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ EXPORT_SYMBOL_GPL(power_supply_unreg_notifier);
557557

558558
#ifdef CONFIG_THERMAL
559559
static int power_supply_read_temp(struct thermal_zone_device *tzd,
560-
unsigned long *temp)
560+
int *temp)
561561
{
562562
struct power_supply *psy;
563563
union power_supply_propval val;

drivers/thermal/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,14 @@ config ACPI_THERMAL_REL
340340
tristate
341341
depends on ACPI
342342

343+
config INTEL_PCH_THERMAL
344+
tristate "Intel PCH Thermal Reporting Driver"
345+
depends on X86 && PCI
346+
help
347+
Enable this to support thermal reporting on certain intel PCHs.
348+
Thermal reporting device will provide temperature reading,
349+
programmable trip points and other information.
350+
343351
menu "Texas Instruments thermal drivers"
344352
source "drivers/thermal/ti-soc-thermal/Kconfig"
345353
endmenu

drivers/thermal/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ obj-$(CONFIG_INTEL_SOC_DTS_THERMAL) += intel_soc_dts_thermal.o
4141
obj-$(CONFIG_INTEL_QUARK_DTS_THERMAL) += intel_quark_dts_thermal.o
4242
obj-$(CONFIG_TI_SOC_THERMAL) += ti-soc-thermal/
4343
obj-$(CONFIG_INT340X_THERMAL) += int340x_thermal/
44+
obj-$(CONFIG_INTEL_PCH_THERMAL) += intel_pch_thermal.o
4445
obj-$(CONFIG_ST_THERMAL) += st/
4546
obj-$(CONFIG_TEGRA_SOCTHERM) += tegra_soctherm.o
4647
obj-$(CONFIG_HISI_THERMAL) += hisi_thermal.o

drivers/thermal/armada_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ static bool armada_is_valid(struct armada_thermal_priv *priv)
155155
}
156156

157157
static int armada_get_temp(struct thermal_zone_device *thermal,
158-
unsigned long *temp)
158+
int *temp)
159159
{
160160
struct armada_thermal_priv *priv = thermal->devdata;
161161
unsigned long reg;

drivers/thermal/db8500_thermal.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ static int db8500_cdev_unbind(struct thermal_zone_device *thermal,
107107
}
108108

109109
/* Callback to get current temperature */
110-
static int db8500_sys_get_temp(struct thermal_zone_device *thermal,
111-
unsigned long *temp)
110+
static int db8500_sys_get_temp(struct thermal_zone_device *thermal, int *temp)
112111
{
113112
struct db8500_thermal_zone *pzone = thermal->devdata;
114113

@@ -180,7 +179,7 @@ static int db8500_sys_get_trip_type(struct thermal_zone_device *thermal,
180179

181180
/* Callback to get trip point temperature */
182181
static int db8500_sys_get_trip_temp(struct thermal_zone_device *thermal,
183-
int trip, unsigned long *temp)
182+
int trip, int *temp)
184183
{
185184
struct db8500_thermal_zone *pzone = thermal->devdata;
186185
struct db8500_thsens_platform_data *ptrips = pzone->trip_tab;
@@ -195,7 +194,7 @@ static int db8500_sys_get_trip_temp(struct thermal_zone_device *thermal,
195194

196195
/* Callback to get critical trip point temperature */
197196
static int db8500_sys_get_crit_temp(struct thermal_zone_device *thermal,
198-
unsigned long *temp)
197+
int *temp)
199198
{
200199
struct db8500_thermal_zone *pzone = thermal->devdata;
201200
struct db8500_thsens_platform_data *ptrips = pzone->trip_tab;

drivers/thermal/dove_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static int dove_init_sensor(const struct dove_thermal_priv *priv)
9393
}
9494

9595
static int dove_get_temp(struct thermal_zone_device *thermal,
96-
unsigned long *temp)
96+
int *temp)
9797
{
9898
unsigned long reg;
9999
struct dove_thermal_priv *priv = thermal->devdata;

drivers/thermal/fair_share.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
static int get_trip_level(struct thermal_zone_device *tz)
3535
{
3636
int count = 0;
37-
unsigned long trip_temp;
37+
int trip_temp;
3838
enum thermal_trip_type trip_type;
3939

4040
if (tz->trips == 0 || !tz->ops->get_trip_temp)

drivers/thermal/gov_bang_bang.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@
2525

2626
static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
2727
{
28-
long trip_temp;
29-
unsigned long trip_hyst;
28+
int trip_temp, trip_hyst;
3029
struct thermal_instance *instance;
3130

3231
tz->ops->get_trip_temp(tz, trip, &trip_temp);
3332
tz->ops->get_trip_hyst(tz, trip, &trip_hyst);
3433

35-
dev_dbg(&tz->device, "Trip%d[temp=%ld]:temp=%d:hyst=%ld\n",
34+
dev_dbg(&tz->device, "Trip%d[temp=%d]:temp=%d:hyst=%d\n",
3635
trip, trip_temp, tz->temperature,
3736
trip_hyst);
3837

drivers/thermal/hisi_thermal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ static void hisi_thermal_disable_sensor(struct hisi_thermal_data *data)
155155
mutex_unlock(&data->thermal_lock);
156156
}
157157

158-
static int hisi_thermal_get_temp(void *_sensor, long *temp)
158+
static int hisi_thermal_get_temp(void *_sensor, int *temp)
159159
{
160160
struct hisi_thermal_sensor *sensor = _sensor;
161161
struct hisi_thermal_data *data = sensor->thermal;
@@ -178,7 +178,7 @@ static int hisi_thermal_get_temp(void *_sensor, long *temp)
178178
data->irq_bind_sensor = sensor_id;
179179
mutex_unlock(&data->thermal_lock);
180180

181-
dev_dbg(&data->pdev->dev, "id=%d, irq=%d, temp=%ld, thres=%d\n",
181+
dev_dbg(&data->pdev->dev, "id=%d, irq=%d, temp=%d, thres=%d\n",
182182
sensor->id, data->irq_enabled, *temp, sensor->thres_temp);
183183
/*
184184
* Bind irq to sensor for two cases:

0 commit comments

Comments
 (0)