From owner-freebsd-embedded@FreeBSD.ORG Fri Nov 29 22:38:28 2013 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87984D60 for ; Fri, 29 Nov 2013 22:38:28 +0000 (UTC) Received: from mail-qa0-x230.google.com (mail-qa0-x230.google.com [IPv6:2607:f8b0:400d:c00::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 45BED135B for ; Fri, 29 Nov 2013 22:38:28 +0000 (UTC) Received: by mail-qa0-f48.google.com with SMTP id w5so2326131qac.7 for ; Fri, 29 Nov 2013 14:38:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=hxw8J2N0NEgkhDpw2+l1+InKB4HCeE/Dw4/SHGr0rWo=; b=fY4RUJ3MeHv3KcW6U8uwouD6IlmzLSJQISGbnYnGubQ6d2rw8tj6j2E9hui3KyqOtI AMidwNmWxi8UUNmSVEp33k1DR+QaXQcDsv6pk9CaqhAn5xO1U9Wyo1IEA5qVB+FvIPQY urPPV7kB1B/s9QgzEphSlzUZivqTvkzocX8axKGKL2NCVDopmer7w2s6iNTK70hXICBa jXhEDzthgFO+3Ap09nYx3V2dU3Nd2Tb0x7MdGZB2rSiZjvlIPb1rZCB3H9BQLFoixLn8 8vzt58tL1D+nWXTG1e5G9vSWDuVPI7I9rq2a633DxshvBCY4VnwQ/DWEaU5YEXlj+XkN CDMQ== MIME-Version: 1.0 X-Received: by 10.49.35.144 with SMTP id h16mr90922504qej.35.1385764707150; Fri, 29 Nov 2013 14:38:27 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.53.200 with HTTP; Fri, 29 Nov 2013 14:38:27 -0800 (PST) In-Reply-To: <69CF7423-FD5B-44B3-8B90-E76BA96BB31A@gmail.com> References: <69CF7423-FD5B-44B3-8B90-E76BA96BB31A@gmail.com> Date: Fri, 29 Nov 2013 14:38:27 -0800 X-Google-Sender-Auth: 7yeUtTAuo8572sLyJLhwWCD34go Message-ID: Subject: Re: [patch] LM75 kernel driver From: Adrian Chadd To: Luiz Otavio O Souza Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-embedded@freebsd.org" X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Nov 2013 22:38:28 -0000 Hi! Have you run this on the very latest -HEAD? -adrian On 29 November 2013 11:28, Luiz Otavio O Souza 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: mem 0x20205000-0x2020501f irq 61 on= simplebus0 > iicbus1: on iichb0 > iic1: on iicbus1 > lm751: at addr 0x96 on iicbus1 > lm752: 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"