From 3e655bce2906a172fa889e6053bcc723b764a792 Mon Sep 17 00:00:00 2001 From: "Mark D. Studebaker" Date: Mon, 18 Nov 2002 20:03:38 +0000 Subject: [PATCH] fix bad bugs where in0 wouldn't work at all, and inx limit registers (and hence alarms) were wrong git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1619 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/chips/vt1211.c | 8 ++++---- kernel/chips/vt8231.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/kernel/chips/vt1211.c b/kernel/chips/vt1211.c index e64a1066..13481e59 100644 --- a/kernel/chips/vt1211.c +++ b/kernel/chips/vt1211.c @@ -129,8 +129,8 @@ superio_exit(void) */ /* ins numbered 0-6 */ -#define VT1211_REG_IN_MAX(nr) ((nr)==0 ? 0x3d : 0x2b + (((nr)+1) * 2)) -#define VT1211_REG_IN_MIN(nr) ((nr)==0 ? 0x3e : 0x2c + (((nr)+1) * 2)) +#define VT1211_REG_IN_MAX(nr) ((nr)==0 ? 0x3d : 0x29 + ((nr) * 2)) +#define VT1211_REG_IN_MIN(nr) ((nr)==0 ? 0x3e : 0x2a + ((nr) * 2)) #define VT1211_REG_IN(nr) (0x21 + (nr)) /* fans numbered 1-2 */ @@ -161,8 +161,8 @@ static const u8 reghyst[] = { 0x3a, 0x3e, 0x1e, 0x2c, 0x2e, 0x30, 0x32 }; /* temps 1-7; voltages 0-6 */ #define ISTEMP(i, ch_config) ((i) == 1 ? 1 : \ (i) == 3 ? 1 : \ - (i) == 2 ? (ch_config) & 0x01 : \ - ((ch_config) >> ((i)-1)) & 0x01) + (i) == 2 ? ((ch_config) >> 1) & 0x01 : \ + ((ch_config) >> ((i)-1)) & 0x01) #define ISVOLT(i, ch_config) ((i) > 4 ? 1 : !(((ch_config) >> ((i)+2)) & 0x01)) #define DIV_FROM_REG(val) (1 << (val)) diff --git a/kernel/chips/vt8231.c b/kernel/chips/vt8231.c index b64f50c4..b8cff980 100644 --- a/kernel/chips/vt8231.c +++ b/kernel/chips/vt8231.c @@ -87,8 +87,8 @@ SENSORS_INSMOD_1(vt8231); */ /* ins numbered 0-6 */ -#define VT8231_REG_IN_MAX(nr) ((nr)==0 ? 0x3d : 0x2b + (((nr)+1) * 2)) -#define VT8231_REG_IN_MIN(nr) ((nr)==0 ? 0x3e : 0x2c + (((nr)+1) * 2)) +#define VT8231_REG_IN_MAX(nr) ((nr)==0 ? 0x3d : 0x29 + ((nr) * 2)) +#define VT8231_REG_IN_MIN(nr) ((nr)==0 ? 0x3e : 0x2a + ((nr) * 2)) #define VT8231_REG_IN(nr) (0x21 + (nr)) /* fans numbered 1-2 */ @@ -119,8 +119,8 @@ static const u8 reghyst[] = { 0x3a, 0x3e, 0x1e, 0x2c, 0x2e, 0x30, 0x32 }; /* temps 1-7; voltages 0-6 */ #define ISTEMP(i, ch_config) ((i) == 1 ? 1 : \ (i) == 3 ? 1 : \ - (i) == 2 ? (ch_config) & 0x01 : \ - ((ch_config) >> ((i)-1)) & 0x01) + (i) == 2 ? ((ch_config) >> 1) & 0x01 : \ + ((ch_config) >> ((i)-1)) & 0x01) #define ISVOLT(i, ch_config) ((i) > 4 ? 1 : !(((ch_config) >> ((i)+2)) & 0x01)) #define DIV_FROM_REG(val) (1 << (val))