]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
hwmon/f71805f: Fix the device address decoding
authorJean Delvare <khali@linux-fr.org>
Tue, 12 Dec 2006 17:18:29 +0000 (18:18 +0100)
committerJean Delvare <khali@arrakis.delvare>
Tue, 12 Dec 2006 17:18:29 +0000 (18:18 +0100)
The lowest 3 bits are ignored, and the chip decodes all 8 addresses,
not only the 2 it needs.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/hwmon/f71805f.c

index 37ba421789bc9eda75d8cf36d5602e8799b23b58..a272cae8f60ef212d179a767daac10d7fa823593 100644 (file)
@@ -102,9 +102,9 @@ superio_exit(int base)
  * ISA constants
  */
 
-#define REGION_LENGTH          2
-#define ADDR_REG_OFFSET                0
-#define DATA_REG_OFFSET                1
+#define REGION_LENGTH          8
+#define ADDR_REG_OFFSET                5
+#define DATA_REG_OFFSET                6
 
 /*
  * Registers
@@ -1359,6 +1359,7 @@ static int __init f71805f_find(int sioaddr, unsigned short *address,
                       "skipping\n");
                goto exit;
        }
+       *address &= ~(REGION_LENGTH - 1);       /* Ignore 3 LSB */
 
        err = 0;
        printk(KERN_INFO DRVNAME ": Found %s chip at %#x, revision %u\n",