diff mbox series

[PATCH/RFC] arm64: dts: renesas: salvator-common: gpio-leds prototype

Message ID 158452367157.23699.16109085564905174396.sendpatchset@octo (mailing list archive)
State RFC
Delegated to: Geert Uytterhoeven
Headers show
Series [PATCH/RFC] arm64: dts: renesas: salvator-common: gpio-leds prototype | expand

Commit Message

Magnus Damm March 18, 2020, 9:27 a.m. UTC
From: Magnus Damm <damm+renesas@opensource.se>

This patch adds support for a couple of LEDs on Salvator-X and XS boards.

I've verified that LED4, LED5 and LED6 work by exporting GPIOs for GP6_11,
GP6_12 and GP6_13 on the board on port 9011. This patch has not yet been
tested though. Also to make matters slightly more complicated, even if LEDs
might work with this patch as-is, the code in this patch is most likely not
suitable for upstream consumption. This since SW20, SW21 and SW22 are also
using the same GPIOs as the LEDs.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---

 arch/arm64/boot/dts/renesas/salvator-common.dtsi |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Geert Uytterhoeven March 18, 2020, 9:55 a.m. UTC | #1
Hi Magnus,

On Wed, Mar 18, 2020 at 10:35 AM Magnus Damm <magnus.damm@gmail.com> wrote:
> From: Magnus Damm <damm+renesas@opensource.se>
>
> This patch adds support for a couple of LEDs on Salvator-X and XS boards.

Thanks for your patch!

> I've verified that LED4, LED5 and LED6 work by exporting GPIOs for GP6_11,
> GP6_12 and GP6_13 on the board on port 9011. This patch has not yet been
> tested though. Also to make matters slightly more complicated, even if LEDs
> might work with this patch as-is, the code in this patch is most likely not
> suitable for upstream consumption. This since SW20, SW21 and SW22 are also
> using the same GPIOs as the LEDs.

Indeed. I think we should add kernel support for sharing GPIOs this way,
before we can describe the LEDs in DT.  Else we'll introduce a regression,
depending on which driver is bound first.

> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>

As this matches with an old local patch of mine:
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

However, I'm not gonna apply it, without a fix for the sharing issue.

Gr{oetje,eeting}s,

                        Geert
Magnus Damm March 18, 2020, 10:17 a.m. UTC | #2
Hi Geert,

On Wed, Mar 18, 2020 at 6:55 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Magnus,
>
> On Wed, Mar 18, 2020 at 10:35 AM Magnus Damm <magnus.damm@gmail.com> wrote:
> > From: Magnus Damm <damm+renesas@opensource.se>
> >
> > This patch adds support for a couple of LEDs on Salvator-X and XS boards.
>
> Thanks for your patch!

Thanks. Not exactly rocket science!

> > I've verified that LED4, LED5 and LED6 work by exporting GPIOs for GP6_11,
> > GP6_12 and GP6_13 on the board on port 9011. This patch has not yet been
> > tested though. Also to make matters slightly more complicated, even if LEDs
> > might work with this patch as-is, the code in this patch is most likely not
> > suitable for upstream consumption. This since SW20, SW21 and SW22 are also
> > using the same GPIOs as the LEDs.
>
> Indeed. I think we should add kernel support for sharing GPIOs this way,
> before we can describe the LEDs in DT.  Else we'll introduce a regression,
> depending on which driver is bound first.

Totally agree.

> > Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
>
> As this matches with an old local patch of mine:
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> However, I'm not gonna apply it, without a fix for the sharing issue.

Sure, makes sense!

Thanks,

/ magnus
diff mbox series

Patch

--- 0001/arch/arm64/boot/dts/renesas/salvator-common.dtsi
+++ work/arch/arm64/boot/dts/renesas/salvator-common.dtsi	2020-03-18 16:18:44.234040458 +0900
@@ -166,6 +166,20 @@ 
 		};
 	};
 
+	leds {
+		compatible = "gpio-leds";
+
+		led4 {
+			gpios = <&gpio6 11 GPIO_ACTIVE_HIGH>;
+		};
+		led5 {
+			gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>;
+		};
+		led6 {
+			gpios = <&gpio6 13 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
 	reg_1p8v: regulator0 {
 		compatible = "regulator-fixed";
 		regulator-name = "fixed-1.8V";