FDT Support for GPIO (gpiobus and friends)
Warner Losh
imp at bsdimp.com
Tue Dec 4 22:10:21 UTC 2012
On Dec 4, 2012, at 2:00 PM, Hiroki Sato wrote:
> Luiz Otavio O Souza <loos.br at gmail.com> wrote
> in <BEB9A0F8-560B-4937-8707-653988A26D85 at 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
More information about the freebsd-arch
mailing list