Skip to contentSkip to conversation

W83792 review and testing

lm-sensors Applied Rudolf Marek 3 participants 7 messages Jun 1, 2005 – Jun 6, 2005

lore
Share & tools
lore
#0 lore raw

Hi all,

I created the patch for 2.6.x kernels with Makefile Kconfig and documentation. I'm inviting you to test it, we need to check everyting so please play with it for a while. Set the limits, fan divisors, observe how it changes and how it should change. Please report back any problems or things that you did not expect even after reading documentation :) You can try also the automatic fan regulation interface as described in documenation. (I wrote it with the help of source code so I dont know if it is correct please check it too)

You will need for that latest lm-sensors CVS version.
You can get it here: http://secure.netroedge.com/~lm78/archive/lm_sensors-daily.tar.gz
The patch is in attachment. I think it does not matter if you apply against 2.6.12 or 2.6.11 or even any other 2.6 kernel. As long it does not say HUNK failed than it is OK.

Rest of people here please help me with documentation review.

Documenation file follows here so it will be easy to correct my mistakes.
This is second version, because I accidently overwrote the first one in late night yesterday.

Thanks for the help,

regards

Rudolf

Kernel driver w83792d
==========
Supported chips:
* Winbond W83792D

    Prefix 'w83792d'
    Addresses scanned: I2C 0x2c - 0x2f
    Datasheet: http://www.winbond.com.tw/E-WINBONDHTM/partner/PDFresult.asp?Pname35

Author: Chunhao Huang @ Winbond <[email protected]>

Module Parameters
-----------------

* init int
(default 1)
Use 'init=0' to bypass initializing the chip.
Try this if your computer crashes when you load the module.

* force_subclients=bus,caddr,saddr,saddr
This is used to force the i2c addresses for subclients of a certain chip. Example usage is `force_subclients=0,0x2f,0x4a,0x4b' to force the subclients of chip 0x2f on bus 0 to i2c addresses 0x4a and 0x4b.

Description
-----------

This driver implements support for the Winbond W83792AD/D.

Detection of the chip can sometimes be foiled because it can be in an internal state that allows no clean access (Bank with ID register is not currently chosen). If you know the address of the chip, use a 'force' parameter; this will put it into a more well-behaved state first.

The driver implements three temperature sensors, seven FAN rotation speed sensors, nine voltage sensors, and the Smart Fan I(Thermal Cruise mode) and Smart Fan II sensors.

Temperatures are measured in degrees Celcius and measurement resolution is 0.5 degC. There is one main temperature sensor, and two other sensors. An alarm is triggered when the temperature gets higher then the Overtemperature Shutdown value; it stays on until the temperature falls below the Hysteresis value.

FAN rotation speeds are reported in RPM (rotations per minute). An alarm is triggered if the rotation speed has dropped below a programmable limit. FAN readings can be divided by a programmable divider(1, 2, 4, 8, 16, 32, 64 or
128) to give the readings more range or accuracy.

Voltage sensors (also known as IN sensors) report their values in milivolts. An alarm is triggered if the voltage has crossed a programmable minimum or maximum limit.

Fan and voltage alarm triggers are "software-level" instead of "hardware-level", which means the alarm is triggered when "sensors" program find the measured value exceed the limits, while temperature alams are triggered by the hardware. Fan and voltage alarms cannot be implemented in hardware due to lack of "comparator mode" support in W83792D.

In addition to the alarms described above, there is a CHAS alarm on the chips which triggers if your computer case is open.

The chips only update values each 3 seconds; reading them more often will do no harm, but will return 'old' values.

W83792D PROBLEMS
----------------
Known problems:
- This driver is only for Winbond W83792D C version device, there are also some motherboards with B version W83792D device. The calculation method to in6-in7(measured value, limits) is a little different between C and B version. C or B version can be identified by CR[0x49h].
- The function of vid and vrm has not been finished, because I'm NOT very familiar with them. Adding support is welcomed.
- The function of chassis open detection needs more tests.

Fan control
-----------

Manual mode
-----------

Works as expected. You just need to specify desired PWM/DC value (fan speed) in apropriate pwm# file.

Thermal cruise
--------------

At this mode, W83792D provides the Smart Fan system to automatically control fan speed to keep the temperatures of CPU and the system within specific range. At first a wanted temperature and interval must be set. This is done via thermal_cruise# file. The tolerance# file serves to create T +- tolerance interval. The fan speed will be lowered as long as the current temperature remains below the thermal_cruise# +- tolerance# value. Once the temperature exceeds the high limit (T+tolernace), the fan will be turned on with a specific speed set by pwm# and automatically controlled its PWM duty cycle with the temperature varying. Three conditions may occur:

(1) If the temperature still exceeds the high limit, PWM duty cycle will increase slowly.

(2) If the temperature goes below the high limit, but still above the low limit (T-tolerance), the fan speed will be fixed at the current speed because the temperature is in the target range.

(3) If the temperature goes below the low limit, PWM duty cycle will decrease slowly to 0 or a preset stop value until the temperature exceeds the low limit. (The preset stop value handling is not yet implemented in driver)

Smart Fan II
------------

W83792D also provides a special mode for FAN. Four temperature points are available. When related temperature sensors detects the temperature in preset temperature region (sf2_point@_fan# +- tolerance#) it will cause fans to run on programmed value from sf2_level@_fan#. You need to set four temperatures for each fan.

/sys files
----------

# denotes number any number from 1 to 3
@ denotes number any number from 1 to 4

pwm# - this file stores PWM duty cycle or DC value (fan speed) in range 0 (stop) to 255 (full) pwm#_enable - this file controls mode of fan/temperature control:
* 1 Manual mode
* 2 Smart Fan II
* 3 Thermal Cruise
pwm#_mode - Select PWM of DC mode
* 0 DC
* 1 PWM
thermal_cruise# - Selects the desired temperature for cruise (deg C)
tolerance# - Value in degrees of Celsius (deg C) for +- T

sf2_point@_fan# - four temperature points for each fan for Smart Fan II
sf2_level@_fan# - four PWM/DC levels for each fan for Smart Fan II
-------------- next part --------------
diff -Naur a/Documentation/i2c/chips/w83792d b/Documentation/i2c/chips/w83792d
--- a/Documentation/i2c/chips/w83792d	1970-01-01 01:00:00.000000000 +0100
+++ b/Documentation/i2c/chips/w83792d	2005-06-01 10:08:55.744196856 +0200
@@ -0,0 +1,142 @@
+Kernel driver w83792d
+==========+
+Supported chips:
+  * Winbond W83792D
+    Prefix 'w83792d'
+    Addresses scanned: I2C 0x2c - 0x2f
+    Datasheet: http://www.winbond.com.tw/E-WINBONDHTM/partner/PDFresult.asp?Pname35
+    
+Author: Chunhao Huang @ Winbond <[email protected]>
+
+
+Module Parameters
+-----------------
+
+* init int 
+  (default 1)
+  Use 'init=0' to bypass initializing the chip.
+  Try this if your computer crashes when you load the module.
+
+* force_subclients=bus,caddr,saddr,saddr
+  This is used to force the i2c addresses for subclients of
+  a certain chip. Example usage is `force_subclients=0,0x2f,0x4a,0x4b'
+  to force the subclients of chip 0x2f on bus 0 to i2c addresses
+  0x4a and 0x4b.
+
+
+Description
+-----------
+
+This driver implements support for the Winbond W83792AD/D.
+
+Detection of the chip can sometimes be foiled because it can be in an
+internal state that allows no clean access (Bank with ID register is not
+currently chosen). If you know the address of the chip, use a 'force'
+parameter; this will put it into a more well-behaved state first.
+
+The driver implements three temperature sensors, seven FAN rotation speed
+sensors, nine voltage sensors, and the Smart Fan I(Thermal Cruise mode)
+and Smart Fan II sensors.
+
+Temperatures are measured in degrees Celcius and measurement resolution is
+0.5 degC. There is one main temperature sensor, and two other sensors. An
+alarm is triggered when the temperature gets higher then the Overtemperature
+Shutdown value; it stays on until the temperature falls below the Hysteresis
+value.
+
+FAN rotation speeds are reported in RPM (rotations per minute). An alarm is
+triggered if the rotation speed has dropped below a programmable limit. FAN 
+readings can be divided by a programmable divider(1, 2, 4, 8, 16, 32, 64 or
+128) to give the readings more range or accuracy. 
+
+Voltage sensors (also known as IN sensors) report their values in milivolts.
+An alarm is triggered if the voltage has crossed a programmable minimum 
+or maximum limit.
+
+Fan and voltage alarm triggers are "software-level" instead of
+"hardware-level", which means the alarm is triggered when "sensors" program
+find the measured value exceed the limits, while temperature alams are
+triggered by the hardware. Fan and voltage alarms cannot be implemented in
+hardware due to lack of "comparator mode" support in W83792D.
+
+In addition to the alarms described above, there is a CHAS alarm on the
+chips which triggers if your computer case is open. 
+
+The chips only update values each 3 seconds; reading them more often will
+do no harm, but will return 'old' values.
+
+
+W83792D PROBLEMS
+----------------
+Known problems:
+	- This driver is only for Winbond W83792D C version device, there
+	  are also some motherboards with B version W83792D device. The 
+	  calculation method to in6-in7(measured value, limits) is a little
+	  different between C and B version. C or B version can be identified
+	  by CR[0x49h].
+	- The function of vid and vrm has not been finished, because I'm NOT
+	  very familiar with them. Adding support is welcomed.
+	- The function of chassis open detection needs more tests.
+
+Fan control
+-----------
+
+Manual mode
+-----------
+
+Works as expected. You just need to specify desired PWM/DC value (fan speed)
+in apropriate pwm# file.
+
+Thermal cruise
+--------------
+
+At this mode, W83792D provides the Smart Fan system to automatically control
+fan speed to keep the temperatures of CPU and the system within specific
+range. At first a wanted temperature and interval must be set. This is done
+via thermal_cruise# file. The tolerance# file serves to create T +- tolerance
+interval. The fan speed will be lowered as long as the current temperature
+remains below the thermal_cruise# +- tolerance# value. Once the temperature
+exceeds the high limit (T+tolernace), the fan will be turned on with a
+specific speed set by pwm# and automatically controlled its PWM duty cycle
+with the temperature varying. Three conditions may occur:
+
+(1) If the temperature still exceeds the high limit, PWM duty
+cycle will increase slowly. 
+
+(2) If the temperature goes below the high limit, but still above the low
+limit (T-tolerance), the fan speed will be fixed at the current speed because
+the temperature is in the target range.
+
+(3) If the temperature goes below the low limit, PWM duty cycle will decrease
+slowly to 0 or a preset stop value until the temperature exceeds the low
+limit. (The preset stop value handling is not yet implemented in driver)
+
+Smart Fan II
+------------
+
+W83792D also provides a special mode for FAN. Four temperature points are
+available. When related temperature sensors detects the temperature in preset
+temperature region (sf2_point@_fan# +- tolerance#) it will cause fans to run
+on programmed value from sf2_level@_fan#. You need to set four temperatures
+for each fan.
+
+
+/sys files
+----------
+
+# denotes number any number from 1 to 3
+@ denotes number any number from 1 to 4
+
+pwm# - this file stores PWM duty cycle or DC value (fan speed) in range 0 (stop) to 255 (full)
+pwm#_enable - this file controls mode of fan/temperature control:
+            * 1 Manual mode
+            * 2 Smart Fan II
+            * 3 Thermal Cruise
+pwm#_mode - Select PWM of DC mode
+            * 0 DC
+            * 1 PWM
+thermal_cruise# - Selects the desired temperature for cruise (deg C)
+tolerance# - Value in degrees of Celsius (deg C) for +- T 
+sf2_point@_fan# - four temperature points for each fan for Smart Fan II
+sf2_level@_fan# - four PWM/DC levels for each fan for Smart Fan II
diff -Naur a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
--- a/drivers/i2c/chips/Kconfig	2005-05-25 05:31:20.000000000 +0200
+++ b/drivers/i2c/chips/Kconfig	2005-05-28 10:28:16.000000000 +0200
@@ -336,6 +336,16 @@
 	  This driver can also be built as a module.  If so, the module
 	  will be called w83781d.

+config SENSORS_W83792D
+ tristate "Winbond W83792D"
+ depends on I2C && EXPERIMENTAL
+ select I2C_SENSOR
+ help
+ If you say yes here you get support for the Winbond W83792D chip.
+
+ This driver can also be built as a module. If so, the module
+ will be called w83792d.
+
config SENSORS_W83L785TS
tristate "Winbond W83L785TS-S"
depends on I2C && EXPERIMENTAL

drivers/i2c/chips/Makefile +1 -0
diff -Naur a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile
@@ -39,6 +39,7 @@
 obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc47b397.o
 obj-$(CONFIG_SENSORS_SMSC47M1)	+= smsc47m1.o
 obj-$(CONFIG_SENSORS_VIA686A)	+= via686a.o
+obj-$(CONFIG_SENSORS_W83792D)	+= w83792d.o
 obj-$(CONFIG_SENSORS_W83L785TS)	+= w83l785ts.o
 obj-$(CONFIG_ISP1301_OMAP)	+= isp1301_omap.o
 
drivers/i2c/chips/w83792d.c +1737 -0

1,737 lines not on this page · raw message

#1 lore raw

Hi Rudolf, Rafi, Jean

Quoted 3 lines

You will need for that latest lm-sensors CVS version. You can get it here:
http://secure.netroedge.com/~lm78/archive/lm_sensors-daily.tar.gz

To test the 792 driver for linux-2.6, you need the latest lm-sensors CVS version, But I checked the above daily version, as well as the one in
http://secure.netroedge.com/~lm78/cvs/browse.cgi/lm_sensors2/kernel/chip
s/w83792d.c
find that the version in CVS is NOT the lastest! Please patch the attachment
into lm_sensors as soon as possible, otherwise you will NOT be able to test
the 792 driver for linux-2.6

For more detail, please refer to my mail with subject "RE: Fix one bug of w83792d under linux-2.4"

To Rudolf
Thank you for all kinds of help to me, I will check the document in the near
future.

Thanks

Best Regards
Chunhao

==============================================The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Winbond is strictly prohibited; and any information in this email irrelevant to the official business of Winbond shall be deemed as neither given nor endorsed by Winbond. ==============================================If your computer is unable to decode Chinese font, please ignore the following message.It essentially repeats the statement in English given above.本信件內所含華邦電子的財產性機密性資訊, 僅授權原發信人指定之收信人取閱\\\之用. 假使您並非被指定之收信人或因任何原因在未經授權的情形之下收到本信件, 請您告知原發信人並立即將信件從電腦與網路伺服器中予以消除. 對於您的合作, 我們先此致謝. 特此提醒, 任何未經授權擅自使用華邦電子的機密資訊的行為是被嚴格禁止的. 信件與華邦電子營業無關之內容,不得視為華邦電子之立場或意見.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: w83792d_driver-1.0.5.patch
Type: application/octet-stream
Size: 11136 bytes
Desc: w83792d_driver-1.0.5.patch
Url : http://lists.atrpms.net/pipermail/lm-sensors/attachments/20050601/38c0d4e5/w83792d_driver-1.0.5.obj

#2 lore raw
In reply to Rudolf Marek
Quoted 3 lines · Rudolf Marek

Hi all,

I created the patch for 2.6.x kernels with Makefile Kconfig and documentation.

...

Quoted 1 line

or even any other 2.6 kernel. As long it does not say HUNK failed than it is OK.

Does not compile on 2.6.12-rc5-mm1 due to sysfs changes, was going to create patchset but I got distracted with 2.4.31 coming out today.

Quoted 1 line

Rest of people here please help me with documentation review.

Wish I could, chicken & egg --> me waiting for doc review too. Cannot test the driver itself anyway :(

--Grant.

#4 lore raw
In reply to Rudolf Marek

Hi Rudolf

Quoted 1 line

Rest of people here please help me with documentation review.

First of all, thank you for your help on finishing this 792 documentation,
I examined it carefully just now, it seems very good to me, I only correct
several small spelling mistakes, please refer to them below.

Quoted 6 lines

Description
-----------

This driver implements support for the Winbond W83792AD/D.

Detection of the chip can sometimes be foiled because it can be in an

"foiled" should be "failed"

Quoted 1 line

Temperatures are measured in degrees Celcius and measurement

resolution is

Quoted 1 line

0.5 degC. There is one main temperature sensor, and two other sensors.

An

Quoted 1 line

alarm is triggered when the temperature gets higher then the

Overtemperature

"then" should be "than"

Quoted 1 line

Voltage sensors (also known as IN sensors) report their values in

milivolts.

"milivolts" should be "millivolts"

Btw, I think you explained the "Fan control" mechanism clearly than me. :-)

Thanks
Best Regards
Chunhao

==============================================The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Winbond is strictly prohibited; and any information in this email irrelevant to the official business of Winbond shall be deemed as neither given nor endorsed by Winbond. ==============================================If your computer is unable to decode Chinese font, please ignore the following message.It essentially repeats the statement in English given above.本信件內所含華邦電子的財產性機密性資訊, 僅授權原發信人指定之收信人取閱\\\之用. 假使您並非被指定之收信人或因任何原因在未經授權的情形之下收到本信件, 請您告知原發信人並立即將信件從電腦與網路伺服器中予以消除. 對於您的合作, 我們先此致謝. 特此提醒, 任何未經授權擅自使用華邦電子的機密資訊的行為是被嚴格禁止的. 信件與華邦電子營業無關之內容,不得視為華邦電子之立場或意見.

#5 lore raw
In reply to Rudolf Marek

Hi Rudolf

Quoted 4 lines

Thermal cruise
--------------

At this mode, W83792D provides the Smart Fan system to automatically

control

Quoted 1 line

fan speed to keep the temperatures of CPU and the system within

specific

Quoted 1 line

range. At first a wanted temperature and interval must be set. This is

done

Quoted 1 line

via thermal_cruise# file. The tolerance# file serves to create T +-

tolerance

Quoted 1 line

interval. The fan speed will be lowered as long as the current

temperature

Quoted 1 line

remains below the thermal_cruise# +- tolerance# value. Once the

temperature

Quoted 2 lines

exceeds the high limit (T+tolernace), the fan will be turned on with a specific speed set by pwm# and automatically controlled its PWM duty

cycle

Quoted 1 line

with the temperature varying. Three conditions may occur:

Your comprehension is correct, I test it just now on your suggestion:
If I set pwm2_enable into thermal cruise mode first,
then set the thermal_cruise2 into a low value such as 25(degree), the pwm2
will decrease automatically step by step.

On the other hand, if I set the thermal_cruise2 into a large value such as
42(degree) under thermal cruise mode, the pwm2 will increase step by step,
If the set thermal_cruise2 is very larger such as 80(degree), the increase
of pwm2 may be very quickly, for example, from 9 into 15(full) in ONE step.

Thanks
Best Regards
Chunhao

#6 lore raw
In reply to Rudolf Marek

Hi Rudolf, Jean

Quoting Jean:

Quoted 2 lines

OTOH, there are true alarm registers at registers A9h, AAh and ABh. These show the realtime comparison result for all channels, not only

the

Quoted 6 lines

temperatures. And these do not require to reconfigure the interrupt mode for the temperatures.

So I would like you to modify your w83792d driver to use the A9h, AAh and ABh registers for the alarms, and remove the interrupt mode change as it won't be needed anymore. You will then have to modify the

library

Quoted 4 lines

and the sensors program to use the new alarm bits.

Once this works for Linux 2.4, we'll of course want to do the same for the Linux 2.6 driver.

I adopted the suggestion Jean provided, finished the modification and test,
and find it also works well under linux-2.6. The attachment is my latest 792 driver for linux-2.6, please commit it for me to the kernel group.

Quoting myself:

Quoted 2 lines

Here is my one question:
After the modification and test, need I send you a new w83792d.c

version

Quoted 1 line

for linux-2.6 or just a patch for the original w83792d.c for linux-2.6

?

I do NOT need your answer, because it's not important, I'd like to send the
latest 792 driver for linux-2.6 here, if you need patch, please generate it
for me.

Thanks
Best Regards
Chunhao

==============================================The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Winbond is strictly prohibited; and any information in this email irrelevant to the official business of Winbond shall be deemed as neither given nor endorsed by Winbond. ==============================================If your computer is unable to decode Chinese font, please ignore the following message.It essentially repeats the statement in English given above.本信件內所含華邦電子的財產性機密性資訊, 僅授權原發信人指定之收信人取閱\\\之用. 假使您並非被指定之收信人或因任何原因在未經授權的情形之下收到本信件, 請您告知原發信人並立即將信件從電腦與網路伺服器中予以消除. 對於您的合作, 我們先此致謝. 特此提醒, 任何未經授權擅自使用華邦電子的機密資訊的行為是被嚴格禁止的. 信件與華邦電子營業無關之內容,不得視為華邦電子之立場或意見.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: w83792d.c
Type: application/octet-stream
Size: 54151 bytes
Desc: w83792d.c
Url : http://lists.atrpms.net/pipermail/lm-sensors/attachments/20050606/2d1e28ea/w83792d-0001.obj