Winbond 792 source codes for lm_sensor
mds4 at verizon.net
Sun Jan 30 01:18:39 CET 2005
I'll try and answer your other questions below.
Huang0 at Winbond.com.tw wrote:
> Dear Jean:
>>>>- Why is the vol_factor array exposed to /proc? Isn't this only
>>>> 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
>>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?
> I do NOT know the exact function of factors, maybe you are right, it is
> used to bring into some voltage range. I may delete the exposed
> vol_factor in /proc later.
Yes, I assume that the 'factors' will be fixed, and you can remove them in /proc later.
>>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.
>>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
> In my w83792d.c I calculate the voltages according to the data sheet of
> Please refer to the page 39(Chapter 8.6), page 41(Chapter 8.7), page 61
> (Chapter 8.28 and 8.29) of 792 Data Sheet.
> Do you mean that I should multiply these factors in user space, instead
> doing that in the driver w83792d.c?
> But I find that in the driver w83781d.c, it also do the translation in
> by using such macros:
> #define IN_TO_REG(val) (SENSORS_LIMIT((((val) * 10 + 8)/16),0,255))
> #define IN_FROM_REG(val) (((val) * 16 + 5) / 10)
These macros are not a full conversion, but simply multiply/divide by 10
with some rounding and limit checks.
The sysctl and /proc interfaces don't use floating point, so any floating
point numbers are scaled by 10 (or 100 or 1000) to become integers.
> Would you please give me an example on how to move the translate into
> user space?
> Is it what MDS said:"adjust computation it can be done in
The best way is to learn is play with 'sensors' and editing sensors.conf.
If you have linux running on a system with an already-supported chip,
you should be able to do this easily.
>>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.
> Yes, the voltage factors in my driver is only for the measured value,
> NOT for the limits, that's because in the Datasheet of 792, the factors
> for the measured values are different from for the limits, Please refer
> the page 39(Chapter 8.6), page 41(Chapter 8.7), page 61 (Chapter 8.28
> and 8.29).
> In the driver of w83781d.c I find that the voltage factors are both for
> the measured values and the limits. Do you have any suggestions for my
> 792 driver about it?
Since the factors are only for the measured values, your implementation is fine.
Adjustments in userspace (through /etc/sensors.conf) would apply to
both the measured values and the limits, so it would not be
possible to adjust the 'factors' without the separate /proc values
for the factors; otherwise the limits would change as well. But as I said,
hopefully the factors are fixed, and the /proc interface for the factors
can be removed.
>>>And I will need your help at that time. For example, to add 792
>>>related codes into the script program "sensors-detect" because I
>>>very few about Perl. :-)
>>The sensors-detect script is supposed to already identify the W83792D
>>chip (since lm_sensors 2.9.0). If it doesn't, let us know and we'll
> The version of lm_sensors I'm working is 2.9.0. And I find there are
> some codes about 792 in script sensors-detect, But it seems that it does
> work, because it can NOT find W83792D chip. Neither do the version 2.8.8
> The attachment is the detect result log, you may refer to it and check
> script again.
>>What will obviously require an update though is libsensors. I suppose
>>you will provide a patch together with the driver itself? Seems hard
>>properly test the driver and especially its interaction with "sensors"
> As to libsensors, I know very few about it, Could you give me a simple
> introduction about it? Such as the function of it, and how to update it
> for me, etc.
Please read doc/developers/new_drivers. This gives a brief summary.
If you add support for libsensors and 'sensors', as Jean said,
it will greatly help your ability to debug the driver.
If you need more help, please ask us.
It is best if you do the userspace changes, however if you do not,
we will eventually do it ourselves.
> Best Regards
> ===========================================================================================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 repe
at 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