aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/w83795.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2010-10-28 14:31:48 -0400
committerJean Delvare <khali@endymion.delvare>2010-10-28 14:31:48 -0400
commit49c7347a44224b5b87c7e6a3c6c92619d77c06d5 (patch)
tree91432dbcbfd182c46a7cb89d9bece704e41eaf32 /drivers/hwmon/w83795.c
parent7eb8d508b5cfabbb147670ee063438469d94c465 (diff)
hwmon: (w83795) Drop REST_VLT_BEGIN/END
Get rid of REST_VLT_BEGIN and REST_VLT_END, they don't make the code more readable. Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/w83795.c')
-rw-r--r--drivers/hwmon/w83795.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/hwmon/w83795.c b/drivers/hwmon/w83795.c
index ec8a1d1f7d79..4e54edc415d7 100644
--- a/drivers/hwmon/w83795.c
+++ b/drivers/hwmon/w83795.c
@@ -175,10 +175,6 @@ static const u8 IN_LSB_SHIFT_IDX[][2] = {
175}; 175};
176 176
177 177
178/* 3VDD, 3VSB, VBAT * 0.006 */
179#define REST_VLT_BEGIN 12 /* the 13th volt to 15th */
180#define REST_VLT_END 14 /* the 13th volt to 15th */
181
182#define W83795_REG_FAN(index) (0x2E + (index)) 178#define W83795_REG_FAN(index) (0x2E + (index))
183#define W83795_REG_FAN_MIN_HL(index) (0xB6 + (index)) 179#define W83795_REG_FAN_MIN_HL(index) (0xB6 + (index))
184#define W83795_REG_FAN_MIN_LSB(index) (0xC4 + (index) / 2) 180#define W83795_REG_FAN_MIN_LSB(index) (0xC4 + (index) / 2)
@@ -250,7 +246,8 @@ static const u8 IN_LSB_SHIFT_IDX[][2] = {
250 246
251static inline u16 in_from_reg(u8 index, u16 val) 247static inline u16 in_from_reg(u8 index, u16 val)
252{ 248{
253 if ((index >= REST_VLT_BEGIN) && (index <= REST_VLT_END)) 249 /* 3VDD, 3VSB and VBAT: 6 mV/bit; other inputs: 2 mV/bit */
250 if (index >= 12 && index <= 14)
254 return val * 6; 251 return val * 6;
255 else 252 else
256 return val * 2; 253 return val * 2;
@@ -258,7 +255,7 @@ static inline u16 in_from_reg(u8 index, u16 val)
258 255
259static inline u16 in_to_reg(u8 index, u16 val) 256static inline u16 in_to_reg(u8 index, u16 val)
260{ 257{
261 if ((index >= REST_VLT_BEGIN) && (index <= REST_VLT_END)) 258 if (index >= 12 && index <= 14)
262 return val / 6; 259 return val / 6;
263 else 260 else
264 return val / 2; 261 return val / 2;