Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117822
b: refs/heads/master
c: ec38fa2
h: refs/heads/master
v: v3
  • Loading branch information
Jean Delvare committed Oct 26, 2008
1 parent de06f90 commit a8fb565
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1b871826b3dfcdcd78140d17c00e452eec6c12a4
refs/heads/master: ec38fa2b35f13e7fa1d676a5bc997d0df1b02574
15 changes: 12 additions & 3 deletions trunk/drivers/hwmon/lm90.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,8 @@ static ssize_t show_temphyst(struct device *dev, struct device_attribute *devatt

if (data->kind == adt7461)
temp = temp_from_u8_adt7461(data, data->temp8[attr->index]);
else if (data->kind == max6646)
temp = temp_from_u8(data->temp8[attr->index]);
else
temp = temp_from_s8(data->temp8[attr->index]);

Expand All @@ -473,12 +475,19 @@ static ssize_t set_temphyst(struct device *dev, struct device_attribute *dummy,
struct i2c_client *client = to_i2c_client(dev);
struct lm90_data *data = i2c_get_clientdata(client);
long val = simple_strtol(buf, NULL, 10);
long hyst;
int temp;

mutex_lock(&data->update_lock);
hyst = temp_from_s8(data->temp8[2]) - val;
if (data->kind == adt7461)
temp = temp_from_u8_adt7461(data, data->temp8[2]);
else if (data->kind == max6646)
temp = temp_from_u8(data->temp8[2]);
else
temp = temp_from_s8(data->temp8[2]);

data->temp_hyst = hyst_to_reg(temp - val);
i2c_smbus_write_byte_data(client, LM90_REG_W_TCRIT_HYST,
hyst_to_reg(hyst));
data->temp_hyst);
mutex_unlock(&data->update_lock);
return count;
}
Expand Down

0 comments on commit a8fb565

Please sign in to comment.