Skip to content

Commit

Permalink
Merge branches 'thermal-core' and 'thermal-intel' of .git into next
Browse files Browse the repository at this point in the history
  • Loading branch information
zhang-rui committed Sep 2, 2015
3 parents 64291f7 + 934c93b + d0a1262 commit 5a924a0
Show file tree
Hide file tree
Showing 44 changed files with 509 additions and 197 deletions.
6 changes: 6 additions & 0 deletions Documentation/thermal/sysfs-api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ Thermal zone device sys I/F, created once it's registered:
|---temp: Current temperature
|---mode: Working mode of the thermal zone
|---policy: Thermal governor used for this zone
|---available_policies: Available thermal governors for this zone
|---trip_point_[0-*]_temp: Trip point temperature
|---trip_point_[0-*]_type: Trip point type
|---trip_point_[0-*]_hyst: Hysteresis value for this trip point
Expand Down Expand Up @@ -256,6 +257,10 @@ policy
One of the various thermal governors used for a particular zone.
RW, Required

available_policies
Available thermal governors which can be used for a particular zone.
RO, Required

trip_point_[0-*]_temp
The temperature above which trip point will be fired.
Unit: millidegree Celsius
Expand Down Expand Up @@ -417,6 +422,7 @@ method, the sys I/F structure will be built like this:
|---temp: 37000
|---mode: enabled
|---policy: step_wise
|---available_policies: step_wise fair_share
|---trip_point_0_temp: 100000
|---trip_point_0_type: critical
|---trip_point_1_temp: 80000
Expand Down
12 changes: 6 additions & 6 deletions drivers/acpi/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,7 @@ static void acpi_thermal_check(void *data)

/* 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;
Expand Down Expand Up @@ -637,7 +636,7 @@ static int thermal_get_trip_type(struct thermal_zone_device *thermal,
}

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;
Expand Down Expand Up @@ -690,7 +689,8 @@ static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
}

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) {
Expand All @@ -713,8 +713,8 @@ static int thermal_get_trend(struct thermal_zone_device *thermal,
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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/lm75.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static inline long lm75_reg_to_mc(s16 temp, u8 resolution)

/* 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);

Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/ntc_thermistor.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ static int ntc_thermistor_get_ohm(struct ntc_data *data)
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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/tmp102.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static struct tmp102 *tmp102_update_device(struct device *dev)
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);

Expand Down
8 changes: 4 additions & 4 deletions drivers/input/touchscreen/sun4i-ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static void sun4i_ts_close(struct input_dev *dev)
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)
Expand All @@ -202,7 +202,7 @@ static int sun4i_get_temp(const struct sun4i_ts_data *ts, long *temp)
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);
}
Expand All @@ -215,14 +215,14 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *devattr,
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,
Expand Down
9 changes: 4 additions & 5 deletions drivers/platform/x86/acerhdf.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,7 @@ static void acerhdf_check_param(struct thermal_zone_device *thermal)
* 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;

Expand Down Expand Up @@ -453,7 +452,7 @@ static int acerhdf_get_trip_type(struct thermal_zone_device *thermal, int trip,
}

static int acerhdf_get_trip_hyst(struct thermal_zone_device *thermal, int trip,
unsigned long *temp)
int *temp)
{
if (trip != 0)
return -EINVAL;
Expand All @@ -464,7 +463,7 @@ static int acerhdf_get_trip_hyst(struct thermal_zone_device *thermal, int trip,
}

static int acerhdf_get_trip_temp(struct thermal_zone_device *thermal, int trip,
unsigned long *temp)
int *temp)
{
if (trip == 0)
*temp = fanon;
Expand All @@ -477,7 +476,7 @@ static int acerhdf_get_trip_temp(struct thermal_zone_device *thermal, int trip,
}

static int acerhdf_get_crit_temp(struct thermal_zone_device *thermal,
unsigned long *temperature)
int *temperature)
{
*temperature = ACERHDF_TEMP_CRIT;
return 0;
Expand Down
9 changes: 4 additions & 5 deletions drivers/platform/x86/intel_mid_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ static int is_valid_adc(uint16_t adc_val, uint16_t min, uint16_t max)
* to achieve very close approximate temp value with less than
* 0.5C error
*/
static int adc_to_temp(int direct, uint16_t adc_val, unsigned long *tp)
static int adc_to_temp(int direct, uint16_t adc_val, int *tp)
{
int temp;

Expand Down Expand Up @@ -174,14 +174,13 @@ static int adc_to_temp(int direct, uint16_t adc_val, unsigned long *tp)
*
* Can sleep
*/
static int mid_read_temp(struct thermal_zone_device *tzd, unsigned long *temp)
static int mid_read_temp(struct thermal_zone_device *tzd, int *temp)
{
struct thermal_device_info *td_info = tzd->devdata;
uint16_t adc_val, addr;
uint8_t data = 0;
int ret;
unsigned long curr_temp;

int curr_temp;

addr = td_info->chnl_addr;

Expand Down Expand Up @@ -453,7 +452,7 @@ static SIMPLE_DEV_PM_OPS(mid_thermal_pm,
*
* Can sleep
*/
static int read_curr_temp(struct thermal_zone_device *tzd, unsigned long *temp)
static int read_curr_temp(struct thermal_zone_device *tzd, int *temp)
{
WARN_ON(tzd == NULL);
return mid_read_temp(tzd, temp);
Expand Down
2 changes: 1 addition & 1 deletion drivers/power/charger-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ static int cm_get_battery_temperature(struct charger_manager *cm,

#ifdef CONFIG_THERMAL
if (cm->tzd_batt) {
ret = thermal_zone_get_temp(cm->tzd_batt, (unsigned long *)temp);
ret = thermal_zone_get_temp(cm->tzd_batt, temp);
if (!ret)
/* Calibrate temperature unit */
*temp /= 100;
Expand Down
2 changes: 1 addition & 1 deletion drivers/power/power_supply_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ EXPORT_SYMBOL_GPL(power_supply_unreg_notifier);

#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;
Expand Down
8 changes: 8 additions & 0 deletions drivers/thermal/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,14 @@ config ACPI_THERMAL_REL
tristate
depends on ACPI

config INTEL_PCH_THERMAL
tristate "Intel PCH Thermal Reporting Driver"
depends on X86 && PCI
help
Enable this to support thermal reporting on certain intel PCHs.
Thermal reporting device will provide temperature reading,
programmable trip points and other information.

menu "Texas Instruments thermal drivers"
source "drivers/thermal/ti-soc-thermal/Kconfig"
endmenu
Expand Down
1 change: 1 addition & 0 deletions drivers/thermal/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ obj-$(CONFIG_INTEL_SOC_DTS_THERMAL) += intel_soc_dts_thermal.o
obj-$(CONFIG_INTEL_QUARK_DTS_THERMAL) += intel_quark_dts_thermal.o
obj-$(CONFIG_TI_SOC_THERMAL) += ti-soc-thermal/
obj-$(CONFIG_INT340X_THERMAL) += int340x_thermal/
obj-$(CONFIG_INTEL_PCH_THERMAL) += intel_pch_thermal.o
obj-$(CONFIG_ST_THERMAL) += st/
obj-$(CONFIG_TEGRA_SOCTHERM) += tegra_soctherm.o
obj-$(CONFIG_HISI_THERMAL) += hisi_thermal.o
2 changes: 1 addition & 1 deletion drivers/thermal/armada_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static bool armada_is_valid(struct armada_thermal_priv *priv)
}

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;
Expand Down
7 changes: 3 additions & 4 deletions drivers/thermal/db8500_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ static int db8500_cdev_unbind(struct thermal_zone_device *thermal,
}

/* 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;

Expand Down Expand Up @@ -180,7 +179,7 @@ static int db8500_sys_get_trip_type(struct thermal_zone_device *thermal,

/* 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;
Expand All @@ -195,7 +194,7 @@ static int db8500_sys_get_trip_temp(struct thermal_zone_device *thermal,

/* 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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/thermal/dove_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static int dove_init_sensor(const struct dove_thermal_priv *priv)
}

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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/thermal/fair_share.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions drivers/thermal/gov_bang_bang.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions drivers/thermal/hisi_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static void hisi_thermal_disable_sensor(struct hisi_thermal_data *data)
mutex_unlock(&data->thermal_lock);
}

static int hisi_thermal_get_temp(void *_sensor, long *temp)
static int hisi_thermal_get_temp(void *_sensor, int *temp)
{
struct hisi_thermal_sensor *sensor = _sensor;
struct hisi_thermal_data *data = sensor->thermal;
Expand All @@ -178,7 +178,7 @@ static int hisi_thermal_get_temp(void *_sensor, long *temp)
data->irq_bind_sensor = sensor_id;
mutex_unlock(&data->thermal_lock);

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

0 comments on commit 5a924a0

Please sign in to comment.