Skip to contentSkip to conversation

w83781d and alarms for temp2 and temp3

DISCUSSION Applied Aurelien Jarno 2 participants 7 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw

Hi all !

I found a small bug in sensors and sensord when used with a w83781d chip. On this chip the alarms for temp2 and temp3 are merged. However that is not handled in sensors and sensord.

Please find attached a preliminary patch against the current CVS for sensors.

Concerning sensord the patch would be a little bit more complicated as the code is shared with the as99127f. I first wanted to know if the as99127f behaves as the w83781d. If somebody could test that it would be great. The test is simple: set beep_mask to 0x2000, and see if "(beep)" is printed on the temp3 line.

Bye,
Aurelien

Signature · 23 lines
  .''`.  Aurelien Jarno	              GPG: 1024D/F1BCDB73
 : :' :  Debian GNU/Linux developer | Electrical Engineering Student 
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net
-------------- next part --------------
diff -ru lm_sensors2.orig/prog/sensors/chips.c lm_sensors2/prog/sensors/chips.c
--- lm_sensors2.orig/prog/sensors/chips.c	2004-05-02 00:23:03.000000000 +0200
+++ lm_sensors2/prog/sensors/chips.c	2004-05-02 00:22:38.000000000 +0200
@@ -2346,8 +2346,12 @@
         if(!is82d) {
           print_label(label,10);
           print_temp_info( cur, max, min, HYST, 1, 0);
-          printf(" %s  %s\n", alarms&W83781D_ALARM_TEMP3 ?"ALARM":"     ",
-                 beeps&W83781D_ALARM_TEMP3?"(beep)":"");
+          if (!is81d)
+            printf(" %s  %s\n", alarms&W83781D_ALARM_TEMP3 ?"ALARM":"     ",
+                   beeps&W83781D_ALARM_TEMP3?"(beep)":"");
+          else
+            printf(" %s  %s\n", alarms&W83781D_ALARM_TEMP23 ?"ALARM":"     ",
+                   beeps&W83781D_ALARM_TEMP23?"(beep)":"");
         } else {
           if(!sensors_get_feature(*name,SENSORS_W83781D_SENS3,&sens)) {
             print_label(label,10);
#1 lore raw
Quoted 3 lines · Aurelien Jarno

I found a small bug in sensors and sensord when used with a w83781d chip. On this chip the alarms for temp2 and temp3 are merged. However that is not handled in sensors and sensord.

Please find attached two patches to fix that, one concerning sensors and the other one concerning sensord.

The patch for sensors is almost the same as the previous one, but now the code would compile!

The patch for sensord looks like a little bit long. That's because the code was shared between w83781d and as99127f chips. With this patch, the two chips are handled separatly

Bye,
Aurelien

Signature · 205 lines
  .''`.  Aurelien Jarno	              GPG: 1024D/F1BCDB73
 : :' :  Debian GNU/Linux developer | Electrical Engineering Student 
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net
-------------- next part --------------
diff -urN lm_sensors2.orig/prog/sensors/chips.c lm_sensors2/prog/sensors/chips.c
--- lm_sensors2.orig/prog/sensors/chips.c	2004-05-05 14:03:37.000000000 +0200
+++ lm_sensors2/prog/sensors/chips.c	2004-05-05 14:03:53.000000000 +0200
@@ -2080,8 +2080,9 @@
   char *label = NULL;
   double cur,min,max,fdiv,sens;
   int alarms,beeps;
-  int is82d, is83s, is697hf, is627thf, valid;
+  int is81d, is82d, is83s, is697hf, is627thf, valid;
 
+  is81d = !strcmp(name->prefix,"w83781d");
   is82d = (!strcmp(name->prefix,"w83782d")) ||
           (!strcmp(name->prefix,"w83627hf")) ||
           (!strcmp(name->prefix,"w83637hf")) ||
@@ -2343,8 +2344,12 @@
         if(!is82d) {
           print_label(label,10);
           print_temp_info( cur, max, min, HYST, 1, 0);
+          if (!is81d)
           printf(" %s  %s\n", alarms&W83781D_ALARM_TEMP3 ?"ALARM":"     ",
                  beeps&W83781D_ALARM_TEMP3?"(beep)":"");
+          else
+            printf(" %s  %s\n", alarms&W83781D_ALARM_TEMP23 ?"ALARM":"     ",
+                   beeps&W83781D_ALARM_TEMP23?"(beep)":"");
         } else {
           if(!sensors_get_feature(*name,SENSORS_W83781D_SENS3,&sens)) {
             print_label(label,10);
-------------- next part --------------
diff -urN lm_sensors2.orig/lib/chips.h lm_sensors2/lib/chips.h
--- lm_sensors2.orig/lib/chips.h	2004-05-05 14:03:37.000000000 +0200
+++ lm_sensors2/lib/chips.h	2004-05-05 14:03:53.000000000 +0200
@@ -461,6 +461,58 @@
 #define SENSORS_LM90_REMOTE_TCRIT_HYST 80 /* R, see driver source */
 #define SENSORS_LM90_ALARMS 81 /* R */
 
+/* Asus AS99127F chips */
+
+#define SENSORS_AS99127F_PREFIX "as99127f"
+
+#define SENSORS_AS99127F_IN0 1 /* R */
+#define SENSORS_AS99127F_IN1 2 /* R */
+#define SENSORS_AS99127F_IN2 3 /* R */
+#define SENSORS_AS99127F_IN3 4 /* R */
+#define SENSORS_AS99127F_IN4 5 /* R */
+#define SENSORS_AS99127F_IN5 6 /* R */
+#define SENSORS_AS99127F_IN6 7 /* R */
+#define SENSORS_AS99127F_IN0_MIN 11 /* RW */
+#define SENSORS_AS99127F_IN1_MIN 12 /* RW */
+#define SENSORS_AS99127F_IN2_MIN 13 /* RW */
+#define SENSORS_AS99127F_IN3_MIN 14 /* RW */
+#define SENSORS_AS99127F_IN4_MIN 15 /* RW */
+#define SENSORS_AS99127F_IN5_MIN 16 /* RW */
+#define SENSORS_AS99127F_IN6_MIN 17 /* RW */
+#define SENSORS_AS99127F_IN0_MAX 21 /* RW */
+#define SENSORS_AS99127F_IN1_MAX 22 /* RW */
+#define SENSORS_AS99127F_IN2_MAX 23 /* RW */
+#define SENSORS_AS99127F_IN3_MAX 24 /* RW */
+#define SENSORS_AS99127F_IN4_MAX 25 /* RW */
+#define SENSORS_AS99127F_IN5_MAX 26 /* RW */
+#define SENSORS_AS99127F_IN6_MAX 27 /* RW */
+#define SENSORS_AS99127F_FAN1 31 /* R */
+#define SENSORS_AS99127F_FAN2 32 /* R */
+#define SENSORS_AS99127F_FAN3 33 /* R */
+#define SENSORS_AS99127F_FAN1_MIN 41 /* RW */
+#define SENSORS_AS99127F_FAN2_MIN 42 /* RW */
+#define SENSORS_AS99127F_FAN3_MIN 43 /* RW */
+#define SENSORS_AS99127F_TEMP1 51 /* R */
+#define SENSORS_AS99127F_TEMP1_HYST 52 /* RW */
+#define SENSORS_AS99127F_TEMP1_OVER 53 /* RW */
+#define SENSORS_AS99127F_TEMP2 54 /* R */
+#define SENSORS_AS99127F_TEMP2_HYST 55 /* RW */
+#define SENSORS_AS99127F_TEMP2_OVER 56 /* RW */
+#define SENSORS_AS99127F_TEMP3 57 /* R */
+#define SENSORS_AS99127F_TEMP3_HYST 58 /* RW */
+#define SENSORS_AS99127F_TEMP3_OVER 59 /* RW */
+#define SENSORS_AS99127F_VID 61 /* R */
+#define SENSORS_AS99127F_VRM 62 /* RW */
+#define SENSORS_AS99127F_FAN1_DIV 71 /* RW */
+#define SENSORS_AS99127F_FAN2_DIV 72 /* RW */
+#define SENSORS_AS99127F_FAN3_DIV 73 /* R (yes, really! */
+#define SENSORS_AS99127F_ALARMS 81 /* R */
+#define SENSORS_AS99127F_BEEP_ENABLE 82 /* RW */
+#define SENSORS_AS99127F_BEEPS 83 /* RW */
+#define SENSORS_AS99127F_SENS1 91 /* RW */
+#define SENSORS_AS99127F_SENS2 92 /* RW */
+#define SENSORS_AS99127F_SENS3 93 /* RW */
+
 /* Winbond W83781D chips */
 
 #define SENSORS_W83781D_PREFIX "w83781d"
@@ -599,7 +651,6 @@
 
 
 
-#define SENSORS_AS99127F_PREFIX "as99127f"
 
 #define SENSORS_W83782D_IN0 1 /* R */
 #define SENSORS_W83782D_IN1 2 /* R */
diff -urN lm_sensors2.orig/prog/sensord/chips.c lm_sensors2/prog/sensord/chips.c
--- lm_sensors2.orig/prog/sensord/chips.c	2004-05-05 14:03:37.000000000 +0200
+++ lm_sensors2/prog/sensord/chips.c	2004-05-05 14:03:53.000000000 +0200
@@ -583,6 +583,66 @@
   it87_names, it87_features, SENSORS_IT87_ALARMS, 0
 };
 
+/** AS99127F **/
+
+static const char *
+fmtTemps_AS99127F
+(const double values[], int alarm, int beep) {
+  if (values[2] = 127) {
+    sprintf (buff, "%.0f C (limit = %.0f C)",
+             values[0], values[1]);
+  } else {
+    sprintf (buff, "%.0f C (limit = %.0f C, hysteresis = %.0f C)",
+             values[0], values[1], values[2]);
+  }
+  return fmtExtra (alarm, beep);
+}
+
+static const char *as99127f_names[] = {
+  SENSORS_AS99127F_PREFIX, NULL
+};
+
+static const FeatureDescriptor as99127f_features[] = {
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN0, W83781D_ALARM_IN0,
+    { SENSORS_AS99127F_IN0, SENSORS_AS99127F_IN0_MIN, SENSORS_AS99127F_IN0_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN1, W83781D_ALARM_IN1,
+    { SENSORS_AS99127F_IN1, SENSORS_AS99127F_IN1_MIN, SENSORS_AS99127F_IN1_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN2, W83781D_ALARM_IN2,
+    { SENSORS_AS99127F_IN2, SENSORS_AS99127F_IN2_MIN, SENSORS_AS99127F_IN2_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN3, W83781D_ALARM_IN3,
+    { SENSORS_AS99127F_IN3, SENSORS_AS99127F_IN3_MIN, SENSORS_AS99127F_IN3_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN4, W83781D_ALARM_IN4,
+    { SENSORS_AS99127F_IN4, SENSORS_AS99127F_IN4_MIN, SENSORS_AS99127F_IN4_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN5, W83781D_ALARM_IN5,
+    { SENSORS_AS99127F_IN5, SENSORS_AS99127F_IN5_MIN, SENSORS_AS99127F_IN5_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN6, W83781D_ALARM_IN6,
+    { SENSORS_AS99127F_IN6, SENSORS_AS99127F_IN6_MIN, SENSORS_AS99127F_IN6_MAX, -1 } },
+  { fmtFans_0, rrdF0, DataType_rpm, W83781D_ALARM_FAN1, W83781D_ALARM_FAN1,
+    { SENSORS_AS99127F_FAN1, SENSORS_AS99127F_FAN1_MIN, SENSORS_AS99127F_FAN1_DIV, -1 } },
+  { fmtFans_0, rrdF0, DataType_rpm, W83781D_ALARM_FAN2, W83781D_ALARM_FAN2,
+    { SENSORS_AS99127F_FAN2, SENSORS_AS99127F_FAN2_MIN, SENSORS_AS99127F_FAN2_DIV, -1 } },
+  { fmtFans_0, rrdF0, DataType_rpm, W83781D_ALARM_FAN3, W83781D_ALARM_FAN3,
+    { SENSORS_AS99127F_FAN3, SENSORS_AS99127F_FAN3_MIN, SENSORS_AS99127F_FAN3_DIV, -1 } },
+  { fmtTemps_AS99127F, rrdF0, DataType_temperature, W83781D_ALARM_TEMP1, W83781D_ALARM_TEMP1,
+    { SENSORS_AS99127F_TEMP1, SENSORS_AS99127F_TEMP1_OVER, SENSORS_AS99127F_TEMP1_HYST, -1 } },
+  { fmtTemps_1_0, rrdF1, DataType_temperature, W83781D_ALARM_TEMP2, W83781D_ALARM_TEMP2,
+    { SENSORS_AS99127F_TEMP2, SENSORS_AS99127F_TEMP2_OVER, SENSORS_AS99127F_TEMP2_HYST, -1 } },
+  { fmtTemps_1_0, rrdF1, DataType_temperature, W83781D_ALARM_TEMP3, W83781D_ALARM_TEMP3,
+    { SENSORS_AS99127F_TEMP3, SENSORS_AS99127F_TEMP3_OVER, SENSORS_AS99127F_TEMP3_HYST, -1 } },
+  { fmtVolt_3, rrdF3, DataType_voltage, 0, 0,
+    { SENSORS_AS99127F_VID, -1 } },
+  { fmtChassisIntrusionDetection, NULL, DataType_other, W83781D_ALARM_CHAS, W83781D_ALARM_CHAS,
+    { SENSORS_AS99127F_ALARMS, -1 } },
+  { fmtSoundAlarm, NULL, DataType_other, 0, 0,
+    { SENSORS_AS99127F_BEEP_ENABLE, -1 } },
+  { NULL }
+};
+
+static const ChipDescriptor as99127f_chip = {
+  as99127f_names, as99127f_features, SENSORS_AS99127F_ALARMS, SENSORS_AS99127F_BEEPS
+};
+
+
 /** W83781D **/
 
 static const char *
@@ -599,10 +659,9 @@
 }
 
 static const char *w83781d_names[] = {
-  SENSORS_W83781D_PREFIX, SENSORS_AS99127F_PREFIX, NULL
+  SENSORS_W83781D_PREFIX, NULL
 };
 
-/* TODO: beeps inverted for as99127f */
 static const FeatureDescriptor w83781d_features[] = {
   { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN0, W83781D_ALARM_IN0,
     { SENSORS_W83781D_IN0, SENSORS_W83781D_IN0_MIN, SENSORS_W83781D_IN0_MAX, -1 } },
@@ -626,9 +685,9 @@
     { SENSORS_W83781D_FAN3, SENSORS_W83781D_FAN3_MIN, SENSORS_W83781D_FAN3_DIV, -1 } },
   { fmtTemps_W83781D, rrdF0, DataType_temperature, W83781D_ALARM_TEMP1, W83781D_ALARM_TEMP1,
     { SENSORS_W83781D_TEMP1, SENSORS_W83781D_TEMP1_OVER, SENSORS_W83781D_TEMP1_HYST, -1 } },
-  { fmtTemps_1_0, rrdF1, DataType_temperature, W83781D_ALARM_TEMP2, W83781D_ALARM_TEMP2,
+  { fmtTemps_1_0, rrdF1, DataType_temperature, W83781D_ALARM_TEMP23, W83781D_ALARM_TEMP23,
     { SENSORS_W83781D_TEMP2, SENSORS_W83781D_TEMP2_OVER, SENSORS_W83781D_TEMP2_HYST, -1 } },
-  { fmtTemps_1_0, rrdF1, DataType_temperature, W83781D_ALARM_TEMP3, W83781D_ALARM_TEMP3,
+  { fmtTemps_1_0, rrdF1, DataType_temperature, W83781D_ALARM_TEMP23, W83781D_ALARM_TEMP23,
     { SENSORS_W83781D_TEMP3, SENSORS_W83781D_TEMP3_OVER, SENSORS_W83781D_TEMP3_HYST, -1 } },
   { fmtVolt_3, rrdF3, DataType_voltage, 0, 0,
     { SENSORS_W83781D_VID, -1 } },
@@ -975,6 +1034,7 @@
   &maxilife_chip,
   &sis5595_chip,
   &via686a_chip,
+  &as99127f_chip,
   &w83781d_chip,
   &w83782d_chip,
   &w83783s_chip,
#2 lore raw
In reply to Aurelien Jarno
Quoted 9 lines

Please find attached two patches to fix that, one concerning sensors and the other one concerning sensord.

The patch for sensors is almost the same as the previous one, but now the code would compile!

The patch for sensord looks like a little bit long. That's because the code was shared between w83781d and as99127f chips. With this patch, the two chips are handled separatly

About the sensors patch: fix is correct, but indentation isn't. I'll take care of that though, no need to resend.

About the sensord patch: I don't like it. You do not need to define separate constants for the AS99127F in lib/chips.h. We can do without them. Just use the SENSORS_W83781D defines in the as99127f_features array (much like w83697hf_features uses the SENSORS_W83782D defines).

Care to provide a new patch?

Thanks.

Signature · 2 lines
Jean Delvare
http://khali.linux-fr.org/
#3 lore raw
In reply to Aurelien Jarno
Quoted 2 lines · Jean Delvare

About the sensors patch: fix is correct, but indentation isn't. I'll take care of that though, no need to resend.

Ok, thanks.

Quoted 6 lines

About the sensord patch: I don't like it. You do not need to define separate constants for the AS99127F in lib/chips.h. We can do without them. Just use the SENSORS_W83781D defines in the as99127f_features array (much like w83697hf_features uses the SENSORS_W83782D defines).

Care to provide a new patch?

Yes, I hope the new patch attached is better.

Signature · 86 lines
  .''`.  Aurelien Jarno	              GPG: 1024D/F1BCDB73
 : :' :  Debian GNU/Linux developer | Electrical Engineering Student 
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net
-------------- next part --------------
--- lm_sensors2/prog/sensord/chips.c.orig	21 Mar 2004 10:35:49 -0000	1.11
+++ lm_sensors2/prog/sensord/chips.c	7 May 2004 07:42:00 -0000
@@ -585,6 +585,6 @@ static const ChipDescriptor it87_chip = 
 
-/** W83781D **/
+/** AS99127F **/
 
 static const char *
-fmtTemps_W83781D
+fmtTemps_AS99127F_W83781D
 (const double values[], int alarm, int beep) {
@@ -600,8 +600,7 @@ fmtTemps_W83781D
 
-static const char *w83781d_names[] = {
-  SENSORS_W83781D_PREFIX, SENSORS_AS99127F_PREFIX, NULL
+static const char *as99127f_names[] = {
+  SENSORS_AS99127F_PREFIX, NULL
 };
 
-/* TODO: beeps inverted for as99127f */
-static const FeatureDescriptor w83781d_features[] = {
+static const FeatureDescriptor as99127f_features[] = {
   { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN0, W83781D_ALARM_IN0,
@@ -626,3 +625,3 @@ static const FeatureDescriptor w83781d_f
     { SENSORS_W83781D_FAN3, SENSORS_W83781D_FAN3_MIN, SENSORS_W83781D_FAN3_DIV, -1 } },
-  { fmtTemps_W83781D, rrdF0, DataType_temperature, W83781D_ALARM_TEMP1, W83781D_ALARM_TEMP1,
+  { fmtTemps_AS99127F_W83781D, rrdF0, DataType_temperature, W83781D_ALARM_TEMP1, W83781D_ALARM_TEMP1,
     { SENSORS_W83781D_TEMP1, SENSORS_W83781D_TEMP1_OVER, SENSORS_W83781D_TEMP1_HYST, -1 } },
@@ -641,2 +640,48 @@ static const FeatureDescriptor w83781d_f
 
+static const ChipDescriptor as99127f_chip = {
+  as99127f_names, as99127f_features, SENSORS_W83781D_ALARMS, SENSORS_W83781D_BEEPS
+};
+
+/** W83781D **/
+
+static const char *w83781d_names[] = {
+  SENSORS_W83781D_PREFIX, NULL
+};
+
+static const FeatureDescriptor w83781d_features[] = {
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN0, W83781D_ALARM_IN0,
+    { SENSORS_W83781D_IN0, SENSORS_W83781D_IN0_MIN, SENSORS_W83781D_IN0_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN1, W83781D_ALARM_IN1,
+    { SENSORS_W83781D_IN1, SENSORS_W83781D_IN1_MIN, SENSORS_W83781D_IN1_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN2, W83781D_ALARM_IN2,
+    { SENSORS_W83781D_IN2, SENSORS_W83781D_IN2_MIN, SENSORS_W83781D_IN2_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN3, W83781D_ALARM_IN3,
+    { SENSORS_W83781D_IN3, SENSORS_W83781D_IN3_MIN, SENSORS_W83781D_IN3_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN4, W83781D_ALARM_IN4,
+    { SENSORS_W83781D_IN4, SENSORS_W83781D_IN4_MIN, SENSORS_W83781D_IN4_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN5, W83781D_ALARM_IN5,
+    { SENSORS_W83781D_IN5, SENSORS_W83781D_IN5_MIN, SENSORS_W83781D_IN5_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN6, W83781D_ALARM_IN6,
+    { SENSORS_W83781D_IN6, SENSORS_W83781D_IN6_MIN, SENSORS_W83781D_IN6_MAX, -1 } },
+  { fmtFans_0, rrdF0, DataType_rpm, W83781D_ALARM_FAN1, W83781D_ALARM_FAN1,
+    { SENSORS_W83781D_FAN1, SENSORS_W83781D_FAN1_MIN, SENSORS_W83781D_FAN1_DIV, -1 } },
+  { fmtFans_0, rrdF0, DataType_rpm, W83781D_ALARM_FAN2, W83781D_ALARM_FAN2,
+    { SENSORS_W83781D_FAN2, SENSORS_W83781D_FAN2_MIN, SENSORS_W83781D_FAN2_DIV, -1 } },
+  { fmtFans_0, rrdF0, DataType_rpm, W83781D_ALARM_FAN3, W83781D_ALARM_FAN3,
+    { SENSORS_W83781D_FAN3, SENSORS_W83781D_FAN3_MIN, SENSORS_W83781D_FAN3_DIV, -1 } },
+  { fmtTemps_AS99127F_W83781D, rrdF0, DataType_temperature, W83781D_ALARM_TEMP1, W83781D_ALARM_TEMP1,
+    { SENSORS_W83781D_TEMP1, SENSORS_W83781D_TEMP1_OVER, SENSORS_W83781D_TEMP1_HYST, -1 } },
+  { fmtTemps_1_0, rrdF1, DataType_temperature, W83781D_ALARM_TEMP23, W83781D_ALARM_TEMP23,
+    { SENSORS_W83781D_TEMP2, SENSORS_W83781D_TEMP2_OVER, SENSORS_W83781D_TEMP2_HYST, -1 } },
+  { fmtTemps_1_0, rrdF1, DataType_temperature, W83781D_ALARM_TEMP23, W83781D_ALARM_TEMP23,
+    { SENSORS_W83781D_TEMP3, SENSORS_W83781D_TEMP3_OVER, SENSORS_W83781D_TEMP3_HYST, -1 } },
+  { fmtVolt_3, rrdF3, DataType_voltage, 0, 0,
+    { SENSORS_W83781D_VID, -1 } },
+  { fmtChassisIntrusionDetection, NULL, DataType_other, W83781D_ALARM_CHAS, W83781D_ALARM_CHAS,
+    { SENSORS_W83781D_ALARMS, -1 } },
+  { fmtSoundAlarm, NULL, DataType_other, 0, 0,
+    { SENSORS_W83781D_BEEP_ENABLE, -1 } },
+  { NULL }
+};
+
 static const ChipDescriptor w83781d_chip = {
@@ -977,2 +1022,3 @@ const ChipDescriptor * const knownChips[
   &via686a_chip,
+  &as99127f_chip,
   &w83781d_chip,
#4 lore raw
In reply to Aurelien Jarno
Quoted 1 line

Yes, I hope the new patch attached is better.

Better but still not perfect:

static const char *
-fmtTemps_W83781D
+fmtTemps_AS99127F_W83781D
(const double values[], int alarm, int beep) {

Please don't rename that function. It adds noise to the patch with no benefit. What's more, the AS99127F is admittedly an undocumented clone of the Winbond chips. It doesn't deserve additional attention or credit.

Thanks.

Signature · 2 lines
Jean Delvare
http://khali.linux-fr.org/
#5 lore raw
In reply to Aurelien Jarno
Quoted 8 lines · Jean Delvare

static const char *

(quoted diff) +1 -1
-fmtTemps_W83781D
+fmtTemps_AS99127F_W83781D
 (const double values[], int alarm, int beep) {

Please don't rename that function. It adds noise to the patch with no benefit. What's more, the AS99127F is admittedly an undocumented clone of the Winbond chips. It doesn't deserve additional attention or credit.

Ok, new try. Patch is attached.

Signature · 93 lines
  .''`.  Aurelien Jarno	              GPG: 1024D/F1BCDB73
 : :' :  Debian GNU/Linux developer | Electrical Engineering Student 
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net
-------------- next part --------------
diff -urN lm_sensors2.orig/prog/sensord/chips.c lm_sensors2/prog/sensord/chips.c
--- lm_sensors2.orig/prog/sensord/chips.c	2004-05-08 12:30:47.000000000 +0200
+++ lm_sensors2/prog/sensord/chips.c	2004-05-08 12:36:41.000000000 +0200
@@ -599,10 +599,9 @@
 }
 
 static const char *w83781d_names[] = {
-  SENSORS_W83781D_PREFIX, SENSORS_AS99127F_PREFIX, NULL
+  SENSORS_W83781D_PREFIX, NULL
 };
 
-/* TODO: beeps inverted for as99127f */
 static const FeatureDescriptor w83781d_features[] = {
   { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN0, W83781D_ALARM_IN0,
     { SENSORS_W83781D_IN0, SENSORS_W83781D_IN0_MIN, SENSORS_W83781D_IN0_MAX, -1 } },
@@ -626,9 +625,9 @@
     { SENSORS_W83781D_FAN3, SENSORS_W83781D_FAN3_MIN, SENSORS_W83781D_FAN3_DIV, -1 } },
   { fmtTemps_W83781D, rrdF0, DataType_temperature, W83781D_ALARM_TEMP1, W83781D_ALARM_TEMP1,
     { SENSORS_W83781D_TEMP1, SENSORS_W83781D_TEMP1_OVER, SENSORS_W83781D_TEMP1_HYST, -1 } },
-  { fmtTemps_1_0, rrdF1, DataType_temperature, W83781D_ALARM_TEMP2, W83781D_ALARM_TEMP2,
+  { fmtTemps_1_0, rrdF1, DataType_temperature, W83781D_ALARM_TEMP23, W83781D_ALARM_TEMP23,
     { SENSORS_W83781D_TEMP2, SENSORS_W83781D_TEMP2_OVER, SENSORS_W83781D_TEMP2_HYST, -1 } },
-  { fmtTemps_1_0, rrdF1, DataType_temperature, W83781D_ALARM_TEMP3, W83781D_ALARM_TEMP3,
+  { fmtTemps_1_0, rrdF1, DataType_temperature, W83781D_ALARM_TEMP23, W83781D_ALARM_TEMP23,
     { SENSORS_W83781D_TEMP3, SENSORS_W83781D_TEMP3_OVER, SENSORS_W83781D_TEMP3_HYST, -1 } },
   { fmtVolt_3, rrdF3, DataType_voltage, 0, 0,
     { SENSORS_W83781D_VID, -1 } },
@@ -643,6 +642,52 @@
   w83781d_names, w83781d_features, SENSORS_W83781D_ALARMS, SENSORS_W83781D_BEEPS
 };
 
+/** AS99127F **/
+
+static const char *as99127f_names[] = {
+  SENSORS_AS99127F_PREFIX, NULL
+};
+
+static const FeatureDescriptor as99127f_features[] = {
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN0, W83781D_ALARM_IN0,
+    { SENSORS_W83781D_IN0, SENSORS_W83781D_IN0_MIN, SENSORS_W83781D_IN0_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN1, W83781D_ALARM_IN1,
+    { SENSORS_W83781D_IN1, SENSORS_W83781D_IN1_MIN, SENSORS_W83781D_IN1_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN2, W83781D_ALARM_IN2,
+    { SENSORS_W83781D_IN2, SENSORS_W83781D_IN2_MIN, SENSORS_W83781D_IN2_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN3, W83781D_ALARM_IN3,
+    { SENSORS_W83781D_IN3, SENSORS_W83781D_IN3_MIN, SENSORS_W83781D_IN3_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN4, W83781D_ALARM_IN4,
+    { SENSORS_W83781D_IN4, SENSORS_W83781D_IN4_MIN, SENSORS_W83781D_IN4_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN5, W83781D_ALARM_IN5,
+    { SENSORS_W83781D_IN5, SENSORS_W83781D_IN5_MIN, SENSORS_W83781D_IN5_MAX, -1 } },
+  { fmtVolts_2, rrdF2, DataType_voltage, W83781D_ALARM_IN6, W83781D_ALARM_IN6,
+    { SENSORS_W83781D_IN6, SENSORS_W83781D_IN6_MIN, SENSORS_W83781D_IN6_MAX, -1 } },
+  { fmtFans_0, rrdF0, DataType_rpm, W83781D_ALARM_FAN1, W83781D_ALARM_FAN1,
+    { SENSORS_W83781D_FAN1, SENSORS_W83781D_FAN1_MIN, SENSORS_W83781D_FAN1_DIV, -1 } },
+  { fmtFans_0, rrdF0, DataType_rpm, W83781D_ALARM_FAN2, W83781D_ALARM_FAN2,
+    { SENSORS_W83781D_FAN2, SENSORS_W83781D_FAN2_MIN, SENSORS_W83781D_FAN2_DIV, -1 } },
+  { fmtFans_0, rrdF0, DataType_rpm, W83781D_ALARM_FAN3, W83781D_ALARM_FAN3,
+    { SENSORS_W83781D_FAN3, SENSORS_W83781D_FAN3_MIN, SENSORS_W83781D_FAN3_DIV, -1 } },
+  { fmtTemps_W83781D, rrdF0, DataType_temperature, W83781D_ALARM_TEMP1, W83781D_ALARM_TEMP1,
+    { SENSORS_W83781D_TEMP1, SENSORS_W83781D_TEMP1_OVER, SENSORS_W83781D_TEMP1_HYST, -1 } },
+  { fmtTemps_1_0, rrdF1, DataType_temperature, W83781D_ALARM_TEMP2, W83781D_ALARM_TEMP2,
+    { SENSORS_W83781D_TEMP2, SENSORS_W83781D_TEMP2_OVER, SENSORS_W83781D_TEMP2_HYST, -1 } },
+  { fmtTemps_1_0, rrdF1, DataType_temperature, W83781D_ALARM_TEMP3, W83781D_ALARM_TEMP3,
+    { SENSORS_W83781D_TEMP3, SENSORS_W83781D_TEMP3_OVER, SENSORS_W83781D_TEMP3_HYST, -1 } },
+  { fmtVolt_3, rrdF3, DataType_voltage, 0, 0,
+    { SENSORS_W83781D_VID, -1 } },
+  { fmtChassisIntrusionDetection, NULL, DataType_other, W83781D_ALARM_CHAS, W83781D_ALARM_CHAS,
+    { SENSORS_W83781D_ALARMS, -1 } },
+  { fmtSoundAlarm, NULL, DataType_other, 0, 0,
+    { SENSORS_W83781D_BEEP_ENABLE, -1 } },
+  { NULL }
+};
+
+static const ChipDescriptor as99127f_chip = {
+  as99127f_names, as99127f_features, SENSORS_W83781D_ALARMS, SENSORS_W83781D_BEEPS
+};
+
 /** W83782D **/
 
 static const char *
@@ -975,6 +1020,7 @@
   &maxilife_chip,
   &sis5595_chip,
   &via686a_chip,
+  &as99127f_chip,
   &w83781d_chip,
   &w83782d_chip,
   &w83783s_chip,