All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] Help needed for implementing&testing Fintek F75375
@ 2007-06-12 17:29 Christian Emmerich
  2007-06-14 19:39 ` Jean Delvare
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: Christian Emmerich @ 2007-06-12 17:29 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 1289 bytes --]

Hello

First of all, thanks to all for developing such a useful tool.

Now to my problem, I'm using an AOpen XC Cube (ex18), sensors-detect shows that a have to use the module f75375s, i install it using the driver developed by Riku Voipio, posted may 22. 
Using w83627hf don't show any fan-speed or temperature, voltage seems to be ok.

I try to integrate the driver in lm-sensors, but now i'm confused how to get lm-sensors (svn- version) working with this chip. Could someone give me a hint. Maybe somone else is testing it too and could send me his version of lm-sensors or could publish his configuration/files.

It would also be helpfull if somone only gives an example of an driver which is similar to f75375s.

Is it correct that i have to update lib/chips.c, lib/chips.h and prog/sensors/chip.h, prog/sensors/chip.c and prog/sensors/main.c? What functions are needed and so on.

The module is recognized by 'sensors-detect' but i'm not able to get an output running 'sensors', because the needed functions, structs and defines are mostly not correct.

many thanks
christian.
 
 __________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com 

[-- Attachment #1.2: Type: text/html, Size: 1336 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [lm-sensors] Help needed for implementing&testing Fintek F75375
  2007-06-12 17:29 [lm-sensors] Help needed for implementing&testing Fintek F75375 Christian Emmerich
@ 2007-06-14 19:39 ` Jean Delvare
  2007-06-15  6:53 ` Christian Emmerich
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Jean Delvare @ 2007-06-14 19:39 UTC (permalink / raw)
  To: lm-sensors

Hi Chistian,

On Tue, 12 Jun 2007 19:29:42 +0200 (CEST), Christian Emmerich wrote:
> Now to my problem, I'm using an AOpen XC Cube (ex18), sensors-detect
> shows that a have to use the module f75375s, i install it using the
> driver developed by Riku Voipio, posted may 22. 
> Using w83627hf don't show any fan-speed or temperature, voltage seems
> to be ok.
> 
> I try to integrate the driver in lm-sensors, but now i'm confused how
> to get lm-sensors (svn- version) working with this chip. Could someone
> give me a hint. Maybe somone else is testing it too and could send me
> his version of lm-sensors or could publish his configuration/files.
> 
> It would also be helpfull if somone only gives an example of an driver
> which is similar to f75375s.
> 
> Is it correct that i have to update lib/chips.c, lib/chips.h and
> prog/sensors/chip.h, prog/sensors/chip.c and prog/sensors/main.c? What
> functions are needed and so on.

Yes, this is correct.

> The module is recognized by 'sensors-detect' but i'm not able to get
> an output running 'sensors', because the needed functions, structs and
> defines are mostly not correct.

I suggest that you take a look at a patch doing the same for another
driver:

http://www.lm-sensors.org/changeset/4355

This patch was adding user-space support for the dme1737 driver. You
need to do something very similar, except for sensors-detect which you
probably don't need to change.

If you have specific questions on the way, feel free to ask, but all in
all, copy and paste and a bit of trial and error should work fine.

Please submit your patch when you're done, so that we can apply it and
everybody benefits.

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [lm-sensors] Help needed for implementing&testing Fintek F75375
  2007-06-12 17:29 [lm-sensors] Help needed for implementing&testing Fintek F75375 Christian Emmerich
  2007-06-14 19:39 ` Jean Delvare
@ 2007-06-15  6:53 ` Christian Emmerich
  2007-06-17 14:14 ` Christian Emmerich
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Christian Emmerich @ 2007-06-15  6:53 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 1221 bytes --]


Hello Jean,

> > The module is recognized by 'sensors-detect' but i'm not able to get
> > an output running 'sensors', because the needed functions, structs and
> > defines are mostly not correct.

> I suggest that you take a look at a patch doing the same for another driver:

> http://www.lm-sensors.org/changeset/4355

> This patch was adding user-space support for the dme1737 driver. You 
> need to do something very similar, except for sensors-detect which you
> probably don't need to change.

> If you have specific questions on the way, feel free to ask, but all in
> all, copy and paste and a bit of trial and error should work fine.

> Please submit your patch when you're done, so that we can apply it and
> everybody benefits.

> -- 
> Jean Delvare

Thank you for your answer. I take a look at the changeset for 
the dme1737 driver, it seems that this is the example i was looking for.

I will try to start 'copying and pasting' this afternoon, 
if it work i will submit it.

christian.


 __________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com 

[-- Attachment #1.2: Type: text/html, Size: 2329 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [lm-sensors] Help needed for implementing&testing Fintek F75375
  2007-06-12 17:29 [lm-sensors] Help needed for implementing&testing Fintek F75375 Christian Emmerich
  2007-06-14 19:39 ` Jean Delvare
  2007-06-15  6:53 ` Christian Emmerich
@ 2007-06-17 14:14 ` Christian Emmerich
  2007-06-18  8:18 ` Jean Delvare
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Christian Emmerich @ 2007-06-17 14:14 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 458 bytes --]


Hi

I have tried to commit the changes i made for 
Fintek F75373S support, but it failed. 
( bash shows:
root@pc:/usr/src# svn commit command
Anmeldebereich: <http://lm-sensors.org:80> lm-sensors/i2c
Passwort fuer 'root':
and so on )
Is a Username/Password required for a svn commit 
/ who can create a login for me?

christian.

 		
---------------------------------
Was Sie schon immer wissen wollten aber nie zu Fragen trauten? Yahoo! Clever hilft Ihnen.

[-- Attachment #1.2: Type: text/html, Size: 603 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [lm-sensors] Help needed for implementing&testing Fintek F75375
  2007-06-12 17:29 [lm-sensors] Help needed for implementing&testing Fintek F75375 Christian Emmerich
                   ` (2 preceding siblings ...)
  2007-06-17 14:14 ` Christian Emmerich
@ 2007-06-18  8:18 ` Jean Delvare
  2007-06-18 13:01 ` Christian Emmerich
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Jean Delvare @ 2007-06-18  8:18 UTC (permalink / raw)
  To: lm-sensors

Hi Christian,

On Sun, 17 Jun 2007 16:14:55 +0200 (CEST), Christian Emmerich wrote:
> I have tried to commit the changes i made for 
> Fintek F75373S support, but it failed. 
> ( bash shows:
> root@pc:/usr/src# svn commit command
> Anmeldebereich: <http://lm-sensors.org:80> lm-sensors/i2c
> Passwort fuer 'root':
> and so on )
> Is a Username/Password required for a svn commit 

Of course. Have you ever seen one open source project where anonymous
CVS/SVN writes are allowed?

> / who can create a login for me?

This isn't how things work, sorry. Please submit your patch to this
mailing list and we'll review it first, then we'll apply it for you
when it's ready.

Only if you become a regular contributor to the lm-sensors project,
we'll take the time to create an account for you.

Thanks,
-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [lm-sensors] Help needed for implementing&testing Fintek F75375
  2007-06-12 17:29 [lm-sensors] Help needed for implementing&testing Fintek F75375 Christian Emmerich
                   ` (3 preceding siblings ...)
  2007-06-18  8:18 ` Jean Delvare
@ 2007-06-18 13:01 ` Christian Emmerich
  2007-06-18 16:58 ` Christian Emmerich
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Christian Emmerich @ 2007-06-18 13:01 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 790 bytes --]


Hi Jean 

> Of course. Have you ever seen one open source project where 
> anonymous CVS/SVN writes are allowed?

It's my first patch for an open source project, at work 
i have a login and at home it is not neccessary, 
so i was a little bit confused. 

> This isn't how things work, sorry. Please submit your patch to this
> mailing list and we'll review it first, then we'll apply it for you
> when it's ready.

OK, later at home i will use diff to create a patch-file 
with all changes and send this attached to my mail to 
the mailing-list.

Thanks for your help,
christian.


 __________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. 
http://mail.yahoo.com 

[-- Attachment #1.2: Type: text/html, Size: 861 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [lm-sensors] Help needed for implementing&testing Fintek F75375
  2007-06-12 17:29 [lm-sensors] Help needed for implementing&testing Fintek F75375 Christian Emmerich
                   ` (4 preceding siblings ...)
  2007-06-18 13:01 ` Christian Emmerich
@ 2007-06-18 16:58 ` Christian Emmerich
  2007-06-23 12:29 ` Jean Delvare
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Christian Emmerich @ 2007-06-18 16:58 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 1038 bytes --]

Hi

I've attached a patch for Fintek F75373S support, 
kernel module f75375s is required.

At the moment it is possible to read out 4 different voltage 
values, 2 temperatures and 2 fans/pwm (i've only one fan 
connected, so i could only verify that one of two is working
correct).
I was not able to adjust fan speed using fancontrol, 
i have to do it by hand.

sensors output looks like:
mythtv@pc:~$ sensors F75373-*
F75373-i2c-1-2d
Adapter: SMBus nForce2 adapter at 5100
VCC:       +1.72 V  (min =  +0.00 V, max =  +0.00 V)  
V1:        +1.34 V  (min =  +0.00 V, max =  +0.00 V)  
V2:        +1.01 V  (min =  +0.00 V, max =  +0.00 V)  
V3:        +0.77 V  (min =  +0.00 V, max =  +0.00 V)  
CPU Temp:    +50°C  (high =    +0°C, hyst =    +0°C)  
Sys Temp:    +47°C  (high =    +0°C, hyst =    +0°C)  
CPU Fan:  1866 RPM  (min =    0 RPM)
CPU PWM:    31      (enable = 1)

christian.
 
 		
---------------------------------
Yahoo! Messenger -  kostenlos* mit Familie und Freunden von PC zu PC telefonieren. 

[-- Attachment #1.2: Type: text/html, Size: 1158 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 4088216775-fintek_75373s_support.patch --]
[-- Type: text/x-patch; name="fintek_75373s_support.patch", Size: 9412 bytes --]

diff -urN lm-sensors_org/etc/sensors.conf.eg lm-sensors/etc/sensors.conf.eg
--- lm-sensors_org/etc/sensors.conf.eg	2007-06-17 15:34:35.000000000 +0200
+++ lm-sensors/etc/sensors.conf.eg	2007-06-17 16:54:34.000000000 +0200
@@ -2880,3 +2880,36 @@
 #   set fan4_min 1000
 #   set fan5_min 1000
 #   set fan6_min 1000
+
+
+#
+# Sample configuration for the Fintek F75373
+#
+chip "f75373-*"
+
+# Voltages
+   label in0_input "VCC"
+   label in1_input "V1"
+   label in2_input "V2"
+   label in3_input "V3"
+
+   compute in0_input  @/1000,@/1000
+   compute in1_input  @/1000,@/1000
+   compute in2_input  @/1000,@/1000
+   compute in3_input  @/1000,@/1000
+
+# Fans
+   label fan1 "CPU Fan"
+   label fan2 "Sys Fan"
+
+   compute fan1  ( 1.5 * 1000000 )/@,  ( 1.5 * 1000000 )/@
+   compute fan2  ( 1.5 * 1000000 )/@,  ( 1.5 * 1000000 )/@
+
+# Temperatures
+   label temp1 "CPU Temp"
+   label temp2 "Sys Temp"
+   
+# PWM
+   label pwm1   "CPU PWM"
+   label pwm2   "Sys PWM"
+
diff -urN lm-sensors_org/lib/chips.c lm-sensors/lib/chips.c
--- lm-sensors_org/lib/chips.c	2007-06-17 15:34:32.000000000 +0200
+++ lm-sensors/lib/chips.c	2007-06-17 15:57:49.000000000 +0200
@@ -6108,6 +6108,64 @@
     { { 0 }, 0 }
   };
 
+
+
+#define SENSORS_F75373_IN_FEATURES(nr) \
+        { { SENSORS_F75373_IN(nr), "in" #nr "_input", \
+                NOMAP, NOMAP, R }, \
+                NOSYSCTL, VALUE(3), 3 }, \
+        { { SENSORS_F75373_IN_MIN(nr), "in" #nr "_min", \
+                SENSORS_F75373_IN(nr), SENSORS_F75373_IN(nr), RW }, \
+                NOSYSCTL, VALUE(2), 3 }, \
+        { { SENSORS_F75373_IN_MAX(nr), "in" #nr "_max", \
+                SENSORS_F75373_IN(nr), SENSORS_F75373_IN(nr), RW }, \
+                NOSYSCTL, VALUE(2), 3 }
+
+#define SENSORS_F75373_TEMP_FEATURES(nr) \
+        { { SENSORS_F75373_TEMP(nr), "temp" #nr "", \
+                NOMAP, NOMAP, R }, \
+                NOSYSCTL, VALUE(3), 3 }, \
+        { { SENSORS_F75373_TEMP_MAX(nr), "temp" #nr "_max", \
+                SENSORS_F75373_TEMP(nr), SENSORS_F75373_TEMP(nr), RW }, \
+                NOSYSCTL, VALUE(1), 3 }, \
+        { { SENSORS_F75373_TEMP_HYST(nr), "temp" #nr "_hyst", \
+                SENSORS_F75373_TEMP(nr), NOMAP, R }, \
+                NOSYSCTL, VALUE(1), 0 }
+
+#define SENSORS_F75373_FAN_FEATURES(nr) \
+        { { SENSORS_F75373_FAN(nr), "fan" #nr, \
+                NOMAP, NOMAP, R }, \
+                NOSYSCTL, VALUE(2), 0 }, \
+        { { SENSORS_F75373_FAN_MAX(nr), "fan" #nr "_max", \
+                SENSORS_F75373_FAN(nr), SENSORS_F75373_FAN(nr), RW }, \
+                NOSYSCTL, VALUE(1), 0 }, \
+        { { SENSORS_F75373_FAN_MIN(nr), "fan" #nr "_min", \
+                SENSORS_F75373_FAN(nr), NOMAP, R }, \
+                NOSYSCTL, VALUE(1), 0 }
+
+#define SENSORS_F75373_PWM_FEATURES(nr) \
+        { { SENSORS_F75373_PWM(nr), "pwm" #nr, \
+                NOMAP, NOMAP, RW }, \
+                NOSYSCTL, VALUE(1), 0 }, \
+        { { SENSORS_F75373_PWM_ENABLE(nr), "pwm" #nr "_enable", \
+                SENSORS_F75373_PWM(nr), SENSORS_F75373_PWM(nr), RW }, \
+                NOSYSCTL, VALUE(3), 0 }
+
+static sensors_chip_feature f75373_features[] =
+{
+        SENSORS_F75373_IN_FEATURES(0),
+        SENSORS_F75373_IN_FEATURES(1),
+        SENSORS_F75373_IN_FEATURES(2),
+        SENSORS_F75373_IN_FEATURES(3),
+        SENSORS_F75373_TEMP_FEATURES(1),
+        SENSORS_F75373_TEMP_FEATURES(2),
+        SENSORS_F75373_FAN_FEATURES(1),
+        SENSORS_F75373_FAN_FEATURES(2),
+        SENSORS_F75373_PWM_FEATURES(1),
+        SENSORS_F75373_PWM_FEATURES(2),
+        { { 0 }, 0 }
+};
+
 sensors_chip_features sensors_chip_features_list[] =
 {
  { SENSORS_LM78_PREFIX, lm78_features },
@@ -6223,5 +6281,6 @@
  { SENSORS_CORETEMP_PREFIX, coretemp_features },
  { SENSORS_DME1737_PREFIX, dme1737_features },
  { SENSORS_APPLESMC_PREFIX, applesmc_features },
+ { SENSORS_F75373_PREFIX, f75373_features },
  { 0 }
 };
diff -urN lm-sensors_org/lib/chips.h lm-sensors/lib/chips.h
--- lm-sensors_org/lib/chips.h	2007-06-17 15:34:32.000000000 +0200
+++ lm-sensors/lib/chips.h	2007-06-17 16:53:25.000000000 +0200
@@ -2312,4 +2312,28 @@
 #define SENSORS_APPLESMC_FAN_MAX(n)		(0x61 + (n)) /* R */
 #define SENSORS_APPLESMC_FAN_SAFE(n)		(0x81 + (n)) /* R */
 
+/* Fintek F75373 registers  */
+
+#define SENSORS_F75373_PREFIX "f75373"
+
+// voltage n from 0 to 3
+#define SENSORS_F75373_IN(nr)           (0x10 + (nr))
+#define SENSORS_F75373_IN_MAX(nr)       (0x20 + (nr) * 2 )
+#define SENSORS_F75373_IN_MIN(nr)       (0x21 + (nr) * 2 )
+
+// temp n from 0 to 1
+#define SENSORS_F75373_TEMP(nr)         (0x14 + (nr))
+#define SENSORS_F75373_TEMP_MAX(nr)     (0x28 + (nr) * 2 )
+#define SENSORS_F75373_TEMP_HYST(nr)    (0x29 + (nr) * 2 )
+
+// fan n from 0 to 1
+#define SENSORS_F75373_FAN(nr)          (0x16 + (nr) * 2 )
+#define SENSORS_F75373_FAN_MIN(nr)      (0x26 + (nr) * 2 )
+// FAN Full Speed Count Register Index 70h
+#define SENSORS_F75373_FAN_MAX(nr)      (0x70 + (nr) * 0x10 )
+
+// pwm n from 0 to 1
+#define SENSORS_F75373_PWM(nr)          (0x76 + (nr) * 0x10 )
+#define SENSORS_F75373_PWM_ENABLE(nr)   (0x7D + (nr) * 0x10 )
+
 #endif /* def LIB_SENSORS_CHIPS_H */
diff -urN lm-sensors_org/prog/sensors/chips.c lm-sensors/prog/sensors/chips.c
--- lm-sensors_org/prog/sensors/chips.c	2007-06-17 15:34:33.000000000 +0200
+++ lm-sensors/prog/sensors/chips.c	2007-06-17 16:29:50.000000000 +0200
@@ -6131,6 +6131,114 @@
 	}
 }
 
+static void print_f75373_in(const sensors_chip_name *name, int i)
+{
+  char *label;
+  double cur, min, max;
+  int valid;
+
+  if (!sensors_get_label_and_valid(*name, SENSORS_F75373_IN(i), &label,
+                                  &valid) &&
+      !sensors_get_feature(*name, SENSORS_F75373_IN(i), &cur) &&
+      !sensors_get_feature(*name, SENSORS_F75373_IN_MAX(i), &max) &&
+      !sensors_get_feature(*name, SENSORS_F75373_IN_MIN(i), &min)) {
+    if (valid) {
+      print_label(label, 10);
+      printf("%+6.2f V  (min = %+6.2f V, max = %+6.2f V)  \n",
+             cur, min, max);
+    }
+  } else {
+    printf("ERROR: Can't get in%d data!\n", i);
+  }
+  free(label);
+}
+
+static void print_f75373_temp(const sensors_chip_name *name, int i)
+{
+  char *label;
+  double cur, max, alarm;
+  int valid;
+
+  if (!sensors_get_label_and_valid(*name, SENSORS_F75373_TEMP(i), &label,
+                                   &valid) &&
+      !sensors_get_feature(*name, SENSORS_F75373_TEMP(i), &cur) &&
+      !sensors_get_feature(*name, SENSORS_F75373_TEMP_MAX(i), &max) &&
+      !sensors_get_feature(*name, SENSORS_F75373_TEMP_HYST(i), &alarm)
+      ) {
+    if (valid) {
+      print_label(label, 10);
+      print_temp_info(cur, max, 0, HYST , 0, 0);
+      printf("%s\n", alarm ? "ALARM" : "");
+    }
+  } else {
+    printf("ERROR: Can't get temp%d data!\n", i);
+  }
+  free(label);
+}
+
+static void print_f75373_fan(const sensors_chip_name *name, int i)
+{
+  char *label;
+  double cur, min;
+  int valid;
+
+  if (!sensors_get_label_and_valid(*name, SENSORS_F75373_FAN(i), &label,
+                                   &valid) &&
+      !sensors_get_feature(*name, SENSORS_F75373_FAN(i), &cur) &&
+      !sensors_get_feature(*name, SENSORS_F75373_FAN_MIN(i), &min)
+     ){
+    if (valid) {
+      print_label(label, 10);
+      printf("%4.0f RPM  (min = %4.0f RPM)\n", 
+             cur, min);
+    }
+  } else {
+    printf("ERROR: Can't get fan%d data!\n", i);
+  }
+  free(label);
+}
+
+static void print_f75373_pwm(const sensors_chip_name *name, int i)
+{
+  char *label;
+  double cur, enable;
+  int valid;
+
+  if (!sensors_get_label_and_valid(*name, SENSORS_F75373_PWM(i), &label,
+                                   &valid) &&
+      !sensors_get_feature(*name, SENSORS_F75373_PWM(i), &cur) &&
+      !sensors_get_feature(*name, SENSORS_F75373_PWM_ENABLE(i), &enable)) {
+    if (valid) {
+      print_label(label, 10);
+      printf("%4.0f      (enable = %1.0f)\n", cur, enable);
+    }
+  } else {
+    printf("ERROR: Can't get pwm%d data!\n", i);
+  }
+  free(label);
+}
+
+void print_f75373(const sensors_chip_name *name)
+{
+  int i;
+
+  for (i = 0; i < 4; i++) {
+    print_f75373_in(name, i);
+  }
+
+  for (i = 1; i < 3; i++) {
+    print_f75373_temp(name, i);
+  }
+
+  for (i = 1; i < 3; i++) {
+    print_f75373_fan(name, i);
+  }
+
+  for (i = 1; i < 3; i++) {
+    print_f75373_pwm(name, i);
+  }
+}
+
 void print_unknown_chip(const sensors_chip_name *name)
 {
   int a,b,valid;
diff -urN lm-sensors_org/prog/sensors/chips.h lm-sensors/prog/sensors/chips.h
--- lm-sensors_org/prog/sensors/chips.h	2007-06-17 15:34:33.000000000 +0200
+++ lm-sensors/prog/sensors/chips.h	2007-06-16 20:59:34.000000000 +0200
@@ -78,5 +78,6 @@
 extern void print_coretemp(const sensors_chip_name *name);
 extern void print_dme1737(const sensors_chip_name *name);
 extern void print_applesmc(const sensors_chip_name *name);
+extern void print_f75373(const sensors_chip_name *name);
 
 #endif /* def PROG_SENSORS_CHIPS_H */
diff -urN lm-sensors_org/prog/sensors/main.c lm-sensors/prog/sensors/main.c
--- lm-sensors_org/prog/sensors/main.c	2007-06-17 15:34:33.000000000 +0200
+++ lm-sensors/prog/sensors/main.c	2007-06-17 08:12:48.000000000 +0200
@@ -424,6 +424,7 @@
  	{ "coretemp", print_coretemp },
  	{ "dme1737", print_dme1737 },
 	{ "applesmc", print_applesmc },
+	{ "F75373", print_f75373 },
 	{ NULL, NULL }
 };
 

[-- Attachment #3: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [lm-sensors] Help needed for implementing&testing Fintek F75375
  2007-06-12 17:29 [lm-sensors] Help needed for implementing&testing Fintek F75375 Christian Emmerich
                   ` (5 preceding siblings ...)
  2007-06-18 16:58 ` Christian Emmerich
@ 2007-06-23 12:29 ` Jean Delvare
  2007-06-25  5:19 ` Christian Emmerich
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Jean Delvare @ 2007-06-23 12:29 UTC (permalink / raw)
  To: lm-sensors

Hi Christian,

On Mon, 18 Jun 2007 18:58:24 +0200 (CEST), Christian Emmerich wrote:
> I've attached a patch for Fintek F75373S support, 
> kernel module f75375s is required.
> 
> At the moment it is possible to read out 4 different voltage 
> values, 2 temperatures and 2 fans/pwm (i've only one fan 
> connected, so i could only verify that one of two is working
> correct).

OK, my review is below.

> I was not able to adjust fan speed using fancontrol, 
> i have to do it by hand.

Did pwmconfig work?

> sensors output looks like:
> mythtv@pc:~$ sensors F75373-*
> F75373-i2c-1-2d
> Adapter: SMBus nForce2 adapter at 5100
> VCC:       +1.72 V  (min =  +0.00 V, max =  +0.00 V)  
> V1:        +1.34 V  (min =  +0.00 V, max =  +0.00 V)  
> V2:        +1.01 V  (min =  +0.00 V, max =  +0.00 V)  
> V3:        +0.77 V  (min =  +0.00 V, max =  +0.00 V)  
> CPU Temp:    +50°C  (high =    +0°C, hyst =    +0°C)  
> Sys Temp:    +47°C  (high =    +0°C, hyst =    +0°C)  
> CPU Fan:  1866 RPM  (min =    0 RPM)
> CPU PWM:    31      (enable = 1)

Did you try setting limits?

> diff -urN lm-sensors_org/etc/sensors.conf.eg lm-sensors/etc/sensors.conf.eg
> --- lm-sensors_org/etc/sensors.conf.eg	2007-06-17 15:34:35.000000000 +0200
> +++ lm-sensors/etc/sensors.conf.eg	2007-06-17 16:54:34.000000000 +0200
> @@ -2880,3 +2880,36 @@
>  #   set fan4_min 1000
>  #   set fan5_min 1000
>  #   set fan6_min 1000
> +
> +
> +#
> +# Sample configuration for the Fintek F75373
> +#
> +chip "f75373-*"
> +
> +# Voltages
> +   label in0_input "VCC"
> +   label in1_input "V1"
> +   label in2_input "V2"
> +   label in3_input "V3"
> +
> +   compute in0_input  @/1000,@/1000
> +   compute in1_input  @/1000,@/1000
> +   compute in2_input  @/1000,@/1000
> +   compute in3_input  @/1000,@/1000

That's not correct, you should have "in0", "in1"... etc. here, not
"in0_input", "in1_input" etc? The fan and temperature symbols below are
correct.

Also, these compute lines don't make sense. The second formula is
supposed to be the reserve of the first formula, that's not the case
here.

Lastly, you really shouldn't have to divide the values by 1000. This
suggests that the magnitude wasn't set properly in libsensors (it
should be 3, I suggest it is 0). This issue is most probably related to
the incorrect symbol names.

> +
> +# Fans
> +   label fan1 "CPU Fan"
> +   label fan2 "Sys Fan"
> +
> +   compute fan1  ( 1.5 * 1000000 )/@,  ( 1.5 * 1000000 )/@
> +   compute fan2  ( 1.5 * 1000000 )/@,  ( 1.5 * 1000000 )/@

This means that the driver isn't reporting the values in RPM as it
should. Usually no compute statement is needed for fans.

> +
> +# Temperatures
> +   label temp1 "CPU Temp"
> +   label temp2 "Sys Temp"
> +   
> +# PWM
> +   label pwm1   "CPU PWM"
> +   label pwm2   "Sys PWM"
> +
> diff -urN lm-sensors_org/lib/chips.c lm-sensors/lib/chips.c
> --- lm-sensors_org/lib/chips.c	2007-06-17 15:34:32.000000000 +0200
> +++ lm-sensors/lib/chips.c	2007-06-17 15:57:49.000000000 +0200
> @@ -6108,6 +6108,64 @@
>      { { 0 }, 0 }
>    };
>  
> +
> +
> +#define SENSORS_F75373_IN_FEATURES(nr) \
> +        { { SENSORS_F75373_IN(nr), "in" #nr "_input", \
> +                NOMAP, NOMAP, R }, \
> +                NOSYSCTL, VALUE(3), 3 }, \

OK, the problem is here: This should be"in" #nr, not "in" #nr
"_input". This will fix your magnitude problem.

> +        { { SENSORS_F75373_IN_MIN(nr), "in" #nr "_min", \
> +                SENSORS_F75373_IN(nr), SENSORS_F75373_IN(nr), RW }, \
> +                NOSYSCTL, VALUE(2), 3 }, \

VALUE(1) (although it won't make a difference for a Linux 2.6 only
driver.

> +        { { SENSORS_F75373_IN_MAX(nr), "in" #nr "_max", \
> +                SENSORS_F75373_IN(nr), SENSORS_F75373_IN(nr), RW }, \
> +                NOSYSCTL, VALUE(2), 3 }
> +
> +#define SENSORS_F75373_TEMP_FEATURES(nr) \
> +        { { SENSORS_F75373_TEMP(nr), "temp" #nr "", \
> +                NOMAP, NOMAP, R }, \
> +                NOSYSCTL, VALUE(3), 3 }, \
> +        { { SENSORS_F75373_TEMP_MAX(nr), "temp" #nr "_max", \
> +                SENSORS_F75373_TEMP(nr), SENSORS_F75373_TEMP(nr), RW }, \
> +                NOSYSCTL, VALUE(1), 3 }, \
> +        { { SENSORS_F75373_TEMP_HYST(nr), "temp" #nr "_hyst", \
> +                SENSORS_F75373_TEMP(nr), NOMAP, R }, \
> +                NOSYSCTL, VALUE(1), 0 }

SENSORS_F75373_TEMP(nr) instead of NOMAP, VALUE(2) instead of VALUE(1),
and magnitude 3 instead of 0. Is it really read-only?

(Unless this isn't an hysteresis temperature at all - see below.)

> +
> +#define SENSORS_F75373_FAN_FEATURES(nr) \
> +        { { SENSORS_F75373_FAN(nr), "fan" #nr, \
> +                NOMAP, NOMAP, R }, \
> +                NOSYSCTL, VALUE(2), 0 }, \
> +        { { SENSORS_F75373_FAN_MAX(nr), "fan" #nr "_max", \
> +                SENSORS_F75373_FAN(nr), SENSORS_F75373_FAN(nr), RW }, \
> +                NOSYSCTL, VALUE(1), 0 }, \

Strange, I've never seen a fan speed sensor with a high limit. What
does it correspond to exactly? Why don't you display this value in
"sensors"?

> +        { { SENSORS_F75373_FAN_MIN(nr), "fan" #nr "_min", \
> +                SENSORS_F75373_FAN(nr), NOMAP, R }, \
> +                NOSYSCTL, VALUE(1), 0 }

SENSORS_F75373_FAN(nr) instead of NOMAP.

Is it really read-only?

> +
> +#define SENSORS_F75373_PWM_FEATURES(nr) \
> +        { { SENSORS_F75373_PWM(nr), "pwm" #nr, \
> +                NOMAP, NOMAP, RW }, \
> +                NOSYSCTL, VALUE(1), 0 }, \
> +        { { SENSORS_F75373_PWM_ENABLE(nr), "pwm" #nr "_enable", \
> +                SENSORS_F75373_PWM(nr), SENSORS_F75373_PWM(nr), RW }, \
> +                NOSYSCTL, VALUE(3), 0 }

In fact we don't include PWM stuff in libsensors. They are not sensors,
and are better handled using pwmconfig and fancontrol.

> +
> +static sensors_chip_feature f75373_features[] > +{
> +        SENSORS_F75373_IN_FEATURES(0),
> +        SENSORS_F75373_IN_FEATURES(1),
> +        SENSORS_F75373_IN_FEATURES(2),
> +        SENSORS_F75373_IN_FEATURES(3),
> +        SENSORS_F75373_TEMP_FEATURES(1),
> +        SENSORS_F75373_TEMP_FEATURES(2),
> +        SENSORS_F75373_FAN_FEATURES(1),
> +        SENSORS_F75373_FAN_FEATURES(2),
> +        SENSORS_F75373_PWM_FEATURES(1),
> +        SENSORS_F75373_PWM_FEATURES(2),
> +        { { 0 }, 0 }
> +};
> +
>  sensors_chip_features sensors_chip_features_list[] >  {
>   { SENSORS_LM78_PREFIX, lm78_features },
> @@ -6223,5 +6281,6 @@
>   { SENSORS_CORETEMP_PREFIX, coretemp_features },
>   { SENSORS_DME1737_PREFIX, dme1737_features },
>   { SENSORS_APPLESMC_PREFIX, applesmc_features },
> + { SENSORS_F75373_PREFIX, f75373_features },
>   { 0 }
>  };
> diff -urN lm-sensors_org/lib/chips.h lm-sensors/lib/chips.h
> --- lm-sensors_org/lib/chips.h	2007-06-17 15:34:32.000000000 +0200
> +++ lm-sensors/lib/chips.h	2007-06-17 16:53:25.000000000 +0200
> @@ -2312,4 +2312,28 @@
>  #define SENSORS_APPLESMC_FAN_MAX(n)		(0x61 + (n)) /* R */
>  #define SENSORS_APPLESMC_FAN_SAFE(n)		(0x81 + (n)) /* R */
>  
> +/* Fintek F75373 registers  */
> +
> +#define SENSORS_F75373_PREFIX "f75373"
> +
> +// voltage n from 0 to 3

No C++-style comments please. Use /* */.

> +#define SENSORS_F75373_IN(nr)           (0x10 + (nr))
> +#define SENSORS_F75373_IN_MAX(nr)       (0x20 + (nr) * 2 )
> +#define SENSORS_F75373_IN_MIN(nr)       (0x21 + (nr) * 2 )

Coding style: no space before closing parenthesis.

> +
> +// temp n from 0 to 1
> +#define SENSORS_F75373_TEMP(nr)         (0x14 + (nr))
> +#define SENSORS_F75373_TEMP_MAX(nr)     (0x28 + (nr) * 2 )
> +#define SENSORS_F75373_TEMP_HYST(nr)    (0x29 + (nr) * 2 )
> +
> +// fan n from 0 to 1
> +#define SENSORS_F75373_FAN(nr)          (0x16 + (nr) * 2 )
> +#define SENSORS_F75373_FAN_MIN(nr)      (0x26 + (nr) * 2 )
> +// FAN Full Speed Count Register Index 70h
> +#define SENSORS_F75373_FAN_MAX(nr)      (0x70 + (nr) * 0x10 )
> +
> +// pwm n from 0 to 1
> +#define SENSORS_F75373_PWM(nr)          (0x76 + (nr) * 0x10 )
> +#define SENSORS_F75373_PWM_ENABLE(nr)   (0x7D + (nr) * 0x10 )
> +

I hope that you realize that these numbers do NOT have to match the
register numbers in the chip? These numbers are completely arbitrary.
So please make them as simple as possible.

>  #endif /* def LIB_SENSORS_CHIPS_H */
> diff -urN lm-sensors_org/prog/sensors/chips.c lm-sensors/prog/sensors/chips.c
> --- lm-sensors_org/prog/sensors/chips.c	2007-06-17 15:34:33.000000000 +0200
> +++ lm-sensors/prog/sensors/chips.c	2007-06-17 16:29:50.000000000 +0200
> @@ -6131,6 +6131,114 @@
>  	}
>  }
>  
> +static void print_f75373_in(const sensors_chip_name *name, int i)
> +{
> +  char *label;
> +  double cur, min, max;
> +  int valid;
> +
> +  if (!sensors_get_label_and_valid(*name, SENSORS_F75373_IN(i), &label,
> +                                  &valid) &&
> +      !sensors_get_feature(*name, SENSORS_F75373_IN(i), &cur) &&
> +      !sensors_get_feature(*name, SENSORS_F75373_IN_MAX(i), &max) &&
> +      !sensors_get_feature(*name, SENSORS_F75373_IN_MIN(i), &min)) {
> +    if (valid) {
> +      print_label(label, 10);
> +      printf("%+6.2f V  (min = %+6.2f V, max = %+6.2f V)  \n",
> +             cur, min, max);

If you don't have any alarm flag to display, you can remove the spaces
before the newline.

> +    }
> +  } else {
> +    printf("ERROR: Can't get in%d data!\n", i);
> +  }
> +  free(label);
> +}
> +
> +static void print_f75373_temp(const sensors_chip_name *name, int i)
> +{
> +  char *label;
> +  double cur, max, alarm;
> +  int valid;
> +
> +  if (!sensors_get_label_and_valid(*name, SENSORS_F75373_TEMP(i), &label,
> +                                   &valid) &&
> +      !sensors_get_feature(*name, SENSORS_F75373_TEMP(i), &cur) &&
> +      !sensors_get_feature(*name, SENSORS_F75373_TEMP_MAX(i), &max) &&
> +      !sensors_get_feature(*name, SENSORS_F75373_TEMP_HYST(i), &alarm)
> +      ) {

Coding style: move this at the end of the previous line.

> +    if (valid) {
> +      print_label(label, 10);
> +      print_temp_info(cur, max, 0, HYST , 0, 0);
> +      printf("%s\n", alarm ? "ALARM" : "");
> +    }

This doesn't make sense. What is SENSORS_F75373_TEMP_HYST exactly? Why
do you display it as an alarm?


> +  } else {
> +    printf("ERROR: Can't get temp%d data!\n", i);
> +  }
> +  free(label);
> +}
> +
> +static void print_f75373_fan(const sensors_chip_name *name, int i)
> +{
> +  char *label;
> +  double cur, min;
> +  int valid;
> +
> +  if (!sensors_get_label_and_valid(*name, SENSORS_F75373_FAN(i), &label,
> +                                   &valid) &&
> +      !sensors_get_feature(*name, SENSORS_F75373_FAN(i), &cur) &&
> +      !sensors_get_feature(*name, SENSORS_F75373_FAN_MIN(i), &min)
> +     ){

Coding style: move this at the end of the previous line.

> +    if (valid) {
> +      print_label(label, 10);
> +      printf("%4.0f RPM  (min = %4.0f RPM)\n", 
> +             cur, min);
> +    }
> +  } else {
> +    printf("ERROR: Can't get fan%d data!\n", i);
> +  }
> +  free(label);
> +}
> +
> +static void print_f75373_pwm(const sensors_chip_name *name, int i)
> +{
> +  char *label;
> +  double cur, enable;
> +  int valid;
> +
> +  if (!sensors_get_label_and_valid(*name, SENSORS_F75373_PWM(i), &label,
> +                                   &valid) &&
> +      !sensors_get_feature(*name, SENSORS_F75373_PWM(i), &cur) &&
> +      !sensors_get_feature(*name, SENSORS_F75373_PWM_ENABLE(i), &enable)) {
> +    if (valid) {
> +      print_label(label, 10);
> +      printf("%4.0f      (enable = %1.0f)\n", cur, enable);
> +    }
> +  } else {
> +    printf("ERROR: Can't get pwm%d data!\n", i);
> +  }
> +  free(label);
> +}
> +
> +void print_f75373(const sensors_chip_name *name)
> +{
> +  int i;
> +
> +  for (i = 0; i < 4; i++) {
> +    print_f75373_in(name, i);
> +  }
> +
> +  for (i = 1; i < 3; i++) {

I'd suggest writing it i <= 2, to make it more visible that there are 2
temperature inputs, not 3. Same below for fans.

> +    print_f75373_temp(name, i);
> +  }
> +
> +  for (i = 1; i < 3; i++) {
> +    print_f75373_fan(name, i);
> +  }
> +
> +  for (i = 1; i < 3; i++) {
> +    print_f75373_pwm(name, i);
> +  }
> +}
> +
>  void print_unknown_chip(const sensors_chip_name *name)
>  {
>    int a,b,valid;
> diff -urN lm-sensors_org/prog/sensors/chips.h lm-sensors/prog/sensors/chips.h
> --- lm-sensors_org/prog/sensors/chips.h	2007-06-17 15:34:33.000000000 +0200
> +++ lm-sensors/prog/sensors/chips.h	2007-06-16 20:59:34.000000000 +0200
> @@ -78,5 +78,6 @@
>  extern void print_coretemp(const sensors_chip_name *name);
>  extern void print_dme1737(const sensors_chip_name *name);
>  extern void print_applesmc(const sensors_chip_name *name);
> +extern void print_f75373(const sensors_chip_name *name);
>  
>  #endif /* def PROG_SENSORS_CHIPS_H */
> diff -urN lm-sensors_org/prog/sensors/main.c lm-sensors/prog/sensors/main.c
> --- lm-sensors_org/prog/sensors/main.c	2007-06-17 15:34:33.000000000 +0200
> +++ lm-sensors/prog/sensors/main.c	2007-06-17 08:12:48.000000000 +0200
> @@ -424,6 +424,7 @@
>   	{ "coretemp", print_coretemp },
>   	{ "dme1737", print_dme1737 },
>  	{ "applesmc", print_applesmc },
> +	{ "F75373", print_f75373 },

Should be "f75373", no capital. I'm even surprised it worked with the
capital.

>  	{ NULL, NULL }
>  };
>  

Please update your patch and resend it.

Also, what about the F75375 support? As far as I know the f75375s driver
supports both chips, so it'd be nice to have user-space support for
both. Also, it might be less confusing to use F75375 for all the
libsensors defines, rather than F75373, so that they match the driver
name.

Thanks,
-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [lm-sensors] Help needed for implementing&testing Fintek F75375
  2007-06-12 17:29 [lm-sensors] Help needed for implementing&testing Fintek F75375 Christian Emmerich
                   ` (6 preceding siblings ...)
  2007-06-23 12:29 ` Jean Delvare
@ 2007-06-25  5:19 ` Christian Emmerich
  2007-06-26 18:19 ` Jean Delvare
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Christian Emmerich @ 2007-06-25  5:19 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 10221 bytes --]

Hi Jean,

The first version of this message was to large and was rejected, so i had to cut the quote a little bit.

> Did pwmconfig work?
I get it working now, i just have to set FCTEMPS and FCFANS correct in /etc/fancontrol now it work.
The only problem is, that if i stop fancontrol, the program set pwm1_enable to 0, but
after this the fan turns at 23rpm. This also happens if i set pwm1_enable to 0 by hand.


> sensors output looks like:
> mythtv@pc:~$ sensors F75373-*
> F75373-i2c-1-2d
> Adapter: SMBus nForce2 adapter at 5100
> :
> CPU PWM:    31      (enable = 1)
>
> Did you try setting limits?
I try to set limits in sensors.conf but i could see no change.


> That's not correct, you should have "in0", "in1"... etc. here, not
> "in0_input", "in1_input" etc? The fan and temperature symbols below are
> correct.

> Also, these compute lines don't make sense. The second formula is
> supposed to be the reserve of the first formula, that's not the case
> here.

> Lastly, you really shouldn't have to divide the values by 1000. This
> suggests that the magnitude wasn't set properly in libsensors (it
> should be 3, I suggest it is 0). This issue is most probably related to
> the incorrect symbol names.

I saw values >800V so i thought i have to divide it by 1000 in sensors.conf.
Magnitude is 3 and the symbol name is correct now, but the values are still over 800V. What's the reason?


> This means that the driver isn't reporting the values in RPM as it
> should. Usually no compute statement is needed for fans.
That's correct, the value is not in RPM, in the document '2005111153128.pdf' you can download on the fintek page
( http://www.fintek.com.tw/eng/products.asp?BID=4&SID=5 )its written on page 8:
"Determine the fan counter according to:
Count = (1.5×10^6) / RPM "
That means that the driver is reporting the count value, not the rpm.
So i have to compute in sensors.conf:
RPM = (1.5×10^6)/ Count


> > +#define SENSORS_F75373_IN_FEATURES(nr) \
> > +        { { SENSORS_F75373_IN(nr), "in" #nr "_input", \
> > +                NOMAP, NOMAP, R }, \
> > +                NOSYSCTL, VALUE(3), 3 }, \
>
> OK, the problem is here: This should be"in" #nr, not "in" #nr
> "_input". This will fix your magnitude problem.
I changed it to "in" #nr, \


> +        { { SENSORS_F75373_IN_MIN(nr), "in" #nr "_min", \
> +                SENSORS_F75373_IN(nr), SENSORS_F75373_IN(nr), RW },
 \
> +                NOSYSCTL, VALUE(2), 3 }, \
>
> VALUE(1) (although it won't make a difference for a Linux 2.6 only
> driver.
VALUE(2) changed to VALUE(1)


> +        { { SENSORS_F75373_IN_MAX(nr), "in" #nr "_max", \
> +                SENSORS_F75373_IN(nr), SENSORS_F75373_IN(nr), RW },
> :
> +                NOSYSCTL, VALUE(1), 3 }, \
> +        { { SENSORS_F75373_TEMP_HYST(nr), "temp" #nr "_hyst", \
> +                SENSORS_F75373_TEMP(nr), NOMAP, R }, \
> +                NOSYSCTL, VALUE(1), 0 }

> SENSORS_F75373_TEMP(nr) instead of NOMAP, VALUE(2) instead of VALUE(1),
> and magnitude 3 instead of 0. Is it really read-only?
>
> (Unless this isn't an hysteresis temperature at all - see below.)
I changed it. It is not only read-only, i changed it to RW.


> +
> +#define SENSORS_F75373_FAN_FEATURES(nr) \
> +        { { SENSORS_F75373_FAN(nr), "fan" #nr, \
> +                NOMAP, NOMAP, R }, \
> +                NOSYSCTL, VALUE(2), 0 }, \
> +        { { SENSORS_F75373_FAN_MAX(nr), "fan" #nr "_max", \
> +                SENSORS_F75373_FAN(nr), SENSORS_F75373_FAN(nr), RW
 }, \
> +                NOSYSCTL, VALUE(1), 0 }, \
>
> Strange, I've never seen a fan speed sensor with a high limit. What
> does it correspond to exactly? Why don't you display this value in
> "sensors"?
I get the information out of the documentation on page 26:
"When power on, the PWMOUT1 will output full duty cycle (FFh) to
enable system FAN. After 10 seconds when detecting FANIN1
signal, assuming the fan has been fully turned on, the fan speed
count detected will be recorded in the register.".
Dunno if it should be removed?


> +        { { SENSORS_F75373_FAN_MIN(nr), "fan" #nr "_min", \
> +                SENSORS_F75373_FAN(nr), NOMAP, R }, \
> +                NOSYSCTL, VALUE(1), 0 }
>
> SENSORS_F75373_FAN(nr) instead of NOMAP.
>
> Is it really read-only?
I changed it to SENSORS_F75373_FAN(nr), it is RW.
But fanX_min is allways zero, so it lead to an error on calling
'sensors_get_feature(*name, SENSORS_F75373_FAN_MIN(i), &min)',
i have to disable it, sensors output is now
CPU Fan:  1866 RPM  (min =    0 RPM)
to
CPU Fan:  1866 RPM


> +
> +#define SENSORS_F75373_PWM_FEATURES(nr) \
> +        { { SENSORS_F75373_PWM(nr), "pwm" #nr, \
> +                NOMAP, NOMAP, RW }, \
> +                NOSYSCTL, VALUE(1), 0 }, \
> +        { { SENSORS_F75373_PWM_ENABLE(nr), "pwm" #nr "_enable", \
> +                SENSORS_F75373_PWM(nr), SENSORS_F75373_PWM(nr), RW
 }, \
> +                NOSYSCTL, VALUE(3), 0 }
>
> In fact we don't include PWM stuff in libsensors. They are not sensors,
> and are better handled using pwmconfig and fancontrol.
I only copied it from SENSORS_DME1737_PWM_FEATURES, should i remove it?


> +
> +static sensors_chip_feature f75373_features[] =
> :
> +#define SENSORS_F75373_PREFIX "f75373"
> +
> +// voltage n from 0 to 3
>
> No C++-style comments please. Use /* */.
I used now /**/.


> +#define SENSORS_F75373_IN(nr)           (0x10 + (nr))
> +#define SENSORS_F75373_IN_MAX(nr)       (0x20 + (nr) * 2 )
> +#define SENSORS_F75373_IN_MIN(nr)       (0x21 + (nr) * 2 )
>
> Coding style: no space before closing parenthesis.
I changed it.


> +
> +// temp n from 0 to 1
> +#define SENSORS_F75373_TEMP(nr)         (0x14 + (nr))
> :
> +#define SENSORS_F75373_PWM_ENABLE(nr)   (0x7D + (nr) * 0x10 )
> +
>
> I hope that you realize that these numbers do NOT have to match the
> register numbers in the chip? These numbers are completely arbitrary.
> So please make them as simple as possible.
No :-), i changed it.


>  #endif /* def LIB_SENSORS_CHIPS_H */
> diff -urN lm-sensors_org/prog/sensors/chips.c
 lm-sensors/prog/sensors/chips.c
> --- lm-sensors_org/prog/sensors/chips.c    2007-06-17 15:34:33.000000000
 +0200
> +++ lm-sensors/prog/sensors/chips.c    2007-06-17 16:29:50.000000000
 +0200
> @@ -6131,6 +6131,114 @@
>      }
>  }
>  
> +static void print_f75373_in(const sensors_chip_name *name, int i)
> :
> +      printf("%+6.2f V  (min = %+6.2f V, max = %+6.2f V)  \n",
> +             cur, min, max);
>
> If you don't have any alarm flag to display, you can remove the spaces
> before the newline.
I changed it.


> +    }
> +  } else {
> +    printf("ERROR: Can't get in%d data!\n", i);
> :
> +      !sensors_get_feature(*name, SENSORS_F75373_TEMP_HYST(i),
 &alarm)
> +      ) {
>
> Coding style: move this at the end of the previous line.
I changed it.

> +    if (valid) {
> +      print_label(label, 10);
> +      print_temp_info(cur, max, 0, HYST , 0, 0);
> +      printf("%s\n", alarm ? "ALARM" : "");
> +    }
>
> This doesn't make sense. What is SENSORS_F75373_TEMP_HYST exactly? Why
> do you display it as an alarm?
It was a mistake, i deleted the Alarm output, now it is only printf("\n"),
there seems not to be a value for an alarm.
temp1_max_hyst is always zero, i don't now what it is exactly and
when it is not zero.


> +  } else {
> +    printf("ERROR: Can't get temp%d data!\n", i);
> :
> +                                   &valid) &&
> +      !sensors_get_feature(*name, SENSORS_F75373_FAN(i), &cur) &&
> +      !sensors_get_feature(*name, SENSORS_F75373_FAN_MIN(i), &min)
> +     ){
>
> Coding style: move this at the end of the previous line.
I changed it.


> +    if (valid) {
> +      print_label(label, 10);
> +      printf("%4.0f RPM  (min = %4.0f RPM)\n",
> +             cur, min);
> :
> +  int i;
> +
> +  for (i = 0; i < 4; i++) {
> +    print_f75373_in(name, i);
> +  }
> +
> +  for (i = 1; i < 3; i++) {
>
> I'd suggest writing it i <= 2, to make it more visible that there are 2
> temperature inputs, not 3. Same below for fans.
I changed it.


> +    print_f75373_temp(name, i);
> +  }
> +
> :
> @@ -424,6 +424,7 @@
>       { "coretemp", print_coretemp },
>       { "dme1737", print_dme1737 },
>      { "applesmc", print_applesmc },
> +    { "F75373", print_f75373 },
>
> Should be "f75373", no capital. I'm even surprised it worked with the
> capital.
If i use f75373 i get following output:
F75373-i2c-1-2d
Adapter: SMBus nForce2 adapter at 5100
VCC: 1720.00 (in0)
  in0_min: 0.00 (in0_min)
  in0_max: 0.00 (in0_max)
V1: 1336.00 (in1)
  in1_min: 0.00 (in1_min)
  in1_max: 0.00 (in1_max)
V2: 1008.00 (in2)
  in2_min: 0.00 (in2_min)
  in2_max: 0.00 (in2_max)
V3: 792.00 (in3)
  in3_min: 0.00 (in3_min)
  in3_max: 0.00 (in3_max)
CPU Temp: 49.00 (temp1)
  temp1_max: 0.00 (temp1_max)
  temp1_hyst: 0.00 (temp1_hyst)
Sys Temp: 46.00 (temp2)
  temp2_max: 0.00 (temp2_max)
  temp2_hyst: 0.00 (temp2_hyst)
CPU Fan: 1787.84 (fan1)
  fan1_max: 5681.82 (fan1_max)
ERROR: Can't get feature `fan1_min' data!
CPU PWM: 31.00 (pwm1)
What's the reason? Did I still have to use "F75373"?


> Please update your patch and resend it.
>
> Also, what about the F75375 support? As far as I know the f75375s
>  driver
> supports both chips, so it'd be nice to have user-space support for
> both. Also, it might be less confusing to use F75375 for all the
> libsensors defines, rather than F75373, so that they match the driver
> name.
I changed every define/function from F75373 to F75375, i added also:
#define SENSORS_F75373_PREFIX "f75373"
#define SENSORS_F75375_PREFIX "f75375"
and
{ SENSORS_F75375_PREFIX, f75375_features },
{ SENSORS_F75373_PREFIX, f75375_features },
and
{ "F75375", print_f75375 },
{ "F75373", print_f75375 },
i hope that this is ok.


>
> Thanks,
> --
> Jean Delvare
Thank you for your review,
christian.
 		
---------------------------------
Was ist Glück? Schlafen Fische überhaupt? Die Antworten gibt’s auf Yahoo! Clever.

[-- Attachment #1.2: Type: text/html, Size: 35148 bytes --]

[-- Attachment #2: 3093308178-fintek_75373s_support_v2.patch --]
[-- Type: application/octet-stream, Size: 9283 bytes --]

diff -urN lm-sensors_org/etc/sensors.conf.eg lm-sensors/etc/sensors.conf.eg
--- lm-sensors_org/etc/sensors.conf.eg	2007-06-17 17:17:29.000000000 +0200
+++ lm-sensors/etc/sensors.conf.eg	2007-06-24 18:13:17.000000000 +0200
@@ -2880,3 +2880,31 @@
 #   set fan4_min 1000
 #   set fan5_min 1000
 #   set fan6_min 1000
+
+
+#
+# Sample configuration for the Fintek F75375/F75373S
+#
+chip "F75375-*" "F75373-*"
+
+# Voltages
+   label in0 "VCC"
+   label in1 "V1"
+   label in2 "V2"
+   label in3 "V3"
+    
+# Fans
+   label fan1 "CPU Fan"
+   label fan2 "Sys Fan"
+
+   compute fan1  ( 1.5 * 1000000 )/@,  ( 1.5 * 1000000 )/@
+   compute fan2  ( 1.5 * 1000000 )/@,  ( 1.5 * 1000000 )/@
+
+# Temperatures
+   label temp1 "CPU Temp"
+   label temp2 "Sys Temp"
+   
+# PWM
+   label pwm1   "CPU PWM"
+   label pwm2   "Sys PWM"
+
diff -urN lm-sensors_org/lib/chips.c lm-sensors/lib/chips.c
--- lm-sensors_org/lib/chips.c	2007-06-17 17:17:25.000000000 +0200
+++ lm-sensors/lib/chips.c	2007-06-24 17:50:49.000000000 +0200
@@ -6108,6 +6108,64 @@
     { { 0 }, 0 }
   };
 
+
+
+#define SENSORS_F75375_IN_FEATURES(nr) \
+        { { SENSORS_F75375_IN(nr), "in" #nr, \
+                NOMAP, NOMAP, R }, \
+                NOSYSCTL, VALUE(3), 3 }, \
+        { { SENSORS_F75375_IN_MIN(nr), "in" #nr "_min", \
+                SENSORS_F75375_IN(nr), SENSORS_F75375_IN(nr), RW }, \
+                NOSYSCTL, VALUE(1), 3 }, \
+        { { SENSORS_F75375_IN_MAX(nr), "in" #nr "_max", \
+                SENSORS_F75375_IN(nr), SENSORS_F75375_IN(nr), RW }, \
+                NOSYSCTL, VALUE(2), 3 }
+
+#define SENSORS_F75375_TEMP_FEATURES(nr) \
+        { { SENSORS_F75375_TEMP(nr), "temp" #nr, \
+                NOMAP, NOMAP, R }, \
+                NOSYSCTL, VALUE(3), 3 }, \
+        { { SENSORS_F75375_TEMP_MAX(nr), "temp" #nr "_max", \
+                SENSORS_F75375_TEMP(nr), SENSORS_F75375_TEMP(nr), RW }, \
+                NOSYSCTL, VALUE(1), 3 }, \
+        { { SENSORS_F75375_TEMP_HYST(nr), "temp" #nr "_hyst", \
+                SENSORS_F75375_TEMP(nr), SENSORS_F75375_TEMP(nr), RW }, \
+                NOSYSCTL, VALUE(2), 3 }
+
+#define SENSORS_F75375_FAN_FEATURES(nr) \
+        { { SENSORS_F75375_FAN(nr), "fan" #nr, \
+                NOMAP, NOMAP, R }, \
+                NOSYSCTL, VALUE(2), 0 }, \
+        { { SENSORS_F75375_FAN_MAX(nr), "fan" #nr "_max", \
+                SENSORS_F75375_FAN(nr), SENSORS_F75375_FAN(nr), RW }, \
+                NOSYSCTL, VALUE(1), 0 }, \
+        { { SENSORS_F75375_FAN_MIN(nr), "fan" #nr "_min", \
+                SENSORS_F75375_FAN(nr), SENSORS_F75375_FAN(nr), RW }, \
+                NOSYSCTL, VALUE(1), 0 }
+
+#define SENSORS_F75375_PWM_FEATURES(nr) \
+        { { SENSORS_F75375_PWM(nr), "pwm" #nr, \
+                NOMAP, NOMAP, RW }, \
+                NOSYSCTL, VALUE(1), 0 }, \
+        { { SENSORS_F75375_PWM_ENABLE(nr), "pwm" #nr "_enable", \
+                SENSORS_F75375_PWM(nr), SENSORS_F75375_PWM(nr), RW }, \
+                NOSYSCTL, VALUE(3), 0 }
+
+static sensors_chip_feature f75375_features[] =
+{
+        SENSORS_F75375_IN_FEATURES(0),
+        SENSORS_F75375_IN_FEATURES(1),
+        SENSORS_F75375_IN_FEATURES(2),
+        SENSORS_F75375_IN_FEATURES(3),
+        SENSORS_F75375_TEMP_FEATURES(1),
+        SENSORS_F75375_TEMP_FEATURES(2),
+        SENSORS_F75375_FAN_FEATURES(1),
+        SENSORS_F75375_FAN_FEATURES(2),
+        SENSORS_F75375_PWM_FEATURES(1),
+        SENSORS_F75375_PWM_FEATURES(2),
+        { { 0 }, 0 }
+};
+
 sensors_chip_features sensors_chip_features_list[] =
 {
  { SENSORS_LM78_PREFIX, lm78_features },
@@ -6223,5 +6281,7 @@
  { SENSORS_CORETEMP_PREFIX, coretemp_features },
  { SENSORS_DME1737_PREFIX, dme1737_features },
  { SENSORS_APPLESMC_PREFIX, applesmc_features },
+ { SENSORS_F75375_PREFIX, f75375_features },
+ { SENSORS_F75373_PREFIX, f75375_features },
  { 0 }
 };
diff -urN lm-sensors_org/lib/chips.h lm-sensors/lib/chips.h
--- lm-sensors_org/lib/chips.h	2007-06-17 17:17:25.000000000 +0200
+++ lm-sensors/lib/chips.h	2007-06-24 18:14:47.000000000 +0200
@@ -2312,4 +2312,29 @@
 #define SENSORS_APPLESMC_FAN_MAX(n)		(0x61 + (n)) /* R */
 #define SENSORS_APPLESMC_FAN_SAFE(n)		(0x81 + (n)) /* R */
 
+/* Fintek F75373 registers  */
+
+#define SENSORS_F75373_PREFIX "f75373"
+#define SENSORS_F75375_PREFIX "f75375"
+
+/* voltage n from 1 to 4 */
+#define SENSORS_F75375_IN(nr)           (0x01 + (nr))
+#define SENSORS_F75375_IN_MAX(nr)       (0x11 + (nr) * 2)
+#define SENSORS_F75375_IN_MIN(nr)       (0x21 + (nr) * 2)
+
+/* temp n from 1 to 2 */
+#define SENSORS_F75375_TEMP(nr)         (0x31 + (nr))
+#define SENSORS_F75375_TEMP_MAX(nr)     (0x41 + (nr) * 2)
+#define SENSORS_F75375_TEMP_HYST(nr)    (0x51 + (nr) * 2)
+
+/* fan n from 1 to 2 */
+#define SENSORS_F75375_FAN(nr)          (0x61 + (nr) * 2)
+#define SENSORS_F75375_FAN_MIN(nr)      (0x71 + (nr) * 2)
+/* FAN Full Speed Count Register Index 70h */
+#define SENSORS_F75375_FAN_MAX(nr)      (0x81 + (nr) * 0x10)
+
+/* pwm n from 1 to 2 */
+#define SENSORS_F75375_PWM(nr)          (0xa1 + (nr) * 0x10)
+#define SENSORS_F75375_PWM_ENABLE(nr)   (0xc1 + (nr) * 0x10)
+
 #endif /* def LIB_SENSORS_CHIPS_H */
diff -urN lm-sensors_org/prog/sensors/chips.c lm-sensors/prog/sensors/chips.c
--- lm-sensors_org/prog/sensors/chips.c	2007-06-17 17:17:27.000000000 +0200
+++ lm-sensors/prog/sensors/chips.c	2007-06-24 16:44:41.000000000 +0200
@@ -6131,6 +6131,112 @@
 	}
 }
 
+static void print_f75375_in(const sensors_chip_name *name, int i)
+{
+  char *label;
+  double cur, min, max;
+  int valid;
+
+  if (!sensors_get_label_and_valid(*name, SENSORS_F75375_IN(i), &label,
+                                  &valid) &&
+      !sensors_get_feature(*name, SENSORS_F75375_IN(i), &cur) &&
+      !sensors_get_feature(*name, SENSORS_F75375_IN_MAX(i), &max) &&
+      !sensors_get_feature(*name, SENSORS_F75375_IN_MIN(i), &min)) {
+    if (valid) {
+      print_label(label, 10);
+      printf("%+6.2f V  (min = %+6.2f V, max = %+6.2f V)\n",
+             cur, min, max);
+    }
+  } else {
+    printf("ERROR: Can't get in%d data!\n", i);
+  }
+  free(label);
+}
+
+static void print_f75375_temp(const sensors_chip_name *name, int i)
+{
+  char *label;
+  double cur, max;
+  int valid;
+
+  if (!sensors_get_label_and_valid(*name, SENSORS_F75375_TEMP(i), &label,
+                                   &valid) &&
+      !sensors_get_feature(*name, SENSORS_F75375_TEMP(i), &cur) &&
+      !sensors_get_feature(*name, SENSORS_F75375_TEMP_MAX(i), &max)) {
+    if (valid) {
+      print_label(label, 10);
+      print_temp_info(cur, max, 0, MAXONLY, 0, 0);
+      printf("\n");
+    }
+  } else {
+    printf("ERROR: Can't get temp%d data!\n", i);
+  }
+  free(label);
+}
+
+static void print_f75375_fan(const sensors_chip_name *name, int i)
+{
+  char *label;
+  double cur;
+  int valid;
+
+  if (!sensors_get_label_and_valid(*name, SENSORS_F75375_FAN(i), &label,
+                                   &valid) &&
+      !sensors_get_feature(*name, SENSORS_F75375_FAN(i), &cur)) {
+    if (valid) {
+      print_label(label, 10);
+      /*printf("%4.0f RPM  (min = %4.0f RPM)\n", 
+             cur, min);*/
+      printf("%4.0f RPM\n",
+             cur);
+    }
+  } else {
+    printf("ERROR: Can't get fan%d data!\n", i);
+  }
+  free(label);
+}
+
+static void print_f75375_pwm(const sensors_chip_name *name, int i)
+{
+  char *label;
+  double cur, enable;
+  int valid;
+
+  if (!sensors_get_label_and_valid(*name, SENSORS_F75375_PWM(i), &label,
+                                   &valid) &&
+      !sensors_get_feature(*name, SENSORS_F75375_PWM(i), &cur) &&
+      !sensors_get_feature(*name, SENSORS_F75375_PWM_ENABLE(i), &enable)) {
+    if (valid) {
+      print_label(label, 10);
+      printf("%4.0f      (enable = %1.0f)\n", cur, enable);
+    }
+  } else {
+    printf("ERROR: Can't get pwm%d data!\n", i);
+  }
+  free(label);
+}
+
+void print_f75375(const sensors_chip_name *name)
+{
+  int i;
+
+  for (i = 0; i <= 3; i++) {
+    print_f75375_in(name, i);
+  }
+
+  for (i = 1; i <= 2; i++) {
+    print_f75375_temp(name, i);
+  }
+
+  for (i = 1; i <= 2; i++) {
+    print_f75375_fan(name, i);
+  }
+
+  for (i = 1; i <= 2; i++) {
+    print_f75375_pwm(name, i);
+  }
+}
+
 void print_unknown_chip(const sensors_chip_name *name)
 {
   int a,b,valid;
diff -urN lm-sensors_org/prog/sensors/chips.h lm-sensors/prog/sensors/chips.h
--- lm-sensors_org/prog/sensors/chips.h	2007-06-17 17:17:27.000000000 +0200
+++ lm-sensors/prog/sensors/chips.h	2007-06-24 16:37:51.000000000 +0200
@@ -78,5 +78,6 @@
 extern void print_coretemp(const sensors_chip_name *name);
 extern void print_dme1737(const sensors_chip_name *name);
 extern void print_applesmc(const sensors_chip_name *name);
+extern void print_f75375(const sensors_chip_name *name);
 
 #endif /* def PROG_SENSORS_CHIPS_H */
diff -urN lm-sensors_org/prog/sensors/main.c lm-sensors/prog/sensors/main.c
--- lm-sensors_org/prog/sensors/main.c	2007-06-17 17:17:27.000000000 +0200
+++ lm-sensors/prog/sensors/main.c	2007-06-24 18:25:10.000000000 +0200
@@ -424,6 +424,8 @@
  	{ "coretemp", print_coretemp },
  	{ "dme1737", print_dme1737 },
 	{ "applesmc", print_applesmc },
+        { "F75375", print_f75375 },
+        { "F75373", print_f75375 },
 	{ NULL, NULL }
 };
 

[-- Attachment #3: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [lm-sensors] Help needed for implementing&testing Fintek F75375
  2007-06-12 17:29 [lm-sensors] Help needed for implementing&testing Fintek F75375 Christian Emmerich
                   ` (7 preceding siblings ...)
  2007-06-25  5:19 ` Christian Emmerich
@ 2007-06-26 18:19 ` Jean Delvare
  2007-06-27 13:23 ` Riku Voipio
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Jean Delvare @ 2007-06-26 18:19 UTC (permalink / raw)
  To: lm-sensors

Hi Christian,

On Mon, 25 Jun 2007 07:19:33 +0200 (CEST), Christian Emmerich wrote:
> The first version of this message was to large and was rejected, so
> i had to cut the quote a little bit.

The reject message explained that you shouldn't be sending HTML mails.
This makes your mails more than twice as big as they should, and that
explains the reject.

> > Did pwmconfig work?
>
> I get it working now, i just have to set FCTEMPS and FCFANS correct in /etc/fancontrol now it work.
> The only problem is, that if i stop fancontrol, the program set pwm1_enable to 0, but
> after this the fan turns at 23rpm. This also happens if i set pwm1_enable to 0 by hand.

Sounds like a bug in the driver then. Setting pwm1_enable to 0 should
turn the fan to full speed.

> > sensors output looks like:
> > mythtv@pc:~$ sensors F75373-*
> > F75373-i2c-1-2d
> > Adapter: SMBus nForce2 adapter at 5100
> > :
> > CPU PWM:    31      (enable = 1)
> >
> > Did you try setting limits?
> I try to set limits in sensors.conf but i could see no change.

You must run "sensors -s" after changing the limits
in /etc/sensors.conf for the new limits to be applied. Please test this,
this is a good way to test both the libsensors code you added, and the
driver itself.

> > Lastly, you really shouldn't have to divide the values by 1000. This
> > suggests that the magnitude wasn't set properly in libsensors (it
> > should be 3, I suggest it is 0). This issue is most probably related to
> > the incorrect symbol names.
> 
> I saw values >800V so i thought i have to divide it by 1000 in sensors.conf.
> Magnitude is 3 and the symbol name is correct now, but the values are still
> over 800V. What's the reason?

I guess that's a bug in the driver. What values do you see in the
in*_input sysfs files?

> > This means that the driver isn't reporting the values in RPM as it
> > should. Usually no compute statement is needed for fans.
>
> That's correct, the value is not in RPM, in the document '2005111153128.pdf' you can download on the fintek page
> ( http://www.fintek.com.tw/eng/products.asp?BID=4&SID=5 )its written on page 8:
> "Determine the fan counter according to:
> Count = (1.5×10^6) / RPM "
> That means that the driver is reporting the count value, not the rpm.
> So i have to compute in sensors.conf:
> RPM = (1.5×10^6)/ Count

Almost all chips do that, but that's not the point. Our sysfs-interface
standard says that the conversion to RPM must occur in the driver and
not in user-space. So the f75375 driver needs to be updated.

> > +#define SENSORS_F75373_FAN_FEATURES(nr) \
> > +        { { SENSORS_F75373_FAN(nr), "fan" #nr, \
> > +                NOMAP, NOMAP, R }, \
> > +                NOSYSCTL, VALUE(2), 0 }, \
> > +        { { SENSORS_F75373_FAN_MAX(nr), "fan" #nr "_max", \
> > +                SENSORS_F75373_FAN(nr), SENSORS_F75373_FAN(nr), RW }, \
> > +                NOSYSCTL, VALUE(1), 0 }, \
> >
> > Strange, I've never seen a fan speed sensor with a high limit. What
> > does it correspond to exactly? Why don't you display this value in
> > "sensors"?
>
> I get the information out of the documentation on page 26:
> "When power on, the PWMOUT1 will output full duty cycle (FFh) to
> enable system FAN. After 10 seconds when detecting FANIN1
> signal, assuming the fan has been fully turned on, the fan speed
> count detected will be recorded in the register.".
> Dunno if it should be removed?

Oh, I see, it is recording the maximum possible speed. It should be
marked read-only then, I guess. I am also reluctant to naming this
feature fan1_max, even if we don't use that name yet, because the _max
suffix is only used for limits at the moment so it might be confusing
to use _max for something else now. Maybe fan1_full? This should be
discussed separately. In the meantime, I suggest that you omit this
value in libsensors.

> > +        { { SENSORS_F75373_FAN_MIN(nr), "fan" #nr "_min", \
> > +                SENSORS_F75373_FAN(nr), NOMAP, R }, \
> > +                NOSYSCTL, VALUE(1), 0 }
> >
> > SENSORS_F75373_FAN(nr) instead of NOMAP.
> >
> > Is it really read-only?
>
> I changed it to SENSORS_F75373_FAN(nr), it is RW.
> But fanX_min is allways zero, so it lead to an error on calling
> 'sensors_get_feature(*name, SENSORS_F75373_FAN_MIN(i), &min)',
> i have to disable it, sensors output is now
> CPU Fan:  1866 RPM  (min =    0 RPM)
> to
> CPU Fan:  1866 RPM

fan1_min = 0 isn't an error per se. If you see an error, then something
else must be wrong. Can you read the value from fan1_min directly from
sysfs?

> > +#define SENSORS_F75373_PWM_FEATURES(nr) \
> > +        { { SENSORS_F75373_PWM(nr), "pwm" #nr, \
> > +                NOMAP, NOMAP, RW }, \
> > +                NOSYSCTL, VALUE(1), 0 }, \
> > +        { { SENSORS_F75373_PWM_ENABLE(nr), "pwm" #nr "_enable", \
> > +                SENSORS_F75373_PWM(nr), SENSORS_F75373_PWM(nr), RW }, \
> > +                NOSYSCTL, VALUE(3), 0 }
> >
> > In fact we don't include PWM stuff in libsensors. They are not sensors,
> > and are better handled using pwmconfig and fancontrol.
>
> I only copied it from SENSORS_DME1737_PWM_FEATURES, should i remove it?

Ah, I hadn't noticed that the DME1737 had definitions for PWM. It's
more of an exception than the rule. So yes, please remove the PWM stuff.

> > +    if (valid) {
> > +      print_label(label, 10);
> > +      print_temp_info(cur, max, 0, HYST , 0, 0);
> > +      printf("%s\n", alarm ? "ALARM" : "");
> > +    }
> >
> > This doesn't make sense. What is SENSORS_F75373_TEMP_HYST exactly? Why
> > do you display it as an alarm?
>
> It was a mistake, i deleted the Alarm output, now it is only printf("\n"),
> there seems not to be a value for an alarm.
> temp1_max_hyst is always zero, i don't now what it is exactly and
> when it is not zero.

temp1_max_hyst is supposed to represent the hysteresis temperature
value for the temp1_max limit, and the value should be passed as the
3rd argument to print_temp_info(). If it reads 0, maybe that's a driver
bug. Again, try reading the value directly from sysfs. And please
report the problems you find to the driver author so that he can fix
them.

> >       { "coretemp", print_coretemp },
> >       { "dme1737", print_dme1737 },
> >      { "applesmc", print_applesmc },
> > +    { "F75373", print_f75373 },
> >
> > Should be "f75373", no capital. I'm even surprised it worked with the
> > capital.
>
> If i use f75373 i get following output:
> F75373-i2c-1-2d
> Adapter: SMBus nForce2 adapter at 5100
> VCC: 1720.00 (in0)
>   in0_min: 0.00 (in0_min)
>   in0_max: 0.00 (in0_max)
> V1: 1336.00 (in1)
>   in1_min: 0.00 (in1_min)
>   in1_max: 0.00 (in1_max)
> V2: 1008.00 (in2)
>   in2_min: 0.00 (in2_min)
>   in2_max: 0.00 (in2_max)
> V3: 792.00 (in3)
>   in3_min: 0.00 (in3_min)
>   in3_max: 0.00 (in3_max)
> CPU Temp: 49.00 (temp1)
>   temp1_max: 0.00 (temp1_max)
>   temp1_hyst: 0.00 (temp1_hyst)
> Sys Temp: 46.00 (temp2)
>   temp2_max: 0.00 (temp2_max)
>   temp2_hyst: 0.00 (temp2_hyst)
> CPU Fan: 1787.84 (fan1)
>   fan1_max: 5681.82 (fan1_max)
> ERROR: Can't get feature `fan1_min' data!
> CPU PWM: 31.00 (pwm1)
> What's the reason? Did I still have to use "F75373"?

I see. This suggests that the driver itself identifies the chip as
F75373, and that's not correct. You need to put "f75373" in sensors,
and the driver needs to be updated in the same way.

> > Also, what about the F75375 support? As far as I know the f75375s
> >  driver
> > supports both chips, so it'd be nice to have user-space support for
> > both. Also, it might be less confusing to use F75375 for all the
> > libsensors defines, rather than F75373, so that they match the driver
> > name.
>
> I changed every define/function from F75373 to F75375, i added also:
> #define SENSORS_F75373_PREFIX "f75373"
> #define SENSORS_F75375_PREFIX "f75375"
> and
> { SENSORS_F75375_PREFIX, f75375_features },
> { SENSORS_F75373_PREFIX, f75375_features },
> and
> { "F75375", print_f75375 },
> { "F75373", print_f75375 },

Except for the leading capital, yes, it's OK. That being said, what's
the difference between the F75373 and the F75375? If the F75375 has
less inputs, then you'll need to adjust the code in "sensors" to not
try to display the missing inputs.

Thanks,
-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [lm-sensors] Help needed for implementing&testing Fintek F75375
  2007-06-12 17:29 [lm-sensors] Help needed for implementing&testing Fintek F75375 Christian Emmerich
                   ` (8 preceding siblings ...)
  2007-06-26 18:19 ` Jean Delvare
@ 2007-06-27 13:23 ` Riku Voipio
  2007-06-27 19:41 ` Voipio Riku
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Riku Voipio @ 2007-06-27 13:23 UTC (permalink / raw)
  To: lm-sensors

Jean Delvare wrote:
>>> Did pwmconfig work?
>>>       
>> I get it working now, i just have to set FCTEMPS and FCFANS correct in /etc/fancontrol now it work.
>> The only problem is, that if i stop fancontrol, the program set pwm1_enable to 0, but
>> after this the fan turns at 23rpm. This also happens if i set pwm1_enable to 0 by hand.
>>     
>
> Sounds like a bug in the driver then. Setting pwm1_enable to 0 should
> turn the fan to full speed.
>   
The sysfs interface states that pwm_enable to 0 turns off pwm control... 
How would that turn fans to full speed?

>
>   
>>> Lastly, you really shouldn't have to divide the values by 1000. This
>>> suggests that the magnitude wasn't set properly in libsensors (it
>>> should be 3, I suggest it is 0). This issue is most probably related to
>>> the incorrect symbol names.
>>>       
>> I saw values >800V so i thought i have to divide it by 1000 in sensors.conf.
>> Magnitude is 3 and the symbol name is correct now, but the values are still
>> over 800V. What's the reason?
>>     
>
> I guess that's a bug in the driver. What values do you see in the
> in*_input sysfs files?
>
>   
Fixed.
>>> This means that the driver isn't reporting the values in RPM as it
>>> should. Usually no compute statement is needed for fans.
>>>       
>> That's correct, the value is not in RPM, in the document '2005111153128.pdf' you can download on the fintek page
>> ( http://www.fintek.com.tw/eng/products.asp?BID=4&SID=5 )its written on page 8:
>> "Determine the fan counter according to:
>> Count = (1.5×10^6) / RPM "
>> That means that the driver is reporting the count value, not the rpm.
>> So i have to compute in sensors.conf:
>> RPM = (1.5×10^6)/ Count
>>     
>
> Almost all chips do that, but that's not the point. Our sysfs-interface
> standard says that the conversion to RPM must occur in the driver and
> not in user-space. So the f75375 driver needs to be updated.
>   
Will be fixed..
>>> +#define SENSORS_F75373_FAN_FEATURES(nr) \
>>> +        { { SENSORS_F75373_FAN(nr), "fan" #nr, \
>>> +                NOMAP, NOMAP, R }, \
>>> +                NOSYSCTL, VALUE(2), 0 }, \
>>> +        { { SENSORS_F75373_FAN_MAX(nr), "fan" #nr "_max", \
>>> +                SENSORS_F75373_FAN(nr), SENSORS_F75373_FAN(nr), RW }, \
>>> +                NOSYSCTL, VALUE(1), 0 }, \
>>>
>>> Strange, I've never seen a fan speed sensor with a high limit. What
>>> does it correspond to exactly? Why don't you display this value in
>>> "sensors"?
>>>       
>> I get the information out of the documentation on page 26:
>> "When power on, the PWMOUT1 will output full duty cycle (FFh) to
>> enable system FAN. After 10 seconds when detecting FANIN1
>> signal, assuming the fan has been fully turned on, the fan speed
>> count detected will be recorded in the register.".
>> Dunno if it should be removed?
>>     
>   
> Oh, I see, it is recording the maximum possible speed. It should be
> marked read-only then, I guess. I am also reluctant to naming this
> feature fan1_max, even if we don't use that name yet, because the _max
> suffix is only used for limits at the moment so it might be confusing
> to use _max for something else now. Maybe fan1_full? This should be
> discussed separately. In the meantime, I suggest that you omit this
> value in libsensors.
>
>   
It is alreadt readonly. I think renaming to full is a good idea, that's 
what the
datasheet calls it as well.

> fan1_min = 0 isn't an error per se. If you see an error, then something
> else must be wrong. Can you read the value from fan1_min directly from
> sysfs?
>
>   
it was not getting updated in f75375_update_device, fixed. The actual 
value should
be written to the chip anyway.
>
> temp1_max_hyst is supposed to represent the hysteresis temperature
> value for the temp1_max limit, and the value should be passed as the
> 3rd argument to print_temp_info(). If it reads 0, maybe that's a driver
> bug. Again, try reading the value directly from sysfs. And please
> report the problems you find to the driver author so that he can fix
> them.
>   
This weirder, it should actually update it properly.
>   
>>>       { "coretemp", print_coretemp },
>>>       { "dme1737", print_dme1737 },
>>>      { "applesmc", print_applesmc },
>>> +    { "F75373", print_f75373 },
>>>
>>> Should be "f75373", no capital. I'm even surprised it worked with the
>>> capital.
> I see. This suggests that the driver itself identifies the chip as
> F75373, and that's not correct. You need to put "f75373" in sensors,
> and the driver needs to be updated in the same way.
>
>   
This is being set as the client->name, I'll change that to lower case.
> Except for the leading capital, yes, it's OK. That being said, what's
> the difference between the F75373 and the F75375? If the F75375 has
> less inputs, then you'll need to adjust the code in "sensors" to not
> try to display the missing inputs.
>   
The main difference is that F75375 supports more fan speed control modes 
than
F75373: automatic temperature triggered fan-speed setting and linear 
voltage feeding
to fan. Only the latter is supported by the driver atm.

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [lm-sensors] Help needed for implementing&testing Fintek F75375
  2007-06-12 17:29 [lm-sensors] Help needed for implementing&testing Fintek F75375 Christian Emmerich
                   ` (9 preceding siblings ...)
  2007-06-27 13:23 ` Riku Voipio
@ 2007-06-27 19:41 ` Voipio Riku
  2007-06-28  7:32 ` Christian Emmerich
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Voipio Riku @ 2007-06-27 19:41 UTC (permalink / raw)
  To: lm-sensors


>> This means that the driver isn't reporting the values in RPM as it
>> should. Usually no compute statement is needed for fans.
> That's correct, the value is not in RPM, in the document
> '2005111153128.pdf' you can download on the fintek page
> ( http://www.fintek.com.tw/eng/products.asp?BID=4&SID=5 )its written on
> page 8:
> "Determine the fan counter according to:
> Count = (1.5×10^6) / RPM "
> That means that the driver is reporting the count value, not the rpm.
> So i have to compute in sensors.conf:
> RPM = (1.5×10^6)/ Count

Thus this algorithm actually return sane RPM values for you? Now I
remember why I did not use this - Here the "Count" rises linear, which
makes "RPM =(1.5×10^6)/ Count" *lower* when fan speed increases. OTOH it
might be the fan is just too small and thus rotates too fast to be
reliably measured..

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [lm-sensors] Help needed for implementing&testing Fintek F75375
  2007-06-12 17:29 [lm-sensors] Help needed for implementing&testing Fintek F75375 Christian Emmerich
                   ` (10 preceding siblings ...)
  2007-06-27 19:41 ` Voipio Riku
@ 2007-06-28  7:32 ` Christian Emmerich
  2007-06-29  6:04 ` Jean Delvare
  2007-07-10 19:44 ` Christian Emmerich
  13 siblings, 0 replies; 15+ messages in thread
From: Christian Emmerich @ 2007-06-28  7:32 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 1910 bytes --]

Hello
 
 >>> This means that the driver isn't reporting the values in RPM as it
 >>> should. Usually no compute statement is needed for fans.
 >> That's correct, the value is not in RPM, in the document
 >> '2005111153128.pdf' you can download on the fintek page
 >> ( http://www.fintek.com.tw/eng/products.asp?BID=4&SID=5 )its written on
 >> page 8:
 >> "Determine the fan counter according to:
 >> Count = (1.5×10^6) / RPM "
 >> That means that the driver is reporting the count value, not the rpm.
 >> So i have to compute in sensors.conf:
 >> RPM = (1.5×10^6)/ Count
 >
 >Thus this algorithm actually return sane RPM values for you? Now I
 >remember why I did not use this - Here the "Count" rises linear, which
 >makes "RPM =(1.5×10^6)/ Count" *lower* when fan speed increases. OTOH it
 >might be the fan is just too small and thus rotates too fast to be
 >reliably measured..
 
 During implementation i tested  different values for pwm here are my results:
 pwm1  fan1      fanspeed ( using: fanspeed =(1.5×10^6)/ fan1-value )
 value value
  13   2600      ~570 rpm
  14   1900       :
  15   1900       :
  23   1100       :
  34    770     ~1950 rpm
   :     :        :
  90    385     ~3900 rpm
  95    375     ~4000 rpm
 100    365     ~4180 rpm
 105    360     ~4230 rpm
 110    345     ~4360 rpm
 115    345     ~4360 rpm
 120    335     ~4500 rpm
 125    330     ~4630 rpm
 
 
 So if i start my pc the pwm is at ~32 and the fan is turning at ~1800rpm. If i increase
 the pwm value the value of the counter decreased! So if the pwm value is ~110 the van turns at >4000rpm
 and the fan1 value is ~365.
 The pc i use is a barebone by AOpen with an special mainboard and fan, both comes with the barebone.
 
 best regards
 christian.
       
---------------------------------
 Die etwas anderen Infos rund um das Thema Reisen. BE A BETTER WELTENBUMMLER!

[-- Attachment #1.2: Type: text/html, Size: 5942 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [lm-sensors] Help needed for implementing&testing Fintek F75375
  2007-06-12 17:29 [lm-sensors] Help needed for implementing&testing Fintek F75375 Christian Emmerich
                   ` (11 preceding siblings ...)
  2007-06-28  7:32 ` Christian Emmerich
@ 2007-06-29  6:04 ` Jean Delvare
  2007-07-10 19:44 ` Christian Emmerich
  13 siblings, 0 replies; 15+ messages in thread
From: Jean Delvare @ 2007-06-29  6:04 UTC (permalink / raw)
  To: lm-sensors

On Thu, 28 Jun 2007 09:32:10 +0200 (CEST), Christian Emmerich wrote:
>  >Thus this algorithm actually return sane RPM values for you? Now I
>  >remember why I did not use this - Here the "Count" rises linear, which
>  >makes "RPM =(1.5×10^6)/ Count" *lower* when fan speed increases. OTOH it
>  >might be the fan is just too small and thus rotates too fast to be
>  >reliably measured..
>  
>  During implementation i tested  different values for pwm here are my results:
>  pwm1  fan1      fanspeed ( using: fanspeed =(1.5×10^6)/ fan1-value )
>  value value
>   13   2600      ~570 rpm
>   14   1900       :
>   15   1900       :
>   23   1100       :
>   34    770     ~1950 rpm
>    :     :        :
>   90    385     ~3900 rpm
>   95    375     ~4000 rpm
>  100    365     ~4180 rpm
>  105    360     ~4230 rpm
>  110    345     ~4360 rpm
>  115    345     ~4360 rpm
>  120    335     ~4500 rpm
>  125    330     ~4630 rpm
>  
>  
>  So if i start my pc the pwm is at ~32 and the fan is turning at ~1800rpm. If i increase
>  the pwm value the value of the counter decreased!

Yes, this is expected. The counter value is proportional to the time
the fan needed to achieve one revolution, so a greater counter means a
slower fan and vice versa.

>  So if the pwm value is ~110 the van turns at >4000rpm
>  and the fan1 value is ~365.
>  The pc i use is a barebone by AOpen with an special mainboard and fan, both comes with the barebone.

It seems to work OK. So the conversion from count to RPM should be
moved to the kernel driver.

Thanks,
-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [lm-sensors] Help needed for implementing&testing Fintek F75375
  2007-06-12 17:29 [lm-sensors] Help needed for implementing&testing Fintek F75375 Christian Emmerich
                   ` (12 preceding siblings ...)
  2007-06-29  6:04 ` Jean Delvare
@ 2007-07-10 19:44 ` Christian Emmerich
  13 siblings, 0 replies; 15+ messages in thread
From: Christian Emmerich @ 2007-07-10 19:44 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 7913 bytes --]

Hi Jean,

> The reject message explained that you shouldn't be sending HTML mails.
> This makes your mails more than twice as big as they should, and that
> explains the reject.
Sorry, i'm not able to change it. I'm using just a freemail account.

> Sounds like a bug in the driver then. Setting pwm1_enable to 0 should
> turn the fan to full speed.
Fixed, using new driver version lets the fan turn to full speed.

> > I try to set limits in sensors.conf but i could see no change.
>
> You must run "sensors -s" after changing the limits
> in /etc/sensors.conf for the new limits to be applied. Please test this,
> this is a good way to test both the libsensors code you added, and the
> driver itself.
After using "sensors -s" i can see the limits i set in sensors.conf (e.g. "VCC: +1.72 V (min = +1.65 V, max = +1.85 V)").
But a inx_alarm is missing, so i see only the values.
What would be a good value for the sensors.conf.eg entry e.g.
set in0_min   1.72 * 0.95
set in0_max   1.72 * 1.05 ?

> > > Lastly, you really shouldn't have to divide the values by 1000. This
> > > suggests that the magnitude wasn't set properly in libsensors (it
> > > should be 3, I suggest it is 0). This issue is most probably related to
> > > the incorrect symbol names.
> >
> > I saw values >800V so i thought i have to divide it by 1000 in sensors.conf.
> > Magnitude is 3 and the symbol name is correct now, but the values are still
> > over 800V. What's the reason?
>
> I guess that's a bug in the driver. What values do you see in the
> in*_input sysfs files?
Fixed, if i use the new driver version i can see correct values (e.g. 1.72V).

> > > This means that the driver isn't reporting the values in RPM as it
> > > should. Usually no compute statement is needed for fans.
> >
> > That's correct, the value is not in RPM, in the document '2005111153128.pdf' you can download on the fintek page
> > ( http://www.fintek.com.tw/eng/products.asp?BID=4&SID=5 )its written on page 8:
> > "Determine the fan counter according to:
> > Count = (1.5×10^6) / RPM "
> > That means that the driver is reporting the count value, not the rpm.
> > So i have to compute in sensors.conf:
> > RPM = (1.5×10^6)/ Count
>
> Almost all chips do that, but that's not the point. Our sysfs-interface
> standard says that the conversion to RPM must occur in the driver and
> not in user-space. So the f75375 driver needs to be updated.
Fixed, if i use the new driver version i can see correct values (e.g. 2329 RPM).

> > > +#define SENSORS_F75373_FAN_FEATURES(nr) \
> > > +        { { SENSORS_F75373_FAN(nr), "fan" #nr, \
> > > +                NOMAP, NOMAP, R }, \
> > > +                NOSYSCTL, VALUE(2), 0 }, \
> > > +        { { SENSORS_F75373_FAN_MAX(nr), "fan" #nr "_max", \
> > > +                SENSORS_F75373_FAN(nr), SENSORS_F75373_FAN(nr), RW }, \
> > > +                NOSYSCTL, VALUE(1), 0 }, \
> > >
> > > Strange, I've never seen a fan speed sensor with a high limit. What
> > > does it correspond to exactly? Why don't you display this value in
> > > "sensors"?
> >
> > I get the information out of the documentation on page 26:
> > "When power on, the PWMOUT1 will output full duty cycle (FFh) to
> > enable system FAN. After 10 seconds when detecting FANIN1
> > signal, assuming the fan has been fully turned on, the fan speed
> > count detected will be recorded in the register.".
> > Dunno if it should be removed?
>
> Oh, I see, it is recording the maximum possible speed. It should be
> marked read-only then, I guess. I am also reluctant to naming this
> feature fan1_max, even if we don't use that name yet, because the _max
> suffix is only used for limits at the moment so it might be confusing
> to use _max for something else now. Maybe fan1_full? This should be
> discussed separately. In the meantime, I suggest that you omit this
> value in libsensors.
I have omited the fan1_max/_full part.

> > > +        { { SENSORS_F75373_FAN_MIN(nr), "fan" #nr "_min", \
> > > +                SENSORS_F75373_FAN(nr), NOMAP, R }, \
> > > +                NOSYSCTL, VALUE(1), 0 }
> > >
> > > SENSORS_F75373_FAN(nr) instead of NOMAP.
> > >
> > > Is it really read-only?
> >
> > I changed it to SENSORS_F75373_FAN(nr), it is RW.
> > But fanX_min is allways zero, so it lead to an error on calling
> > 'sensors_get_feature(*name, SENSORS_F75373_FAN_MIN(i), &min)',
> > i have to disable it, sensors output is now
> > CPU Fan:  1866 RPM  (min =    0 RPM)
> > to
> > CPU Fan:  1866 RPM
>
> fan1_min = 0 isn't an error per se. If you see an error, then something
> else must be wrong. Can you read the value from fan1_min directly from
> sysfs?
Yes, i read 0 directly from sysfs, but i can set another value, i've discussed it with Riku Voipio, the author of the driver, he said maybe my bios is setting it to zero.
Should the fanx_min value be displayed using sensors (e.g. "CPU Fan:  1866 RPM  (min =  4242 RPM)" ) ?

> >
> > I only copied it from SENSORS_DME1737_PWM_FEATURES, should i remove it?
>
> Ah, I hadn't noticed that the DME1737 had definitions for PWM. It's
> more of an exception than the rule. So yes, please remove the PWM stuff.
I deleted the PWM- stuff.

> > > +    if (valid) {
> > > +      print_label(label, 10);
> > > +      print_temp_info(cur, max, 0, HYST , 0, 0);
> > > +      printf("%s\n", alarm ? "ALARM" : "");
> > > +    }
> > >
> > > This doesn't make sense. What is SENSORS_F75373_TEMP_HYST exactly? Why
> > > do you display it as an alarm?
> >
> > It was a mistake, i deleted the Alarm output, now it is only printf("\n"),
> > there seems not to be a value for an alarm.
> > temp1_max_hyst is always zero, i don't now what it is exactly and
> > when it is not zero.
>
> temp1_max_hyst is supposed to represent the hysteresis temperature
> value for the temp1_max limit, and the value should be passed as the
> 3rd argument to print_temp_info(). If it reads 0, maybe that's a driver
> bug. Again, try reading the value directly from sysfs. And please
> report the problems you find to the driver author so that he can fix
> them.
>
tempx_max_hyst is always zero:
<output>
root@pc:/sys/devices/pci0000:00/0000:00:01.1/i2c-2/2-002d# cat temp1_max_hyst
0
</output>
but i can set it by hand. It's now shown ( e.g. "CPU Temp:    +47°C  (high =   +54°C, hyst =   +41°C)" ).

> > ERROR: Can't get feature `fan1_min' data!
> > CPU PWM: 31.00 (pwm1)
> > What's the reason? Did I still have to use "F75373"?
>
> I see. This suggests that the driver itself identifies the chip as
> F75373, and that's not correct. You need to put "f75373" in sensors,
> and the driver needs to be updated in the same way.
Fixed in the driver.

> > > Also, what about the F75375 support? As far as I know the f75375s
> > >  driver
> > > supports both chips, so it'd be nice to have user-space support for
> > > both. Also, it might be less confusing to use F75375 for all the
> > > libsensors defines, rather than F75373, so that they match the driver
> > > name.
> >
> > I changed every define/function from F75373 to F75375, i added also:
> > #define SENSORS_F75373_PREFIX "f75373"
> > #define SENSORS_F75375_PREFIX "f75375"
> > and
> > { SENSORS_F75375_PREFIX, f75375_features },
> > { SENSORS_F75373_PREFIX, f75375_features },
> > and
> > { "F75375", print_f75375 },
> > { "F75373", print_f75375 },
>
> Except for the leading capital, yes, it's OK. That being said, what's
> the difference between the F75373 and the F75375? If the F75375 has
> less inputs, then you'll need to adjust the code in "sensors" to not
> try to display the missing inputs.
Fixed i can now use f75375 & f75373.


best regards
christian.

       
---------------------------------
Beginnen Sie den Tag mit den neuesten Nachrichten. Machen Sie Yahoo! zu Ihrer Startseite!

[-- Attachment #1.2: Type: text/html, Size: 21799 bytes --]

[-- Attachment #2: pat943948581 --]
[-- Type: application/octet-stream, Size: 7800 bytes --]

diff -urN lm-sensors_org/etc/sensors.conf.eg lm-sensors/etc/sensors.conf.eg
--- lm-sensors_org/etc/sensors.conf.eg	2007-07-02 18:56:00.000000000 +0200
+++ lm-sensors/etc/sensors.conf.eg	2007-07-10 20:01:37.000000000 +0200
@@ -2927,3 +2927,23 @@
     compute in6       (@ * 5.25), (@ / 5.25)
     compute in7       (@ * 2), (@ / 2)
     compute in8       (@ * 2), (@ / 2)
+
+
+#
+# Sample configuration for the Fintek F75375/F75373S
+#
+chip "f75375-*" "f75373-*"
+
+# Voltages
+   label in0 "VCC"
+   label in1 "V1"
+   label in2 "V2"
+   label in3 "V3"
+    
+# Fans
+   label fan1 "CPU Fan"
+   label fan2 "Sys Fan"
+
+# Temperatures
+   label temp1 "CPU Temp"
+   label temp2 "Sys Temp"
diff -urN lm-sensors_org/lib/chips.c lm-sensors/lib/chips.c
--- lm-sensors_org/lib/chips.c	2007-07-02 18:55:59.000000000 +0200
+++ lm-sensors/lib/chips.c	2007-07-10 21:13:08.000000000 +0200
@@ -6217,6 +6217,49 @@
 	{ { 0 }, 0 }
 };
 
+#define SENSORS_F75375_IN_FEATURES(nr) \
+        { { SENSORS_F75375_IN(nr), "in" #nr, \
+                NOMAP, NOMAP, R }, \
+                NOSYSCTL, VALUE(3), 3 }, \
+        { { SENSORS_F75375_IN_MIN(nr), "in" #nr "_min", \
+                SENSORS_F75375_IN(nr), SENSORS_F75375_IN(nr), RW }, \
+                NOSYSCTL, VALUE(1), 3 }, \
+        { { SENSORS_F75375_IN_MAX(nr), "in" #nr "_max", \
+                SENSORS_F75375_IN(nr), SENSORS_F75375_IN(nr), RW }, \
+                NOSYSCTL, VALUE(2), 3 }
+
+#define SENSORS_F75375_TEMP_FEATURES(nr) \
+        { { SENSORS_F75375_TEMP(nr), "temp" #nr, \
+                NOMAP, NOMAP, R }, \
+                NOSYSCTL, VALUE(3), 3 }, \
+        { { SENSORS_F75375_TEMP_MAX(nr), "temp" #nr "_max", \
+                SENSORS_F75375_TEMP(nr), SENSORS_F75375_TEMP(nr), RW }, \
+                NOSYSCTL, VALUE(1), 3 }, \
+        { { SENSORS_F75375_TEMP_HYST(nr), "temp" #nr "_hyst", \
+                SENSORS_F75375_TEMP(nr), SENSORS_F75375_TEMP(nr), RW }, \
+                NOSYSCTL, VALUE(2), 3 }
+
+#define SENSORS_F75375_FAN_FEATURES(nr) \
+        { { SENSORS_F75375_FAN(nr), "fan" #nr, \
+                NOMAP, NOMAP, R }, \
+                NOSYSCTL, VALUE(2), 0 }, \
+        { { SENSORS_F75375_FAN_MIN(nr), "fan" #nr "_min", \
+                SENSORS_F75375_FAN(nr), SENSORS_F75375_FAN(nr), RW }, \
+                NOSYSCTL, VALUE(1), 0 }
+
+static sensors_chip_feature f75375_features[] =
+{
+        SENSORS_F75375_IN_FEATURES(0),
+        SENSORS_F75375_IN_FEATURES(1),
+        SENSORS_F75375_IN_FEATURES(2),
+        SENSORS_F75375_IN_FEATURES(3),
+        SENSORS_F75375_TEMP_FEATURES(1),
+        SENSORS_F75375_TEMP_FEATURES(2),
+        SENSORS_F75375_FAN_FEATURES(1),
+        SENSORS_F75375_FAN_FEATURES(2),
+        { { 0 }, 0 }
+};
+
 sensors_chip_features sensors_chip_features_list[] =
 {
  { SENSORS_LM78_PREFIX, lm78_features },
@@ -6334,5 +6377,7 @@
  { SENSORS_DME1737_PREFIX, dme1737_features },
  { SENSORS_APPLESMC_PREFIX, applesmc_features },
  { SENSORS_F71882FG_PREFIX, f71882fg_features },
+ { SENSORS_F75375_PREFIX, f75375_features },
+ { SENSORS_F75373_PREFIX, f75375_features },
  { 0 }
 };
diff -urN lm-sensors_org/lib/chips.h lm-sensors/lib/chips.h
--- lm-sensors_org/lib/chips.h	2007-07-02 18:55:59.000000000 +0200
+++ lm-sensors/lib/chips.h	2007-07-10 20:34:03.000000000 +0200
@@ -2337,4 +2337,25 @@
 #define SENSORS_F71882FG_TEMP_FAULT(n)		(140 + (n))
 #define SENSORS_F71882FG_TEMP_TYPE(n)		(150 + (n))
 
+/* Fintek F75375/F75373S registers  */
+
+#define SENSORS_F75373_PREFIX "f75373"
+#define SENSORS_F75375_PREFIX "f75375"
+
+/* voltage n from 1 to 4 */
+#define SENSORS_F75375_IN(nr)           (0x01 + (nr))
+#define SENSORS_F75375_IN_MAX(nr)       (0x11 + (nr) * 2)
+#define SENSORS_F75375_IN_MIN(nr)       (0x21 + (nr) * 2)
+
+/* temp n from 1 to 2 */
+#define SENSORS_F75375_TEMP(nr)         (0x31 + (nr))
+#define SENSORS_F75375_TEMP_MAX(nr)     (0x41 + (nr) * 2)
+#define SENSORS_F75375_TEMP_HYST(nr)    (0x51 + (nr) * 2)
+
+/* fan n from 1 to 2 */
+#define SENSORS_F75375_FAN(nr)          (0x61 + (nr) * 2)
+#define SENSORS_F75375_FAN_MIN(nr)      (0x71 + (nr) * 2)
+/* FAN Full Speed Count Register */
+#define SENSORS_F75375_FAN_FULL(nr)      (0x81 + (nr) * 0x10)
+
 #endif /* def LIB_SENSORS_CHIPS_H */
diff -urN lm-sensors_org/prog/sensors/chips.c lm-sensors/prog/sensors/chips.c
--- lm-sensors_org/prog/sensors/chips.c	2007-07-02 18:56:00.000000000 +0200
+++ lm-sensors/prog/sensors/chips.c	2007-07-10 20:09:54.000000000 +0200
@@ -6254,6 +6254,89 @@
     print_f71882fg_temp(name, i);
 }
 
+static void print_f75375_in(const sensors_chip_name *name, int i)
+{
+  char *label;
+  double cur, min, max;
+  int valid;
+
+  if (!sensors_get_label_and_valid(*name, SENSORS_F75375_IN(i), &label,
+                                  &valid) &&
+      !sensors_get_feature(*name, SENSORS_F75375_IN(i), &cur) &&
+      !sensors_get_feature(*name, SENSORS_F75375_IN_MAX(i), &max) &&
+      !sensors_get_feature(*name, SENSORS_F75375_IN_MIN(i), &min)) {
+    if (valid) {
+      print_label(label, 10);
+      printf("%+6.2f V  (min = %+6.2f V, max = %+6.2f V)\n",
+             cur, min, max);
+    }
+  } else {
+    printf("ERROR: Can't get in%d data!\n", i);
+  }
+  free(label);
+}
+
+static void print_f75375_temp(const sensors_chip_name *name, int i)
+{
+  char *label;
+  double cur, max, hyst;
+  int valid;
+
+  if (!sensors_get_label_and_valid(*name, SENSORS_F75375_TEMP(i), &label,
+                                   &valid) &&
+      !sensors_get_feature(*name, SENSORS_F75375_TEMP(i), &cur) &&
+      !sensors_get_feature(*name, SENSORS_F75375_TEMP_MAX(i), &max) &&
+      !sensors_get_feature(*name, SENSORS_F75375_TEMP_HYST(i), &hyst)) {
+    if (valid) {
+      print_label(label, 10);
+      print_temp_info(cur, max, hyst, HYST, 0, 0);
+      printf("\n");
+    }
+  } else {
+    printf("ERROR: Can't get temp%d data!\n", i);
+  }
+  free(label);
+}
+
+static void print_f75375_fan(const sensors_chip_name *name, int i)
+{
+  char *label;
+  double cur;
+  int valid;
+
+  if (!sensors_get_label_and_valid(*name, SENSORS_F75375_FAN(i), &label,
+                                   &valid) &&
+      !sensors_get_feature(*name, SENSORS_F75375_FAN(i), &cur)) {
+    if (valid) {
+      print_label(label, 10);
+      /*printf("%4.0f RPM  (min = %4.0f RPM)\n", 
+             cur, min);*/
+      printf("%4.0f RPM\n",
+             cur);
+    }
+  } else {
+    printf("ERROR: Can't get fan%d data!\n", i);
+  }
+  free(label);
+}
+
+void print_f75375(const sensors_chip_name *name)
+{
+  int i;
+
+  for (i = 0; i <= 3; i++) {
+    print_f75375_in(name, i);
+  }
+
+  for (i = 1; i <= 2; i++) {
+    print_f75375_temp(name, i);
+  }
+
+  for (i = 1; i <= 2; i++) {
+    print_f75375_fan(name, i);
+  }
+}
+
 void print_unknown_chip(const sensors_chip_name *name)
 {
   int a,b,valid;
diff -urN lm-sensors_org/prog/sensors/chips.h lm-sensors/prog/sensors/chips.h
--- lm-sensors_org/prog/sensors/chips.h	2007-07-02 18:56:00.000000000 +0200
+++ lm-sensors/prog/sensors/chips.h	2007-07-10 20:09:54.000000000 +0200
@@ -80,5 +80,6 @@
 extern void print_dme1737(const sensors_chip_name *name);
 extern void print_applesmc(const sensors_chip_name *name);
 extern void print_f71882fg(const sensors_chip_name *name);
+extern void print_f75375(const sensors_chip_name *name);
 
 #endif /* def PROG_SENSORS_CHIPS_H */
diff -urN lm-sensors_org/prog/sensors/main.c lm-sensors/prog/sensors/main.c
--- lm-sensors_org/prog/sensors/main.c	2007-07-02 18:56:00.000000000 +0200
+++ lm-sensors/prog/sensors/main.c	2007-07-10 20:32:55.000000000 +0200
@@ -426,6 +426,8 @@
  	{ "dme1737", print_dme1737 },
 	{ "applesmc", print_applesmc },
 	{ "f71882fg", print_f71882fg },
+        { "f75375", print_f75375 },
+        { "f75373", print_f75375 },
 	{ NULL, NULL }
 };
 

[-- Attachment #3: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2007-07-10 19:44 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-12 17:29 [lm-sensors] Help needed for implementing&testing Fintek F75375 Christian Emmerich
2007-06-14 19:39 ` Jean Delvare
2007-06-15  6:53 ` Christian Emmerich
2007-06-17 14:14 ` Christian Emmerich
2007-06-18  8:18 ` Jean Delvare
2007-06-18 13:01 ` Christian Emmerich
2007-06-18 16:58 ` Christian Emmerich
2007-06-23 12:29 ` Jean Delvare
2007-06-25  5:19 ` Christian Emmerich
2007-06-26 18:19 ` Jean Delvare
2007-06-27 13:23 ` Riku Voipio
2007-06-27 19:41 ` Voipio Riku
2007-06-28  7:32 ` Christian Emmerich
2007-06-29  6:04 ` Jean Delvare
2007-07-10 19:44 ` Christian Emmerich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.