Skip to contentSkip to conversation

lm_sensors2/kernel/chips lm75.h lm75.c

DISCUSSION Mark M. Hoffman 3 participants 6 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw
Quoted 7 lines · * [email protected] <[email protected]> [2003-12-01…

Update of /home/cvs/lm_sensors2/kernel/chips
In directory mordac.netroedge.com:/tmp/cvs-serv17140/kernel/chips

Modified Files:

	lm75.c 
Added Files:
	lm75.h 
Quoted 6 lines

Log Message:
(mmh) Pulled the TEMP_TO_REG and TEMP_FROM_REG functions into a separate
header and gave them the prefix LM75_. Also rewrote them according to the lm75 datasheet. The next step is to replace all the various scattered (broken?) copies of these functions (especially in Winbond subclients) with this one.

This works nicely for me - negative values ok, 1/2 degree increments ok - but I should mention I tested it on asb100 and w83627thf (code not yet committed). I haven't actually tested on lm75 itself; I don't have one.

Comments?

Signature · 2 lines
Mark M. Hoffman
[email protected]
#1 lore raw
Quoted 4 lines

This works nicely for me - negative values ok, 1/2 degree increments ok - but I should mention I tested it on asb100 and w83627thf (code not yet committed). I haven't actually tested on lm75 itself; I don't have one.

Gave it a try on my old system with a real LM75 on it. Looks OK, although I did not test negative values (how would you do that??) nor did I do extended tests. Just seems to work :)

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#2 lore raw
In reply to Mark M. Hoffman
Quoted 1 line · Mark D. Studebaker

what was broken before?

Good question. Actually the macros in lm75.c -r1.44 worked OK for negative values. However, many of the cloned copies which handle subclient sensors (like w83781d.c) do not. The limits according to the datasheet (-55 to +125 C) were/are indeed broken everywhere. The idea is to implement this common conversion once.

I'd also like to think that my version is easier to read... ;) but if people disagree then I'll try again or revert it.

Also btw: the special as99127 temp conv routines never made any sense to me at all. I'm not saying they're wrong for as99127, but they *are* wrong for asb100. Result is that anyone going from kernel 2.4 + sensors cvs to kernel 2.6 will have broken temp readings on asb100 until I get that driver ported and merged.

Quoted 17 lines
Quoted 16 lines · Mark M. Hoffman
Quoted 13 lines · * [email protected] <[email protected]> [2003-12-01…

Update of /home/cvs/lm_sensors2/kernel/chips
In directory mordac.netroedge.com:/tmp/cvs-serv17140/kernel/chips

Modified Files:

      lm75.c
Added Files:
      lm75.h

Log Message:
(mmh) Pulled the TEMP_TO_REG and TEMP_FROM_REG functions into a separate
header and gave them the prefix LM75_. Also rewrote them according to the lm75 datasheet. The next step is to replace all the various scattered (broken?) copies of these functions (especially in Winbond subclients) with this one.

Quoted 3 lines
Quoted 3 lines

This works nicely for me - negative values ok, 1/2 degree increments ok - but I should mention I tested it on asb100 and w83627thf (code not yet committed). I haven't actually tested on lm75 itself; I don't have one.

Regards,

Signature · 2 lines
Mark M. Hoffman
[email protected]
#3 lore raw
In reply to Mark M. Hoffman
Quoted 3 lines · Jean Delvare

Gave it a try on my old system with a real LM75 on it. Looks OK, although I did not test negative values (how would you do that??) nor did I do extended tests. Just seems to work :)

Thanks! I test the negative values (actually all range of values) by writing max and/or hyst with sensors -s and then reading them back with sensors. In between, I use i2cdump to verify the register values.

No need to put your machine in the freezer. :)

Regards,

Signature · 2 lines
Mark M. Hoffman
[email protected]
#4 lore raw
In reply to Mark M. Hoffman

what was broken before?

Quoted 25 lines · Mark M. Hoffman
Quoted 7 lines · * [email protected] <[email protected]> [2003-12-01…

Update of /home/cvs/lm_sensors2/kernel/chips
In directory mordac.netroedge.com:/tmp/cvs-serv17140/kernel/chips

Modified Files:

      lm75.c
Added Files:
      lm75.h
Quoted 6 lines

Log Message:
(mmh) Pulled the TEMP_TO_REG and TEMP_FROM_REG functions into a separate
header and gave them the prefix LM75_. Also rewrote them according to the lm75 datasheet. The next step is to replace all the various scattered (broken?) copies of these functions (especially in Winbond subclients) with this one.

This works nicely for me - negative values ok, 1/2 degree increments ok - but I should mention I tested it on asb100 and w83627thf (code not yet committed). I haven't actually tested on lm75 itself; I don't have one.

Comments?

--
Mark M. Hoffman
[email protected]

#5 lore raw
In reply to Mark M. Hoffman
Quoted 4 lines

Thanks! I test the negative values (actually all range of values) by writing max and/or hyst with sensors -s and then reading them back with sensors. In between, I use i2cdump to verify the register values.

Tested this, looks good (if you leave apart the fact that my computer started beeping like crazy, or course).

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/