Unix Technical Forum

Temperature sensors on Soekris net4826

This is a discussion on Temperature sensors on Soekris net4826 within the lucky.openbsd.tech forums, part of the OpenBSD category; --> Hi, Please find attached some patches I have made in order to support the Philips LM75A chip on my ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > lucky.openbsd.tech

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-22-2008, 12:33 PM
Matt Dainty
 
Posts: n/a
Default Temperature sensors on Soekris net4826

Hi,

Please find attached some patches I have made in order to support the
Philips LM75A chip on my Soekris net4826.

I use the following snippet of kernel config:

gpio0 at gscpcib?
gpioiic0 at gpio0 offset 12 mask 0x3
iic0 at gpioiic0
lmtemp* at iic0 addr 0x48

*However*, I needed to use a crude hack to gpioiic.c to reverse the
order of the SDA and SCL pins for the net4826 so that SDA is on pin
13 and SCL is on pin 12 which matches up with the SC1100 datasheet.
I've included the patch to illustrate the change I made. I wasn't
sure of the best way to handle both pin orders in the driver/kernel
config.

The LM75A supports better temperature resolution so I patched
i2c_scan.c(lm75probe) to detect the chip as a distinct variant, and
lm75.c contains the extra code/comments regarding the chip. I've also
patched the lmtemp(4) man page.

Because the LM75A supports resolution in 0.125C increments, I found
sysctl only displayed to two decimal places, so the final patch just
tweaks the formatting used by sysctl(8).

Here's the dmesg from my net4826:

gscpcib0 at pci0 dev 18 function 0 "NS SC1100 ISA" rev 0x00
gpio0 at gscpcib0: 64 pins
gpioiic0 at gpio0 pins 12 13: SDA[13] open-drain pull-up, SCL[12]
open-drain pull-up
iic0 at gpioiic0
lmtemp0 at iic0 addr 0x48: lm75a

Here's the sysctl output:

# sysctl hw.sensors
hw.sensors.0=lmtemp0, TEMP, temp, 44.500 degC / 112.100 degF
# sysctl hw.sensors
hw.sensors.0=lmtemp0, TEMP, temp, 44.625 degC / 112.325 degF

Comments appreciated.

Matt

[demime 1.01d removed an attachment of type application/octet-stream which had a name of gpioiic.c.patch]

[demime 1.01d removed an attachment of type application/octet-stream which had a name of i2c_scan.c.patch]

[demime 1.01d removed an attachment of type application/octet-stream which had a name of lm75.c.patch]

[demime 1.01d removed an attachment of type application/octet-stream which had a name of lmtemp.4.patch]

[demime 1.01d removed an attachment of type application/octet-stream which had a name of sysctl.c.patch]

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:15 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com