Date: Fri, 29 Nov 2013 14:38:27 -0800 From: Adrian Chadd <adrian@freebsd.org> To: Luiz Otavio O Souza <loos.br@gmail.com> Cc: "freebsd-embedded@freebsd.org" <freebsd-embedded@freebsd.org> Subject: Re: [patch] LM75 kernel driver Message-ID: <CAJ-Vmok7mQnACyW7Pnub96DVk1VLt64WfeOb_f0LKRmk9psXRg@mail.gmail.com> In-Reply-To: <69CF7423-FD5B-44B3-8B90-E76BA96BB31A@gmail.com> References: <69CF7423-FD5B-44B3-8B90-E76BA96BB31A@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi! Have you run this on the very latest -HEAD? -adrian On 29 November 2013 11:28, Luiz Otavio O Souza <loos.br@gmail.com> wrote: > Hi, > > I=92ve written a kernel driver for lm75 (i2c temperature sensor). > > It=92s a very simple, convenient and cheap way to verify an i2c bus. > > This driver provides full control of the lm75 registers (configuration bi= ts, over temperature and hysteresis settings) and so provides basic read an= d write test abilities. > > The high resolution version (lm75b - 11 bits) isn=92t supported ATM, but = i have plans to do so. > > On my RPi i=92ve added this to sys/boot/fdt/dts/rpi.dts: > > bsc0 { > > lm750 { > compatible =3D "lm75"; > i2c-address =3D <0x96>; > }; > > lm751 { > compatible =3D "lm75"; > i2c-address =3D <0x9e>; > }; > }; > > And =91device lm75=92 to RPI-B kernel file (after apply the attached patc= h). > > 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=3D0x96 > dev.lm75.1.%pnpinfo: name=3Dlm750 compat=3Dlm75 > 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=3D0x9e > dev.lm75.2.%pnpinfo: name=3Dlm751 compat=3Dlm75 > 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@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-embedded > To unsubscribe, send any mail to "freebsd-embedded-unsubscribe@freebsd.or= g"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmok7mQnACyW7Pnub96DVk1VLt64WfeOb_f0LKRmk9psXRg>