summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorDiwakar Tundlam <dtundlam@nvidia.com>2012-01-12 12:24:02 -0800
committerVarun Colbert <vcolbert@nvidia.com>2012-01-19 16:16:08 -0800
commitb8c095cb9a889d4d3237d3cf0d9fd623c394ef50 (patch)
tree7fb14dc9915f7e77dd50dc3df64fac9d1d028966 /drivers/misc
parentf1ef6513c074f3515ca5244fe971728c9aaa8e96 (diff)
drivers: misc: nct: Show lo/hi alerts in nct debug
Also fixed some error strings Reviewed-on: http://git-master/r/75035 Change-Id: Ia071d25f4e0402c55bdc9830cca948759e4aea2c Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com> Reviewed-by: Joshua Primero <jprimero@nvidia.com> Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/75877 Reviewed-by: Automatic_Commit_Validation_User Tested-by: Joshua Primero <jprimero@nvidia.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/nct1008.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/misc/nct1008.c b/drivers/misc/nct1008.c
index fab2df033dff..a9a0891f5c75 100644
--- a/drivers/misc/nct1008.c
+++ b/drivers/misc/nct1008.c
@@ -45,6 +45,7 @@
#define LOCAL_TEMP_LO_LIMIT_RD 0x06
#define EXT_TEMP_HI_LIMIT_HI_BYTE_RD 0x07
+#define EXT_TEMP_LO_LIMIT_HI_BYTE_RD 0x08
#define CONFIG_WR 0x09
#define CONV_RATE_WR 0x0A
@@ -258,24 +259,23 @@ static ssize_t nct1008_show_temp_alert(struct device *dev,
struct i2c_client *client = to_i2c_client(dev);
struct nct1008_platform_data *pdata = client->dev.platform_data;
int value;
- s8 temp, temp2;
- /* External Temperature Throttling limit */
+ s8 temp_hi, temp_lo;
+ /* External Temperature Throttling hi-limit */
value = i2c_smbus_read_byte_data(client, EXT_TEMP_HI_LIMIT_HI_BYTE_RD);
if (value < 0)
goto error;
- temp2 = value_to_temperature(pdata->ext_range, value);
+ temp_hi = value_to_temperature(pdata->ext_range, value);
- /* Local Temperature Throttling limit */
- value = i2c_smbus_read_byte_data(client, LOCAL_TEMP_HI_LIMIT_RD);
+ /* External Temperature Throttling lo-limit */
+ value = i2c_smbus_read_byte_data(client, EXT_TEMP_LO_LIMIT_HI_BYTE_RD);
if (value < 0)
goto error;
- temp = value_to_temperature(pdata->ext_range, value);
+ temp_lo = value_to_temperature(pdata->ext_range, value);
- return snprintf(buf, MAX_STR_PRINT, "%d %d\n", temp, temp2);
+ return snprintf(buf, MAX_STR_PRINT, "lo:%d hi:%d\n", temp_lo, temp_hi);
error:
- dev_err(dev, "%s: failed to read temperature-overheat "
- "\n", __func__);
- return snprintf(buf, MAX_STR_PRINT, " Rd overheat Error\n");
+ dev_err(dev, "%s: failed to read temperature-alert\n", __func__);
+ return snprintf(buf, MAX_STR_PRINT, " Rd alert Error\n");
}
static ssize_t nct1008_set_temp_alert(struct device *dev,
@@ -800,7 +800,7 @@ int nct1008_thermal_set_limits(struct nct1008_data *data,
if (data->current_lo_limit != lo_limit) {
value = temperature_to_value(extended_range, lo_limit);
- pr_debug("%s: %d\n", __func__, value);
+ pr_debug("%s: set lo_limit %ld\n", __func__, lo_limit);
err = i2c_smbus_write_byte_data(data->client,
EXT_TEMP_LO_LIMIT_HI_BYTE_WR, value);
if (err)
@@ -811,7 +811,7 @@ int nct1008_thermal_set_limits(struct nct1008_data *data,
if (data->current_hi_limit != hi_limit) {
value = temperature_to_value(extended_range, hi_limit);
- pr_debug("%s: %d\n", __func__, value);
+ pr_debug("%s: set hi_limit %ld\n", __func__, hi_limit);
err = i2c_smbus_write_byte_data(data->client,
EXT_TEMP_HI_LIMIT_HI_BYTE_WR, value);
if (err)