diff options
author | Rudolf Marek <r.marek@assembler.cz> | 2007-01-18 16:14:24 -0500 |
---|---|---|
committer | Jean Delvare <khali@arrakis.delvare> | 2007-01-18 16:14:24 -0500 |
commit | c92943152884e3777439ad40a40126f2e51b8ea8 (patch) | |
tree | 17e027e06f1cee578cd9b95b54b166f12ec25a60 | |
parent | 46bed4dfe5f95f1fc8f68ead592a7e295bbbe01e (diff) |
hwmon/w83793: Fix the fan input detection
Catch the cases when alternative pins are used to route the
fan9-12 input.
Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Gong Jun <jgong@winbond.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
-rw-r--r-- | drivers/hwmon/w83793.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c index c2b7834ecaa9..7cadef8cd87d 100644 --- a/drivers/hwmon/w83793.c +++ b/drivers/hwmon/w83793.c | |||
@@ -1327,6 +1327,20 @@ static int w83793_detect(struct i2c_adapter *adapter, int address, int kind) | |||
1327 | data->has_pwm |= 0x80; | 1327 | data->has_pwm |= 0x80; |
1328 | } | 1328 | } |
1329 | 1329 | ||
1330 | tmp = w83793_read_value(client, W83793_REG_FANIN_SEL); | ||
1331 | if ((tmp & 0x01) && (val & 0x08)) { /* fan 9, second location */ | ||
1332 | data->has_fan |= 0x100; | ||
1333 | } | ||
1334 | if ((tmp & 0x02) && (val & 0x10)) { /* fan 10, second location */ | ||
1335 | data->has_fan |= 0x200; | ||
1336 | } | ||
1337 | if ((tmp & 0x04) && (val & 0x20)) { /* fan 11, second location */ | ||
1338 | data->has_fan |= 0x400; | ||
1339 | } | ||
1340 | if ((tmp & 0x08) && (val & 0x40)) { /* fan 12, second location */ | ||
1341 | data->has_fan |= 0x800; | ||
1342 | } | ||
1343 | |||
1330 | /* check the temp1-6 mode, ignore former AMDSI selected inputs */ | 1344 | /* check the temp1-6 mode, ignore former AMDSI selected inputs */ |
1331 | tmp = w83793_read_value(client,W83793_REG_TEMP_MODE[0]); | 1345 | tmp = w83793_read_value(client,W83793_REG_TEMP_MODE[0]); |
1332 | if (tmp & 0x01) | 1346 | if (tmp & 0x01) |