two questions about w83792d.c for linux-2.4

Huang0 at Winbond.com.tw Huang0 at Winbond.com.tw
Tue Feb 22 03:53:52 CET 2005


Hi Jean

This is Chunhao.
The following are my reply and new questions, please refer them.

> Hm, in fact I think the reason is more complex than that. I have read
the
> datasheet again. I do not deny that the final computations as shown in
> "sensors" are correct, I think they are. But I think you do some
> computations in sensors.conf that should be done in the driver
> (ironically the exact opposite of the original problem).

> The values in /proc should really be Volts. If a /proc file reads 1.12
it
> really must mean 1.12V at that pin of the chip, and not that the
> register was holding value 112. User-space doesn't care about
> implementation details nor register values, it wants standard values
> expressed in Volts.
> 
> So what the driver should do is export the following value, e.g.:
> (CR[20]*4 + CR[3E]&0x03) * 2, with magnitude 3
> 
> * 2 is because of the 2mV resolution, magnitude 3 (divide by 1000) for
> milliVolts.

I'm not familiar with the relationship between LSB and voltage output,
When I write 792 driver, I refer our 792 driver for Windows and 781
driver
in lm_sensors, as well as the data sheet. In our 792 driver for Windows,
it seems that it use my above method to calculate voltage measured value
and limit value. That is voltage factor(such as 0.002) multiply the
register value(such as CR[20]*4+CR[3E]&0x03).

But after your explanation above, I can catch you meaning, because your
explanation is so detailed. :-)
Maybe you are right, now I have some other questions about it, would you
please give me the answer?
Question 1:
Need I modify my current calculation method again into your above
method?
Is that all the other chip drivers in lm_sensors as what you said:
"the values in /proc should really be Volts"? If do, I will try to
modify
my current method.:-(

> For in2-8, this would be * 4 instead of * 2, because LSB is 4mV.
Question 2:
I agree that the LSB of in2-5 is 4mV, so as to in2-5, the method you
provided is correct. But about in6-in8, you said that their LSB is
also 4mV, then how to calculate their measured value? Because in
datasheet
5VCC(in6) Voltage = (CR[26]*4 + CR[3F]&0x30) * 0.006;
5VSB(in7) Voltage = CR[B0] * 0.024;
VBAT(in8) Voltage = CR[B1] * 0.016;
The voltage factor for in6 is 0.006 instead of 0.004, the voltage factor
for in7/8 is 0.024/0.016.
So I think that I should use the same method as in2-5, and use the
multiplier 1.5 in sensors.conf for in6, use the multiplier 6 for
in7, and use the multiplier 4 for in8.
Am I right? Can you confirm that for me?

Question 3:
We discussed the voltage measured value, but how about the voltage
limits?
I try to get the new calculation method, would you please confirm it?
Or please give me the detailed calculation about the voltage limits.
VcoreA(in0) Limit = (CR[2B/2C] * 4) * 0.002;
VcoreB(in1) Limit = (CR[2D/2E] * 4) * 0.002;
VIN0~VIN3(in2-in5) Limit = (CR[2F~36] * 4) * 0.004;
Note: in0-in5 do NOT use any multiplier in sensors.conf

5VCC(in6) Limit = (CR[37/38] * 4) * 0.004;
Note: in6 use multiplier 1.5 in sensors.conf, same as the one for
in6 measured value.

5VSB(in7) Limit = CR[B4/B5] * 0.004;
Note: in7 use multiplier 6 in sensors.conf, same as the one for
in7 measured value.

VBAT(in8) Limit = (CR[B6/B7] * 0.004);
Note: in8 use multiplier 4 in sensors.conf, same as the one for
in8 measured value.
Am I right? Can you confirm that for me?



> You have a bug here. in0 and in4 will be OK, but in1, in2, in3, in5
and
> in6 will not be. For example, in1 should be:
> 
> case 1:  /* vin1 */
> 	low_bits = (data->low_bits[0] & 0x0c) >> 2;
> 	break;
> 
> If you don't properly shift the 2 bits you extract, they won't be
> placed at the right location when you add them ("|") to the main value
> later.

Yes, you are right, the bug has been fixed.


> >	} else if (operation == SENSORS_PROC_REAL_WRITE) {
> >		if( *nrels_mag < 3 ){
> >			return;
> >		}
> 
> And the reason why you cannot write voltage limits is here, I think.
It
> should be "< 2", not "< 3" (or even "!= 2", since you obviously
> expect exactly 2 parameters).

Yes, you are right, again. :-)
The error has also been fixed. I adopt the similar method as 781 driver.


Thanks

Best Regards
Chunhao
2005-02-22


===========================================================================================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&nbsp; 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