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 ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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] |