Hi Magnus, On Mon, Jun 22, 2020 at 2:51 PM Magnus Damm <magnus.damm@xxxxxxxxx> wrote: > From: Magnus Damm <damm+renesas@xxxxxxxxxxxxx> > > This patch adds support for a couple of LEDs on the r8a77995 Draak board. > > It also ignores the issue that push switches are also used on the same GPIOs. > > The approach is the same as in the earlier posted patch for other boards: > [PATCH/RFC] arm64: dts: renesas: salvator-common: gpio-leds prototype > > The limitations of DT bindings and kernel software support remain the same. > > As Geert pointed out we need to extend the software to allow sharing of > GPIOs somehow. On this board and several others the GPIOs used for LEDs > are also used for push switches. Both DT bindings and drivers need to > be extended, most likely together with the GPIO subsystem. And to make it > more fun it is probably possible to get interrupts from these GPIOs as well. > > In the patch the LED order and the GPIO number assignments look quite random > but match the schematics. > > Signed-off-by: Magnus Damm <damm+renesas@xxxxxxxxxxxxx> Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx> > --- 0001/arch/arm64/boot/dts/renesas/r8a77995-draak.dts > +++ work/arch/arm64/boot/dts/renesas/r8a77995-draak.dts 2020-06-22 21:00:20.000000000 +0900 > @@ -91,6 +91,20 @@ > }; > }; > > + leds { > + compatible = "gpio-leds"; > + > + led13 { While a name like "led13" is still considered acceptable these days, the preferred format uses a hyphen ("^led-[0-9a-f]$"; whoops no one thought of more than 16 LEDs?) > + gpios = <&gpio4 7 GPIO_ACTIVE_HIGH>; > + }; > + led12 { > + gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>; > + }; > + led14 { > + gpios = <&gpio4 25 GPIO_ACTIVE_HIGH>; > + }; > + }; > + > memory@48000000 { > device_type = "memory"; > /* first 128MB is reserved for secure area. */ Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds