Skip to contentSkip to conversation

fscpos upgrade for sensor library

PATCH New Stefan Ott 2 participants 7 messages May 19, 2005 Library code

lore
Share & tools
lore

Stefan Ott

author
#0 lore raw

PATCH 1/1 fscpos upgrade for sensor library

Hi

The following patch changes lm_sensors in order to work properly with the new fscpos driver.

Regards
Stefan

etc/sensors.conf.eg +6 -6
diff -Nru lm_sensors-2.9.0-orig/etc/sensors.conf.eg lm-sensors-2.9.0/etc/sensors.conf.eg
@@ -1587,15 +1587,15 @@
 
 # Fans
 
-    label  fan1       "Fan1"
-    ignore  fan2
-    ignore  fan3
+    label fan1        "Fan1"
+    label fan2        "Fan2"
+    label fan3        "Fan3"
 
 # Voltage
 
-    label volt12      "+12V"
-    label volt5       "+5V"
-    label voltbatt    "+3.3V"
+    label in0_input   "+12V"
+    label in1_input   "+5V"
+    label in2_input   "Battery"
 
 
 chip "fscscy-*"
lib/chips.c +5 -9
diff -Nru lm_sensors-2.9.0-orig/lib/chips.c lm-sensors-2.9.0/lib/chips.c
@@ -4010,17 +4010,13 @@
 
 static sensors_chip_feature fscpos_features[]    {
-    { SENSORS_FSCPOS_REV, "rev", NOMAP, NOMAP,
-                        R, FSCPOS_SYSCTL_REV, VALUE(1), 0 },
     { SENSORS_FSCPOS_EVENT, "event", NOMAP, NOMAP,
                         R, FSCPOS_SYSCTL_EVENT, VALUE(1), 0 },
-    { SENSORS_FSCPOS_CONTROL, "control", NOMAP, NOMAP,
-                        RW, FSCPOS_SYSCTL_CONTROL, VALUE(1), 0 },
-    { SENSORS_FSCPOS_VOLTAGE1, "volt12", NOMAP, NOMAP,
+    { SENSORS_FSCPOS_VOLTAGE1, "in0_input", NOMAP, NOMAP,
                         R, FSCPOS_SYSCTL_VOLT0, VALUE(1), 2 },
-    { SENSORS_FSCPOS_VOLTAGE2, "volt5", NOMAP, NOMAP,
+    { SENSORS_FSCPOS_VOLTAGE2, "in1_input", NOMAP, NOMAP,
                         R, FSCPOS_SYSCTL_VOLT1, VALUE(1), 2 },
-    { SENSORS_FSCPOS_VOLTAGE3, "voltbatt", NOMAP,
+    { SENSORS_FSCPOS_VOLTAGE3, "in2_input", NOMAP,
 			NOMAP, R, 
 			FSCPOS_SYSCTL_VOLT2, VALUE(1), 2 },
     { SENSORS_FSCPOS_TEMP1, "temp1", NOMAP, NOMAP,
@@ -4044,10 +4040,10 @@
                         R, FSCPOS_SYSCTL_FAN1, VALUE(4), 0 },
     { SENSORS_FSCPOS_FAN3, "fan3", NOMAP, NOMAP,
                         R, FSCPOS_SYSCTL_FAN2, VALUE(4), 0 },
-    { SENSORS_FSCPOS_FAN1_MIN, "fan1_min", SENSORS_FSCPOS_FAN1, 
+    { SENSORS_FSCPOS_PWM2, "pwm1", SENSORS_FSCPOS_FAN1, 
 			SENSORS_FSCPOS_FAN1, RW, 
 			FSCPOS_SYSCTL_FAN0, VALUE(2), 0 },
-    { SENSORS_FSCPOS_FAN2_MIN, "fan2_min", SENSORS_FSCPOS_FAN2, 
+    { SENSORS_FSCPOS_PWM2, "pwm2", SENSORS_FSCPOS_FAN2, 
 			SENSORS_FSCPOS_FAN2, RW, 
 			FSCPOS_SYSCTL_FAN1, VALUE(2), 0 },
     { SENSORS_FSCPOS_FAN1_STATE, "fan1_state", SENSORS_FSCPOS_FAN1, 
lib/chips.h +2 -5
diff -Nru lm_sensors-2.9.0-orig/lib/chips.h lm-sensors-2.9.0/lib/chips.h
@@ -1475,15 +1475,12 @@
 
 #define SENSORS_FSCPOS_PREFIX "fscpos"
 
-#define SENSORS_FSCPOS_REV 1 /* R */
 #define SENSORS_FSCPOS_EVENT 2 /* R */
-#define SENSORS_FSCPOS_CONTROL 3 /* RW */
 #define SENSORS_FSCPOS_FAN1 4 /* R */
 #define SENSORS_FSCPOS_FAN2 5 /* R */
 #define SENSORS_FSCPOS_FAN3 6 /* R */
-#define SENSORS_FSCPOS_FAN1_MIN 7 /* RW */
-#define SENSORS_FSCPOS_FAN2_MIN 8 /* RW */
-#define SENSORS_FSCPOS_FAN3_MIN 9 /* RW */
+#define SENSORS_FSCPOS_PWM1 7 /* RW */
+#define SENSORS_FSCPOS_PWM2 8 /* RW */
 #define SENSORS_FSCPOS_FAN1_STATE 10 /* RW */
 #define SENSORS_FSCPOS_FAN2_STATE 11 /* RW */
 #define SENSORS_FSCPOS_FAN3_STATE 12 /* RW */
#1 lore raw

PATCH 1/1 fscpos upgrade for sensor library

Hi Stefan,

Quoted 6 lines

The following patch changes lm_sensors in order to work properly with the new fscpos driver.
(...)

etc/sensors.conf.eg line 1592

Quoted 9 lines
etc/sensors.conf.eg +3 -3
@@ -1587,15 +1587,15 @@
 
 # Fans
 
-    label  fan1       "Fan1"
-    ignore  fan2
-    ignore  fan3
+    label fan1        "Fan1"
+    label fan2        "Fan2"
+    label fan3        "Fan3"

Sounds sane.

etc/sensors.conf.eg line 1598

Quoted 8 lines
etc/sensors.conf.eg +3 -3
 # Voltage
 
-    label volt12      "+12V"
-    label volt5       "+5V"
-    label voltbatt    "+3.3V"
+    label in0_input   "+12V"
+    label in1_input   "+5V"
+    label in2_input   "Battery"

Not correct. libsensors refers to the 2.4 names, which we would try not to change so as to preserve compatibility wherever possible. These lines should not be changed. See below.

lib/chips.c line 4017

Quoted 12 lines

diff -Nru lm_sensors-2.9.0-orig/lib/chips.c lm-sensors-2.9.0/lib/chips.c

lib/chips.c +0 -4
@@ -4010,17 +4010,13 @@
 
 static sensors_chip_feature fscpos_features[] >   {
-    { SENSORS_FSCPOS_REV, "rev", NOMAP, NOMAP,
-                        R, FSCPOS_SYSCTL_REV, VALUE(1), 0 },
    { SENSORS_FSCPOS_EVENT, "event", NOMAP, NOMAP,
                        R, FSCPOS_SYSCTL_EVENT, VALUE(1), 0 },
-    { SENSORS_FSCPOS_CONTROL, "control", NOMAP, NOMAP,
-                        RW, FSCPOS_SYSCTL_CONTROL, VALUE(1), 0 },

Fine with me. The "sensors" program wouldn't even use them anyway.

lib/chips.c line 4020

Quoted 10 lines
lib/chips.c +3 -3
-    { SENSORS_FSCPOS_VOLTAGE1, "volt12", NOMAP, NOMAP,
+    { SENSORS_FSCPOS_VOLTAGE1, "in0_input", NOMAP, NOMAP,
                        R, FSCPOS_SYSCTL_VOLT0, VALUE(1), 2 },
-    { SENSORS_FSCPOS_VOLTAGE2, "volt5", NOMAP, NOMAP,
+    { SENSORS_FSCPOS_VOLTAGE2, "in1_input", NOMAP, NOMAP,
                        R, FSCPOS_SYSCTL_VOLT1, VALUE(1), 2 },
-    { SENSORS_FSCPOS_VOLTAGE3, "voltbatt", NOMAP,
+    { SENSORS_FSCPOS_VOLTAGE3, "in2_input", NOMAP,
 			NOMAP, R,
 			FSCPOS_SYSCTL_VOLT2, VALUE(1), 2 },

Not correct. Don't change the symbol names. Instead, add an alternative name for 2.6. For volt12, it would look like:

    { SENSORS_FSCPOS_VOLTAGE1, "volt12", NOMAP, NOMAP,
                        R, FSCPOS_SYSCTL_VOLT0, VALUE(1), 2,
                        "in0_input", 3 },

I.e. basically you just have to append the symbol name and magnitude for the 2.6 driver right after the other values. That way we preserve compatibility with the 2.4 driver.

Quoted 8 lines
lib/chips.c +1 -1
-    { SENSORS_FSCPOS_FAN1_MIN, "fan1_min", SENSORS_FSCPOS_FAN1,
+    { SENSORS_FSCPOS_PWM2, "pwm1", SENSORS_FSCPOS_FAN1,
 			SENSORS_FSCPOS_FAN1, RW,
			FSCPOS_SYSCTL_FAN0, VALUE(2), 0 },
lib/chips.c +1 -1
-    { SENSORS_FSCPOS_FAN2_MIN, "fan2_min", SENSORS_FSCPOS_FAN2,
+    { SENSORS_FSCPOS_PWM2, "pwm2", SENSORS_FSCPOS_FAN2,
			SENSORS_FSCPOS_FAN2, RW,
			FSCPOS_SYSCTL_FAN1, VALUE(2), 0 },

Likewise, I would rather add the 2.6 names than change existing ones so as to preserve compatibility. Unless you also plan to modify the 2.4 driver to extract the fan_min values from fanN files and have separate pwm files instead, like it should probably have been done in the first place. That said, since you said you don't exactly get how fan mins work with this chip, it might be wiser not to change this (for now at least).

Thanks,
--
Jean Delvare

author
#2 lore raw

PATCH 1/1 fscpos upgrade for sensor library

In reply to Stefan Ott

Hi

Okay, I misunderstood that one. Here's the patch which just adds the new features and leaves the old ones alone :)

etc/sensors.conf.eg +7 -4
diff -Nru lm-sensors-2.9.0-orig/etc/sensors.conf.eg lm-sensors-2.9.0/etc/sensors.conf.eg
@@ -1583,19 +1583,22 @@
 
     label temp1       "Temp1/CPU"
     label temp2       "Temp2/MB"
-    label temp3       "Temp2/AUX"
+    label temp3       "Temp3/AUX"
 
 # Fans
 
-    label  fan1       "Fan1"
-    ignore  fan2
-    ignore  fan3
+    label fan1        "Fan1"
+    label fan2        "Fan2"
+    label fan3        "Fan3"
 
 # Voltage
 
     label volt12      "+12V"
     label volt5       "+5V"
     label voltbatt    "+3.3V"
+    label in0_input   "+12V"
+    label in1_input   "+5V"
+    label in2_input   "Battery"
 
 
 chip "fscscy-*"
lib/chips.c +6 -7
diff -Nru lm-sensors-2.9.0-orig/lib/chips.c lm-sensors-2.9.0/lib/chips.c
@@ -4017,12 +4017,11 @@
     { SENSORS_FSCPOS_CONTROL, "control", NOMAP, NOMAP,
                         RW, FSCPOS_SYSCTL_CONTROL, VALUE(1), 0 },
     { SENSORS_FSCPOS_VOLTAGE1, "volt12", NOMAP, NOMAP,
-                        R, FSCPOS_SYSCTL_VOLT0, VALUE(1), 2 },
+                        R, FSCPOS_SYSCTL_VOLT0, VALUE(1), 2, "in0_input", 3 },
     { SENSORS_FSCPOS_VOLTAGE2, "volt5", NOMAP, NOMAP,
-                        R, FSCPOS_SYSCTL_VOLT1, VALUE(1), 2 },
-    { SENSORS_FSCPOS_VOLTAGE3, "voltbatt", NOMAP,
-			NOMAP, R, 
-			FSCPOS_SYSCTL_VOLT2, VALUE(1), 2 },
+                        R, FSCPOS_SYSCTL_VOLT1, VALUE(1), 2, "in1_input", 3 },
+    { SENSORS_FSCPOS_VOLTAGE3, "voltbatt", NOMAP, NOMAP,
+			R, FSCPOS_SYSCTL_VOLT2, VALUE(1), 2, "in2_input", 3 },
     { SENSORS_FSCPOS_TEMP1, "temp1", NOMAP, NOMAP,
                         R, FSCPOS_SYSCTL_TEMP0, VALUE(2), 0 },
     { SENSORS_FSCPOS_TEMP2, "temp2", NOMAP, NOMAP,
@@ -4046,10 +4045,10 @@
                         R, FSCPOS_SYSCTL_FAN2, VALUE(4), 0 },
     { SENSORS_FSCPOS_FAN1_MIN, "fan1_min", SENSORS_FSCPOS_FAN1, 
 			SENSORS_FSCPOS_FAN1, RW, 
-			FSCPOS_SYSCTL_FAN0, VALUE(2), 0 },
+			FSCPOS_SYSCTL_FAN0, VALUE(2), 0, "pwm1", 0 },
     { SENSORS_FSCPOS_FAN2_MIN, "fan2_min", SENSORS_FSCPOS_FAN2, 
 			SENSORS_FSCPOS_FAN2, RW, 
-			FSCPOS_SYSCTL_FAN1, VALUE(2), 0 },
+			FSCPOS_SYSCTL_FAN1, VALUE(2), 0, "pwm2", 0 },
     { SENSORS_FSCPOS_FAN1_STATE, "fan1_state", SENSORS_FSCPOS_FAN1, 
 			SENSORS_FSCPOS_FAN1, RW, 
 			FSCPOS_SYSCTL_FAN0, VALUE(1), 0 },
lib/chips.h +2 -0
diff -Nru lm-sensors-2.9.0-orig/lib/chips.h lm-sensors-2.9.0/lib/chips.h
@@ -1502,6 +1502,8 @@
 #define SENSORS_FSCPOS_WDOG_PRESET 25/* RW */
 #define SENSORS_FSCPOS_WDOG_STATE 26/* RW */
 #define SENSORS_FSCPOS_WDOG_CONTROL 27/* RW */
+#define SENSORS_FSCPOS_PWM1 28/* RW */
+#define SENSORS_FSCPOS_PWM2 29/* RW */
 
 /* fsc scylla chip */
 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050120/77fd18e7/attachment.bin

Applied
#3 lore raw

PATCH 1/1 fscpos upgrade for sensor library

In reply to Stefan Ott
Quoted 2 lines

Okay, I misunderstood that one. Here's the patch which just adds the new features and leaves the old ones alone :)

Thanks, applied with the following changes:

1* No labels for inN_input in sensors.conf. Libsensors is based on the
2.4 symbol names only.

2* No changed to lib/chips.h. Why define new constants when you don't
use them anywhere? ;)

Signature · 2 lines
Jean Delvare
http://khali.linux-fr.org/
author
#4 lore raw

PATCH 1/1 fscpos upgrade for sensor library

In reply to Stefan Ott
Quoted 4 lines · Jean Delvare

Thanks, applied with the following changes:

1* No labels for inN_input in sensors.conf. Libsensors is based on the
2.4 symbol names only.

Okay, makes sense. How how about renaming "+3.3V" to "Battery" though?

Quoted 2 lines

2* No changed to lib/chips.h. Why define new constants when you don't
use them anywhere? ;)

Indeed.

Regards
Stefan

Signature · 12 lines
Stefan Ott
http://www.desire.ch

"Give a man a fire and he's warm for a day, but set fire to him and he's
warm for the rest of his life."  -- Terry Pratchett, Jingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050120/3a46af9a/attachment.bin
author
#5 lore raw

PATCH 1/1 fscpos upgrade for sensor library

In reply to Stefan Ott
Quoted 3 lines · Jean Delvare
Quoted 1 line

Okay, makes sense. How how about renaming "+3.3V" to "Battery" though?

Ah ah ah AH AH (demonic laugh). And what do you think I did? ;)

Heh, okay :)

Signature · 12 lines
Stefan Ott
http://www.desire.ch

"Give a man a fire and he's warm for a day, but set fire to him and he's
warm for the rest of his life."  -- Terry Pratchett, Jingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050120/6eeed6b4/attachment.bin
#6 lore raw

PATCH 1/1 fscpos upgrade for sensor library

In reply to Stefan Ott
Quoted 4 lines
Quoted 2 lines

1* No labels for inN_input in sensors.conf. Libsensors is based on the 2.4 symbol names only.

Okay, makes sense. How how about renaming "+3.3V" to "Battery" though?

Ah ah ah AH AH (demonic laugh). And what do you think I did? ;)

Signature · 2 lines
Jean Delvare
http://khali.linux-fr.org/