static int nct1008_get_temp_common(int sensor,
struct nct1008_data *data,
- long *temp)
+ int *temp)
{
struct i2c_client *client = data->client;
struct nct1008_platform_data *pdata = client->dev.platform_data;
long int num;
int err;
u8 temp;
- long curr_temp;
+ int curr_temp;
struct i2c_client *client = to_i2c_client(dev);
struct nct1008_data *data = i2c_get_clientdata(client);
char bufTemp[MAX_STR_PRINT];
ret = nct1008_show_temp_overheat(dev, attr, bufOverheat);
dev_err(dev, "\nCurrent temp: %s ", bufTemp);
dev_err(dev, "\nOld overheat limit: %s ", bufOverheat);
- dev_err(dev, "\nReset from overheat: curr temp=%ld, new overheat temp=%d\n\n",
+ dev_err(dev, "\nReset from overheat: curr temp=%d, new overheat temp=%d\n\n",
curr_temp, (int)num);
}
{
struct nct1008_data *data = cdev->devdata;
long limit = data->plat_data.sensors[EXT].shutdown_limit * 1000;
- long temp;
+ int temp;
if (nct1008_get_temp_common(EXT, data, &temp))
return -1;
{
struct nct1008_data *data = cdev->devdata;
long limit = data->plat_data.sensors[EXT].shutdown_limit * 1000;
- long temp;
+ int temp;
if (nct1008_get_temp_common(EXT, data, &temp))
return -1;
if ((temp >= (limit - THERM_WARN_RANGE_HIGH_OFFSET)) &&
(temp != shutdown_warn_saved_temp)) {
- pr_warn("NCT%s: Warning: chip temperature (%ld.%02ldC) is %s SHUTDOWN limit (%c%ldC).\n",
+ pr_warn("NCT%s: Warning: chip temperature (%d.%02dC) is %s SHUTDOWN limit (%c%ldC).\n",
(data->chip == NCT72) ? "72" : "1008",
temp / 1000, (temp % 1000) / 10,
temp > limit ? "above" :
struct thermal_zone_device *thz;
long low_temp, high_temp;
struct thermal_trip_info *trip_state;
- long temp, trip_temp, hysteresis_temp;
+ int temp, trip_temp, hysteresis_temp;
int count;
enum thermal_trip_type trip_type;
low_temp = 0, high_temp = NCT1008_MAX_TEMP * 1000;
nct1008_thermal_set_limits(sensor, data, low_temp, high_temp);
}
-static int nct1008_ext_get_temp(struct thermal_zone_device *thz,
- unsigned long *temp)
+static int nct1008_ext_get_temp(struct thermal_zone_device *thz, int *temp)
{
struct nct1008_data *data = thz->devdata;
return nct1008_get_temp_common(EXT, data, temp);
}
-static int nct1008_ext_get_temp_as_sensor(void *data, long *temp)
+static int nct1008_ext_get_temp_as_sensor(void *data, int *temp)
{
return nct1008_get_temp_common(EXT, (struct nct1008_data *) data, temp);
}
if (!strcmp(sensor->trips[i].cdev_type, cdev->type))
thermal_zone_bind_cooling_device(thz, i, cdev,
sensor->trips[i].upper,
- sensor->trips[i].lower);
+ sensor->trips[i].lower,
+ THERMAL_WEIGHT_DEFAULT);
}
return 0;
}
/* This function reads the temperature value set for the given trip point. */
-static int nct1008_get_trip_temp(int sensor,
- struct thermal_zone_device *thz,
- int trip,
- unsigned long *temp)
+static int nct1008_get_trip_temp(int sensor, struct thermal_zone_device *thz,
+ int trip, int *temp)
{
struct nct1008_data *data = thz->devdata;
struct thermal_trip_info *trip_state =
/* This function reads the temperature value set for the given trip point for
the local sensor. */
static inline int nct1008_loc_get_trip_temp(struct thermal_zone_device *thz,
- int trip,
- unsigned long *temp)
+ int trip, int *temp)
{
return nct1008_get_trip_temp(LOC, thz, trip, temp);
}
/* This function reads the temperature value set for the given trip point for
the remote sensor. */
static inline int nct1008_ext_get_trip_temp(struct thermal_zone_device *thz,
- int trip,
- unsigned long *temp)
+ int trip, int *temp)
{
return nct1008_get_trip_temp(EXT, thz, trip, temp);
}
/* This function allows setting trip point temperature for the sensor
specified. */
-static int nct1008_set_trip_temp(int sensor,
- struct thermal_zone_device *thz,
- int trip,
- unsigned long temp)
+static int nct1008_set_trip_temp(int sensor, struct thermal_zone_device *thz,
+ int trip, int temp)
{
struct nct1008_data *data = thz->devdata;
/* This function allows setting trip point temperature for the local sensor. */
static inline int nct1008_loc_set_trip_temp(struct thermal_zone_device *thz,
- int trip,
- unsigned long temp)
+ int trip, int temp)
{
return nct1008_set_trip_temp(LOC, thz, trip, temp);
}
/* This function allows setting trip point temperature for the external
* sensor. */
static inline int nct1008_ext_set_trip_temp(struct thermal_zone_device *thz,
- int trip,
- unsigned long temp)
+ int trip, int temp)
{
return nct1008_set_trip_temp(EXT, thz, trip, temp);
}
}
static int nct1008_get_trip_hyst(int sensor, struct thermal_zone_device *thz,
- int trip,
- long *hyst)
+ int trip, int *hyst)
{
struct nct1008_data *data = thz->devdata;
}
static inline int nct1008_loc_get_trip_hyst(struct thermal_zone_device *thz,
- int trip,
- long *hyst)
+ int trip, int *hyst)
{
return nct1008_get_trip_hyst(LOC, thz, trip, hyst);
}
static inline int nct1008_ext_get_trip_hyst(struct thermal_zone_device *thz,
- int trip,
- long *hyst)
+ int trip, int *hyst)
{
return nct1008_get_trip_hyst(EXT, thz, trip, hyst);
}
int trip,
enum thermal_trend *trend)
{
- long trip_temp, trip_hyst;
+ int trip_temp, trip_hyst;
enum thermal_trip_type trip_type;
thz->ops->get_trip_temp(thz, trip, &trip_temp);
/* Helper function to get temperature of the local sensor. */
-static int nct1008_loc_get_temp(struct thermal_zone_device *thz,
- unsigned long *temp)
+static int nct1008_loc_get_temp(struct thermal_zone_device *thz, int *temp)
{
struct nct1008_data *data = thz->devdata;
return nct1008_get_temp_common(LOC, data, temp);
}
-static int nct1008_loc_get_temp_as_sensor(void *data, long *temp)
+static int nct1008_loc_get_temp_as_sensor(void *data, int *temp)
{
return nct1008_get_temp_common(LOC, (struct nct1008_data *) data, temp);
}
if (!strcmp(sensor_data->trips[i].cdev_type, cdev->type)) {
thermal_zone_bind_cooling_device(thz, i, cdev,
sensor_data->trips[i].upper,
- sensor_data->trips[i].lower);
+ sensor_data->trips[i].lower,
+ THERMAL_WEIGHT_DEFAULT);
break;
}
}
/* Remote channel offset fraction (quarters) */
ret = nct1008_write_reg(client, OFFSET_QUARTER_WR,
- (pdata->offset % 4) << 6);
+ (pdata->offset % 4) << 6);
if (ret < 0)
goto error;
struct i2c_client *client = to_i2c_client(dev);
int err;
struct nct1008_data *data = i2c_get_clientdata(client);
- long temp;
+ int temp;
int sensor_nr;
struct nct1008_sensor_platform_data *sensor_data;