summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/w83793.c
diff options
context:
space:
mode:
authorRudolf Marek <r.marek@assembler.cz>2007-01-18 22:14:24 +0100
committerJean Delvare <khali@arrakis.delvare>2007-01-18 22:14:24 +0100
commitc92943152884e3777439ad40a40126f2e51b8ea8 (patch)
tree17e027e06f1cee578cd9b95b54b166f12ec25a60 /drivers/hwmon/w83793.c
parent46bed4dfe5f95f1fc8f68ead592a7e295bbbe01e (diff)
downloadlinux-c92943152884e3777439ad40a40126f2e51b8ea8.tar.gz
linux-c92943152884e3777439ad40a40126f2e51b8ea8.tar.bz2
linux-c92943152884e3777439ad40a40126f2e51b8ea8.zip
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>
Diffstat (limited to 'drivers/hwmon/w83793.c')
-rw-r--r--drivers/hwmon/w83793.c14
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)
data->has_pwm |= 0x80;
}
+ tmp = w83793_read_value(client, W83793_REG_FANIN_SEL);
+ if ((tmp & 0x01) && (val & 0x08)) { /* fan 9, second location */
+ data->has_fan |= 0x100;
+ }
+ if ((tmp & 0x02) && (val & 0x10)) { /* fan 10, second location */
+ data->has_fan |= 0x200;
+ }
+ if ((tmp & 0x04) && (val & 0x20)) { /* fan 11, second location */
+ data->has_fan |= 0x400;
+ }
+ if ((tmp & 0x08) && (val & 0x40)) { /* fan 12, second location */
+ data->has_fan |= 0x800;
+ }
+
/* check the temp1-6 mode, ignore former AMDSI selected inputs */
tmp = w83793_read_value(client,W83793_REG_TEMP_MODE[0]);
if (tmp & 0x01)