[patch] LM75 kernel driver
Adrian Chadd
adrian at freebsd.org
Fri Nov 29 22:38:28 UTC 2013
Hi!
Have you run this on the very latest -HEAD?
-adrian
On 29 November 2013 11:28, Luiz Otavio O Souza <loos.br at gmail.com> wrote:
> Hi,
>
> I’ve written a kernel driver for lm75 (i2c temperature sensor).
>
> It’s a very simple, convenient and cheap way to verify an i2c bus.
>
> This driver provides full control of the lm75 registers (configuration bits, over temperature and hysteresis settings) and so provides basic read and write test abilities.
>
> The high resolution version (lm75b - 11 bits) isn’t supported ATM, but i have plans to do so.
>
> On my RPi i’ve added this to sys/boot/fdt/dts/rpi.dts:
>
> bsc0 {
>
> lm750 {
> compatible = "lm75";
> i2c-address = <0x96>;
> };
>
> lm751 {
> compatible = "lm75";
> i2c-address = <0x9e>;
> };
> };
>
> And ‘device lm75’ to RPI-B kernel file (after apply the attached patch).
>
> Here is the result:
>
> iichb0: <BCM2708/2835 BSC controller> mem 0x20205000-0x2020501f irq 61 on simplebus0
> iicbus1: <OFW I2C bus> on iichb0
> iic1: <I2C generic I/O> on iicbus1
> lm751: <LM75 temperature sensor> at addr 0x96 on iicbus1
> lm752: <LM75 temperature sensor> at addr 0x9e on iicbus1
>
> # sysctl dev.lm75.1
> dev.lm75.1.%desc: LM75 temperature sensor
> dev.lm75.1.%driver: lm75
> dev.lm75.1.%location: addr=0x96
> dev.lm75.1.%pnpinfo: name=lm750 compat=lm75
> dev.lm75.1.%parent: iicbus1
> dev.lm75.1.temperature: 30.0C
> dev.lm75.1.thyst: 75.0C
> dev.lm75.1.tos: 80.0C
> dev.lm75.1.conf.faults: 1
> dev.lm75.1.conf.mode: comparator
> dev.lm75.1.conf.polarity: active-low
> dev.lm75.1.conf.shutdown: 0
>
> # sysctl dev.lm75.2
> dev.lm75.2.%desc: LM75 temperature sensor
> dev.lm75.2.%driver: lm75
> dev.lm75.2.%location: addr=0x9e
> dev.lm75.2.%pnpinfo: name=lm751 compat=lm75
> dev.lm75.2.%parent: iicbus1
> dev.lm75.2.temperature: 29.5C
> dev.lm75.2.thyst: 60.0C
> dev.lm75.2.tos: 80.0C
> dev.lm75.2.conf.faults: 2
> dev.lm75.2.conf.mode: interrupt
> dev.lm75.2.conf.polarity: active-low
> dev.lm75.2.conf.shutdown: 0
>
>
> I hope this may be useful for someone else.
>
> Luiz
>
>
>
> _______________________________________________
> freebsd-embedded at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-embedded
> To unsubscribe, send any mail to "freebsd-embedded-unsubscribe at freebsd.org"
More information about the freebsd-embedded
mailing list