RE: [PATCH] arm64: dts: renesas: r9a09g047e57-smarc: Add gpio keys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Claudiu,

> -----Original Message-----
> From: Claudiu Beznea <claudiu.beznea@xxxxxxxxx>
> Sent: 03 July 2025 08:17
> Subject: Re: [PATCH] arm64: dts: renesas: r9a09g047e57-smarc: Add gpio keys
> 
> Hi, Biju,
> 
> On 01.07.2025 17:38, Biju Das wrote:
> > Hi Geert,
> >
> >> -----Original Message-----
> >> From: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> >> Sent: 01 July 2025 12:50
> >> Subject: Re: [PATCH] arm64: dts: renesas: r9a09g047e57-smarc: Add
> >> gpio keys
> >>
> >> Hi Biju,
> >>
> >> On Tue, 1 Jul 2025 at 13:40, Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> >>>> From: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> On Mon, 14 Apr 2025
> >>>> at 17:38, Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> >>>>> RZ/G3E SMARC EVK  has 3 user buttons called USER_SW1, USER_SW2 and
> >>>>> USER_SW3. Add a DT node in device tree to instantiate the
> >>>>> gpio-keys driver for these buttons.
> >>>>>
> >>>>> Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> >>
> >>>>> --- a/arch/arm64/boot/dts/renesas/renesas-smarc2.dtsi
> >>>>> +++ b/arch/arm64/boot/dts/renesas/renesas-smarc2.dtsi
> >>>>> @@ -12,8 +12,13 @@
> >>>>>   * SW_SDIO_M2E:
> >>>>>   *     0 - SMARC SDIO signal is connected to uSD1
> >>>>>   *     1 - SMARC SDIO signal is connected to M.2 Key E connector
> >>>>> + *
> >>>>> + * GPIO keys are enabled by default. Use PMOD_GPIO macros to
> >>>>> + disable them
> >>>>> + * if needed.
> >>>>>   */
> >>>>>
> >>>>> +#include <dt-bindings/input/input.h>
> >>>>> +
> >>>>>  / {
> >>>>>         model = "Renesas RZ SMARC Carrier-II Board";
> >>>>>         compatible = "renesas,smarc2-evk"; @@ -27,6 +32,31 @@
> >>>>> aliases {
> >>>>>                 serial3 = &scif0;
> >>>>>                 mmc1 = &sdhi1;
> >>>>>         };
> >>>>> +
> >>>>> +       keys: keys {
> >>>>> +               compatible = "gpio-keys";
> >>>>> +
> >>>>> +               key-1 {
> >>>>> +                       interrupts-extended = <&pinctrl KEY_1_GPIO
> >>>>> + IRQ_TYPE_EDGE_FALLING>;
> >>>>
> >>>> So you are using them as interrupts. Don't you need to configure
> >>>> pin control for that (function 15 = IRQ14)?
> >>>
> >>> The same pin can be configured as TINT or IRQ15, currently it is configured as TINT IRQ.
> >>> Is it ok?
> >>
> >> OK.
> >>
> >>>> Alternatively, can't you use them as gpios with interrupt facilities?
> >>>
> >>> interrupts-extended = <&pinctrl KEY_1_GPIO IRQ_TYPE_EDGE_FALLING>;
> >>>
> >>> The TINT IRQ will provide the same right? Am I missing anything here?
> >>
> >> When you use interrupts directly, the system will detect only key
> >> presses, and fake (timer-based) key releases.
> >> When you use GPIOs with interrupt-capability, the system can detect both key presses and releases.
> >>
> >> See also commit cab3511ea7a0b1fc ("ARM: dts: marzen: Add slide switches").
> >
> > As per [1], for GPIOs with interrupt-capability, IRQ controller needs to support both edges.
> > But TINT supports Rising or Falling edge, but not both. So, we cannot use this.
> 
> If I clearly understand it, this has been solved on RZ/G3S SMARC Carrier-II by defining these pins as
> gpio hogs:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/renesas/rz
> g3s-smarc.dtsi#n141

Looks like it is redundant, you may need to take out the gpio hog node as 
pinctrl driver already configure the pin as input pin[1].

As per [2], still it is not GPIOs with interrupt-capability.

[1]
https://elixir.bootlin.com/linux/v6.16-rc4/source/drivers/pinctrl/renesas/pinctrl-rzg2l.c#L2534
[2]
https://elixir.bootlin.com/linux/v6.16-rc4/source/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi#L30


Cheers,
Biju 




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux