Initialize temp1-3 to "comparator" mode so that the ALARM

indication will always be valid; it won't be cleared forever by
      reading the register. Do this by setting temp1_hyst to 127
      and programming register 4C which sets it for temps 2 and 3.
      Don't print hyst. value for temp1 in 'sensors' if == 127.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1407 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Mark D. Studebaker committed 2002-06-29 02:46:51 +00:00
1 parent 1c990e4d35
commit 927aae8b81
4 files changed
+26 -8

No files matched your search

+7 -3
View File
@@ -115,6 +115,7 @@ MODULE_PARM_DESC(init, "Set to zero to bypass chip initialization");
#define W83781D_REG_ALARM2 0x42
#define W83781D_REG_ALARM3 0x450 /* not on W83781D */
#define W83781D_REG_IRQ 0x4C
#define W83781D_REG_BEEP_CONFIG 0x4D
#define W83781D_REG_BEEP_INTS1 0x56
#define W83781D_REG_BEEP_INTS2 0x57
@@ -306,7 +307,7 @@ extern inline u8 DIV_TO_REG(long val, enum chips type)
#define W83781D_INIT_FAN_MIN_3 3000
#define W83781D_INIT_TEMP_OVER 600
#define W83781D_INIT_TEMP_HYST 500
#define W83781D_INIT_TEMP_HYST 1270 /* must be 127 for ALARM to work */
#define W83781D_INIT_TEMP2_OVER 600
#define W83781D_INIT_TEMP2_HYST 500
#define W83781D_INIT_TEMP3_OVER 600
@@ -1455,10 +1456,13 @@ void w83781d_init_client(struct i2c_client *client)
w83781d_write_value(client, W83781D_REG_TEMP3_CONFIG,
0x00);
}
/* enable PWM2 control (can't hurt since PWM reg should have
been reset to 0xff) */
if (type != w83781d) {
/* enable PWM2 control (can't hurt since PWM reg
should have been reset to 0xff) */
w83781d_write_value(client, W83781D_REG_PWMCLK12, 0x19);
/* enable comparator mode for temp2 and temp3 so
alarm indication will work correctly */
w83781d_write_value(client, W83781D_REG_IRQ, 0x41);
}
}