From owner-freebsd-embedded@FreeBSD.ORG Tue Feb 11 19:10:19 2014 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 11BB424F; Tue, 11 Feb 2014 19:10:19 +0000 (UTC) Received: from mail-yh0-x230.google.com (mail-yh0-x230.google.com [IPv6:2607:f8b0:4002:c01::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B58F6163F; Tue, 11 Feb 2014 19:10:18 +0000 (UTC) Received: by mail-yh0-f48.google.com with SMTP id f10so7332523yha.35 for ; Tue, 11 Feb 2014 11:10:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=VLxAvW8vcjyfjW+pg6cRDInkfT2DRrlvHKcp1UvldUM=; b=xZWL2oB4yj/nj4pQEwVVMR/fRZxdfHAdcbrsJxiGiyfTYbhJ4ZXkmjEQnonaC7nkGi ED1LjA8nUpczfu4hBRRmOmmVfaetSvOL1W9EAcDvypWxvOXtsZjBWAtfVJTsEaYV15Lt ClIOjMTn4aTtvwQLLuZiKTXKjEh9WFnD8m4oRWmQZdsycjFMjmJ9ep/bQEg8xxHECqBr OzI6k0Qgvs6Q6QGJEjX42oW4nNSSflEPkQbN5RzS5XyYvyTM+oV/1N1iUfXIlUepQy/s snv5HfC1bqpbAvwURkuhkNzGV7vgROI+ATw9P90ZBN1mqoTPwD7wgoYVbcqEEYGLutYj waog== X-Received: by 10.236.87.1 with SMTP id x1mr24509014yhe.51.1392145817898; Tue, 11 Feb 2014 11:10:17 -0800 (PST) Received: from [192.168.1.13] ([187.120.137.162]) by mx.google.com with ESMTPSA id d32sm62144065yhq.27.2014.02.11.11.10.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Feb 2014 11:10:17 -0800 (PST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: FDT/OFW GPIO bus From: Luiz Otavio O Souza In-Reply-To: Date: Tue, 11 Feb 2014 17:10:05 -0200 Content-Transfer-Encoding: quoted-printable Message-Id: <9090D088-8F3C-494F-8F41-AA8A16361CB2@gmail.com> References: <2D5F2707-FD55-46BB-A44F-8870B48E2BB1@gmail.com> To: Warner Losh X-Mailer: Apple Mail (2.1827) Cc: freebsd-arm@freebsd.org, freebsd-embedded@freebsd.org X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Feb 2014 19:10:19 -0000 On Feb 7, 2014, at 1:21 AM, Warner Losh wrote: >=20 > On Feb 6, 2014, at 11:53 AM, Luiz Otavio O Souza wrote: [=85] >>=20 >> gpioiic(4) devices can be described in DTS as follow: >>=20 >> gpio { >>=20 >> gpioiic { >> compatible =3D "gpioiic"; >=20 > Linux uses 'i2c-gpio' here. Can we follow that standard rather than = invent our own? Or at least support both? Sure, no problem. >=20 >> gpios =3D <&gpio 17 2 0 >> &gpio 21 2 0>; >> scl =3D <0>; >> sda =3D <1>; >=20 > Linux doesn't have these at all, it seems, since they are implicit in = the gpios property. It would be ideal if the scl and sda properties were = optional=85 They are optional and only needed when you want to change the default = setting (scl =3D 0 and sda =3D 1 - yes, in this example they are just a = no op). >=20 > In addition, you'll often see things like: >=20 > i2c-gpio,sda-open-drain; > i2c-gpio,scl-open-drain; > i2c-gpio,delay-us =3D <2>; >=20 > as well. These should be easy enough to add and shouldn't gate things. Right, ATM gpioiic(4) is coded as an open collector/drain for both SCL = and SDA as per standard. The delay option should be added. >=20 > There's also many DTS files that don't have this as a direct child of = gpio... But that's not strictly required. I'll cope with adding support = for that when I get the Atmel stuff working... >=20 >> lm750 { >> compatible =3D "lm75"; >> i2c-address =3D <0x4b>; >> }; >> lm751 { >> compatible =3D "lm75"; >> i2c-address =3D <0x4f>; >> }; >> }; >> }; I see. I found a DTS from Atmel and i=92ll add support for that. Thank you for point that out. Luiz=