Winbond 792 source codes for lm_sensor

Huang0 at Huang0 at
Fri Feb 18 03:29:07 CET 2005

Hi Jean, MDS

As to the voltage factor, after a further study to the 792 data sheet
and /etc/sensors.conf, I find that the interface vol_factor in /proc
can really be removed from the 792 driver. The calculation has been
transferred into /etc/sensors.conf, instead of in the 792 driver.

W83792D is a little different from the previous chips in the following
(1) It need two registers to calculate in0-in6 measured value,
instead of one register. But as to in7-in8, only one register.
For example:
Vcore A Voltage = (CR[20]*4 + CR[3E]&0x03) * 0.002;
VcoreB Voltage = (CR[21]*4 + CR[3E]&0xC0) * 0.002;
VIN0 Voltage = (CR[22]*4 + CR[3E]&0x30) * 0.004;
VIN1 Voltage = (CR[23]*4 + CR[3E]&0xC0) * 0.004;
VIN2 Voltage = (CR[24]*4 + CR[3F]&0x03) * 0.004;
VIN3 Voltage = (CR[25]*4 + CR[3F]&0x0C) * 0.004;
5VCC Voltage = (CR[26]*4 + CR[3F]&0x30) * 0.006;
5VSB Voltage = CR[B0] * 0.024;
VBAT Voltage = CR[B1] * 0.016;

(2) The voltage factor for limits are different from the
one for measured value, except in7 and in8. Because:
VcoreA Limit Setup
CR[2B/2C] = [Desired Voltage]/0.008;
VcoreB Limint Setup
CR[2D/2E] = [Desired Voltage]/0.008;
VIN0~VIN3 Limit Setup
CR[2F~36] = [Desired Voltage] / 0.016;
5VCC Limit Setup
CR[37/38] = [Desired Voltage] / 0.024;
5VSB Limit Setup
CR[B4/B5] = [Desired Voltage] / 0.024;
VBAT Limit Setup
CR[B6/B7] = [Desired Voltage] / 0.016;

So, in my previous 792 driver, I had to calculate the voltage in
the driver, instead of in /etc/sensors.conf

But now, I find that as to in0-in6, the factors of voltage limit
are the 4 times to the one of measured value.
So my current calculation method is:
/proc/in0-in6 measured value keep such as (CR[20]*4 + CR[3E]&0x03)
/proc/in7-in8 measured value keep such as CR[B0]
/proc/in0-in6 max value keep such as CR[2B]*4
/proc/in7-in8 max value keep such as CR[B4]
And voltage factors for measured value are added into /etc/sensors.conf.

I test it roughtly, it seems to work well. :-)

Best Regards

> > > - Why is the vol_factor array exposed to /proc? Isn't this only
> > >   debugging?
> > >   These shouldn't be exposed to the user. If the user needs to
> > >   adjust computation it can be done in /etc/sensors.conf.
> >
> > In the requirements of our customer: the motherboard vendor should
> > have the permission to modify the voltage factor, so I expose it
> > /proc. I write it with the reference of our Windows version, the
> > Windows version GUI supply a interface to modify the voltage factor,
> > but it need authentication, That's to say, NOT all of the user can
> > modify it.
> As I understand it, these factors account for the resistors placed on
> the motherboard, which are needed to bring all voltages back into the
> measurable 0V-4V range. Am I correct?
> Is so, this does indeed not belong to the driver and has to be
> Such computation has always been performed in userspace by libsensors,
> for all drivers. The reason for this is that libsensors can do almost
> any mathematical operation, not only apply factors. As a matter of
> the W83792D chip needs more than factors for -5V and -12V (an
> offset is needed), and unless I am missing something, your driver
> doesn't handle that. There is also a kernel development policy which
> states that conversions should always be moved outside of the kernel
> when possible, and this is exactly what libsensors is there for.
> The "authentification" issue you are talking about is unrelated. The
> root user (and only him/her) will possibly change the voltage factors,
> regardless of the method (/proc or libsensors) - not the "motherboard
> vendor".
> As a side note, I'm already not certain that restricting the access to
> these values in the Windows world makes sense, but I am certain that
> makes no sense in the Linux world. The goal of open-source tools is to
> give the users the possibility to change whatever them want to, and
> certainly not to put restrictions to what they are allowed to do. And
> any rate there is no room for such a restriction mechanism in the
> libsensors framework.
> As a side note, the voltage factors were used in your driver for the
> measured values only, not for the limits (unless I missed something)
> it was not working correctly anyway.

===========================================================================================The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original author of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such person, please kindly reply the sender indicating accordingly and delete all copies of it from your computer and network server immediately. We thank you for your cooperation. It is advisable that any unauthorized use of confidential information of Winbond is strictly prohibited; and any information in this email that does not relate 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. They essentially repea!
 t the  English statement above.¥»«H¥ó¤º©Ò§tµØ¨¹¹q¤lªº°]²£©Ê¾÷±K©Ê¸ê°T, ¶È±ÂÅv­ìµo«H¤H«ü©w¤§¦¬«H¤H¨ú¾\¤§¥Î. °²¨Ï±z¨Ã«D³Q«ü©w¤§¦¬«H¤H©Î¦]¥ô¦ó­ì¦]¦b¥¼¸g±ÂÅvªº±¡§Î¤§¤U¦¬¨ì¥»«H¥ó, ½Ð±z§iª¾­ìµo«H¤H¨Ã¥ß§Y±N«H¥ó±q¹q¸£»Pºô¸ô¦øªA¾¹¤¤¤©¥H®ø°£. ¹ï©ó±zªº¦X§@, §Ú­Ì¥ý¦¹­PÁÂ. ¯S¦¹´£¿ô, ¥ô¦ó¥¼¸g±ÂÅv¾Õ¦Û¨Ï¥ÎµØ¨¹¹q¤lªº¾÷±K¸ê°Tªº¦æ¬°¬O³QÄY®æ¸T¤îªº. «H¥ó»PµØ¨¹¹q¤lÀç·~µLÃö¤§¤º®e,¤£±oµø¬°µØ¨¹¹q¤l¤§¥ß³õ©Î·N¨£.

More information about the lm-sensors mailing list