Date: Tue, 4 Dec 2012 15:10:11 -0700 From: Warner Losh <imp@bsdimp.com> To: Hiroki Sato <hrs@freebsd.org> Cc: freebsd-arch@FreeBSD.org, loos.br@gmail.com Subject: Re: FDT Support for GPIO (gpiobus and friends) Message-ID: <EC5C2FAF-43CC-43F3-A5D0-CDEF328252D3@bsdimp.com> In-Reply-To: <20121205.060056.592894859995638978.hrs@allbsd.org> References: <BEB9A0F8-560B-4937-8707-653988A26D85@gmail.com> <20121205.060056.592894859995638978.hrs@allbsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Dec 4, 2012, at 2:00 PM, Hiroki Sato wrote: > Luiz Otavio O Souza <loos.br@gmail.com> wrote > in <BEB9A0F8-560B-4937-8707-653988A26D85@gmail.com>: > > lo> Hi, > lo> > lo> I've been playing with GPIO on RPi and found the missing support of > lo> FDT on gpiobus very annoying. > lo> > lo> The following patch (gpio-fdt.diff) adds FDT support to GPIO (gpiobus, > lo> gpioc, gpioled). > lo> > lo> The bcm2835_gpio.c.fdt.diff will add (a better) support of FDT on RPi > lo> GPIO controller and the bcm2835.dts.diff has my changes on the RPi dts > lo> for adding support of gpioled on 'ok' led (pin 16). > lo> > lo> Comments ? > > I like this idea, but it should be consistent with standard device > tree bindings. For example, > > + gpiobus { > + compatible = "gpiobus"; > + > + /* Ok led */ > + led { > + compatible = "gpioled"; > + label = "ok"; > + pins = <16>; > + }; > + }; Yes. This was the sort of thing that I didn't like... > should be something like the following: > > led { > compatible = "gpio-leds"; > ok { > gpios = <&foo 16 1>; > label = "ok"; > }; > }; > > A node using GPIOs must have gpios property for the gpio-controller > node and pin number. Yes, this conforms much better with the FTD standards. Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?EC5C2FAF-43CC-43F3-A5D0-CDEF328252D3>