Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305858
b: refs/heads/master
c: 1137a9a
h: refs/heads/master
v: v3
  • Loading branch information
Guenter Roeck authored and Guenter Roeck committed May 21, 2012
1 parent 28b9d92 commit c75a1c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 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: 7bb5ee0169b80d40aa7d4854c07f1c2a90efc5b8
refs/heads/master: 1137a9a649db818869905b010b120a95a01b0d24
11 changes: 2 additions & 9 deletions trunk/drivers/hwmon/ad7314.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,15 @@
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>

/*
* AD7314 power mode
*/
#define AD7314_PD 0x2000

/*
* AD7314 temperature masks
*/
#define AD7314_TEMP_SIGN 0x200
#define AD7314_TEMP_MASK 0x7FE0
#define AD7314_TEMP_OFFSET 5
#define AD7314_TEMP_SHIFT 5

/*
* ADT7301 and ADT7302 temperature masks
*/
#define ADT7301_TEMP_SIGN 0x2000
#define ADT7301_TEMP_MASK 0x3FFF

enum ad7314_variant {
Expand Down Expand Up @@ -73,7 +66,7 @@ static ssize_t ad7314_show_temperature(struct device *dev,
return ret;
switch (spi_get_device_id(chip->spi_dev)->driver_data) {
case ad7314:
data = (ret & AD7314_TEMP_MASK) >> AD7314_TEMP_OFFSET;
data = (ret & AD7314_TEMP_MASK) >> AD7314_TEMP_SHIFT;
data = (data << 6) >> 6;

return sprintf(buf, "%d\n", 250 * data);
Expand Down

0 comments on commit c75a1c3

Please sign in to comment.