Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319395
b: refs/heads/master
c: 2ccc873
h: refs/heads/master
i:
  319393: c51d48c
  319391: 76fbc8a
v: v3
  • Loading branch information
Jean Delvare authored and Guenter Roeck committed Jul 27, 2012
1 parent 7b9d600 commit 52cacaa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 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: 9baeb8fdd7e1e78973ad19a6d7e2bcf7dfeb2498
refs/heads/master: 2ccc8731e5054058d5fb990744b4f72a79018d34
13 changes: 6 additions & 7 deletions trunk/drivers/hwmon/jc42.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static const unsigned short normal_i2c[] = {
#define JC42_CFG_EVENT_LOCK (1 << 7)
#define JC42_CFG_SHUTDOWN (1 << 8)
#define JC42_CFG_HYST_SHIFT 9
#define JC42_CFG_HYST_MASK 0x03
#define JC42_CFG_HYST_MASK (0x03 << 9)

/* Capabilities */
#define JC42_CAP_RANGE (1 << 2)
Expand Down Expand Up @@ -287,8 +287,8 @@ static ssize_t show_temp_crit_hyst(struct device *dev,
return PTR_ERR(data);

temp = jc42_temp_from_reg(data->temp_crit);
hyst = jc42_hysteresis[(data->config >> JC42_CFG_HYST_SHIFT)
& JC42_CFG_HYST_MASK];
hyst = jc42_hysteresis[(data->config & JC42_CFG_HYST_MASK)
>> JC42_CFG_HYST_SHIFT];
return sprintf(buf, "%d\n", temp - hyst);
}

Expand All @@ -302,8 +302,8 @@ static ssize_t show_temp_max_hyst(struct device *dev,
return PTR_ERR(data);

temp = jc42_temp_from_reg(data->temp_max);
hyst = jc42_hysteresis[(data->config >> JC42_CFG_HYST_SHIFT)
& JC42_CFG_HYST_MASK];
hyst = jc42_hysteresis[(data->config & JC42_CFG_HYST_MASK)
>> JC42_CFG_HYST_SHIFT];
return sprintf(buf, "%d\n", temp - hyst);
}

Expand Down Expand Up @@ -362,8 +362,7 @@ static ssize_t set_temp_crit_hyst(struct device *dev,
}

mutex_lock(&data->update_lock);
data->config = (data->config
& ~(JC42_CFG_HYST_MASK << JC42_CFG_HYST_SHIFT))
data->config = (data->config & ~JC42_CFG_HYST_MASK)
| (hyst << JC42_CFG_HYST_SHIFT);
err = i2c_smbus_write_word_swapped(client, JC42_REG_CONFIG,
data->config);
Expand Down

0 comments on commit 52cacaa

Please sign in to comment.