Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 220496
b: refs/heads/master
c: 49c7347
h: refs/heads/master
v: v3
  • Loading branch information
Jean Delvare authored and Jean Delvare committed Oct 28, 2010
1 parent 1ac081f commit 91d19ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 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: 7eb8d508b5cfabbb147670ee063438469d94c465
refs/heads/master: 49c7347a44224b5b87c7e6a3c6c92619d77c06d5
9 changes: 3 additions & 6 deletions trunk/drivers/hwmon/w83795.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,6 @@ static const u8 IN_LSB_SHIFT_IDX[][2] = {
};


/* 3VDD, 3VSB, VBAT * 0.006 */
#define REST_VLT_BEGIN 12 /* the 13th volt to 15th */
#define REST_VLT_END 14 /* the 13th volt to 15th */

#define W83795_REG_FAN(index) (0x2E + (index))
#define W83795_REG_FAN_MIN_HL(index) (0xB6 + (index))
#define W83795_REG_FAN_MIN_LSB(index) (0xC4 + (index) / 2)
Expand Down Expand Up @@ -250,15 +246,16 @@ static const u8 IN_LSB_SHIFT_IDX[][2] = {

static inline u16 in_from_reg(u8 index, u16 val)
{
if ((index >= REST_VLT_BEGIN) && (index <= REST_VLT_END))
/* 3VDD, 3VSB and VBAT: 6 mV/bit; other inputs: 2 mV/bit */
if (index >= 12 && index <= 14)
return val * 6;
else
return val * 2;
}

static inline u16 in_to_reg(u8 index, u16 val)
{
if ((index >= REST_VLT_BEGIN) && (index <= REST_VLT_END))
if (index >= 12 && index <= 14)
return val / 6;
else
return val / 2;
Expand Down

0 comments on commit 91d19ad

Please sign in to comment.