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;

0 commit comments

Comments
 (0)