All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC] arm64: dts: renesas: r8a77995-draak: gpio-leds prototype
@ 2020-06-22 12:37 Magnus Damm
  2020-06-22 13:02 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: Magnus Damm @ 2020-06-22 12:37 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Magnus Damm, geert

From: Magnus Damm <damm+renesas@opensource.se>

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@opensource.se>
---

 arch/arm64/boot/dts/renesas/r8a77995-draak.dts |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

--- 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 {
+			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. */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH/RFC] arm64: dts: renesas: r8a77995-draak: gpio-leds prototype
  2020-06-22 12:37 [PATCH/RFC] arm64: dts: renesas: r8a77995-draak: gpio-leds prototype Magnus Damm
@ 2020-06-22 13:02 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2020-06-22 13:02 UTC (permalink / raw)
  To: Magnus Damm; +Cc: Linux-Renesas

Hi Magnus,

On Mon, Jun 22, 2020 at 2:51 PM Magnus Damm <magnus.damm@gmail.com> wrote:
> From: Magnus Damm <damm+renesas@opensource.se>
>
> 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@opensource.se>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- 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@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-22 13:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-22 12:37 [PATCH/RFC] arm64: dts: renesas: r8a77995-draak: gpio-leds prototype Magnus Damm
2020-06-22 13:02 ` Geert Uytterhoeven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.