From 5e8886a66ffe29998fc887c2f20349480933ec42 Mon Sep 17 00:00:00 2001 From: Bob Dougherty Date: Fri, 10 Mar 2000 20:30:45 +0000 Subject: [PATCH] (bobd) now configures temp alarms to stay on while out of range (via686a default is to clear alarm when reg is read) git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@768 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/chips/via686a.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/kernel/chips/via686a.c b/kernel/chips/via686a.c index d97f74bb..e69f4d39 100644 --- a/kernel/chips/via686a.c +++ b/kernel/chips/via686a.c @@ -101,6 +101,16 @@ static const u8 reghyst[] = { 0x3a, 0x3e, 0x1e }; #define VIA686A_REG_ALARM2 0x42 #define VIA686A_REG_FANDIV 0x47 #define VIA686A_REG_CONFIG 0x40 +// The following register sets temp interrupt mode (bits 1-0 for temp1, +// 3-2 for temp2, 5-4 for temp3). Modes are: +// 00 interrupt stays as long as value is out-of-range +// 01 interrupt is cleared once register is read (default) +// 10 comparator mode- like 00, but ignores hysteresis +// 11 same as 00 +#define VIA686A_REG_TEMP_MODE 0x4b +// We'll just assume that you want to set all 3 simulataneously: +#define VIA686A_TEMP_MODE_MASK 0x3F +#define VIA686A_TEMP_MODE_CONTINUOUS (0x00) /* Conversions. Rounding and limit checking is only done on the TO_REG variants. */ @@ -673,6 +683,11 @@ void via686a_init_client(struct i2c_client *client) /* Start monitoring */ via686a_write_value(client, VIA686A_REG_CONFIG, 0x01); + + /* Cofigure temp interrupt mode for continuous-interrupt operation */ + via686a_write_value(client, VIA686A_REG_TEMP_MODE, + via686a_read_value(client, VIA686A_REG_TEMP_MODE) & + !VIA686A_TEMP_MODE_MASK | VIA686A_TEMP_MODE_CONTINUOUS); } void via686a_update_client(struct i2c_client *client)