From 84d4715bc64ffed5a98d89828346189c2f2808a4 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 15 Dec 2006 09:25:45 +0000 Subject: [PATCH] f71805f: Fix the device address decoding The lowest 3 bits are ignored, and the chip decodes all 8 addresses, not only the 2 it needs. This is a backport from Linux 2.6.20. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4263 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + kernel/chips/f71805f.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index e70cb680..74fef13e 100644 --- a/CHANGES +++ b/CHANGES @@ -14,6 +14,7 @@ SVN HEAD Man page i2cdetect.8: Describe the output convention Man page sensors.1: Update (option -c) and clean up Module i2c-i801: Add ICH9 support + Module f71805f: Fix the device address decoding (2.6 backport) Module icspll: Delete. It was useless and dangerous. Program eepromer: Fix loads of warnings Program i2cdetect: Make the output clearer diff --git a/kernel/chips/f71805f.c b/kernel/chips/f71805f.c index 10db7550..39f8694c 100644 --- a/kernel/chips/f71805f.c +++ b/kernel/chips/f71805f.c @@ -99,9 +99,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 @@ -722,6 +722,7 @@ static int __init f71805f_find(int sioaddr, unsigned int *address) "skipping\n"); goto exit; } + *address &= ~(REGION_LENGTH - 1); /* Ignore 3 LSB */ err = 0; printk(KERN_INFO DRVNAME ": Found F71805F chip at %#x, revision %u\n",