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

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

 



Hi Geert,

Thanks for the feedback.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
> Sent: 05 May 2025 13:34
> Subject: Re: [PATCH] arm64: dts: renesas: r9a09g047e57-smarc: Add gpio keys
> 
> Hi Biju,
> 
> 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>
> 
> Thanks for your patch, which conflicts with your CANFD patch that I have just applied.

OK.

> 
> > --- a/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
> > +++ b/arch/arm64/boot/dts/renesas/r9a09g047e57-smarc.dts
> > @@ -8,9 +8,18 @@
> >  /dts-v1/;
> >
> >  /* Switch selection settings */
> > +#define SW_LCD_EN              0
> >  #define SW_SD0_DEV_SEL         0
> >  #define SW_SDIO_M2E            0
> >
> > +#define PMOD_GPIO4             0
> > +#define PMOD_GPIO6             0
> > +#define PMOD_GPIO7             0
> > +
> > +#define  KEY_1_GPIO            RZG3E_GPIO(3, 1)
> > +#define  KEY_2_GPIO            RZG3E_GPIO(8, 4)
> > +#define  KEY_3_GPIO            RZG3E_GPIO(8, 5)
> 
> Please drop the extra spaces after the define keywords.

OK.

> 
> > +
> >  #include <dt-bindings/gpio/gpio.h>
> >  #include <dt-bindings/pinctrl/renesas,r9a09g047-pinctrl.h>
> >  #include "r9a09g047e57.dtsi"
> > @@ -33,6 +42,24 @@ vqmmc_sd1_pvdd: regulator-vqmmc-sd1-pvdd {
> >         };
> >  };
> >
> > +&keys{
> > +#if PMOD_GPIO4
> > +       /delete-node/ key-1;
> > +#endif
> > +
> > +#if SW_LCD_EN || PMOD_GPIO6
> > +       /delete-node/ key-2;
> > +#endif
> > +
> > +#if SW_LCD_EN || PMOD_GPIO7
> > +       /delete-node/ key-3;
> > +#endif
> > +};
> > +
> > +#if SW_LCD_EN && PMOD_GPIO4 && PMOD_GPIO6 && PMOD_GPIO7
> 
> "PMOD_GPIO4 && (SW_LCD_EN || (PMOD_GPIO6 && PMOD_GPIO7))"?
OK.

> 
> > +       /delete-node/ keys;
> > +#endif
> > +
> >  &pinctrl {
> >         scif_pins: scif {
> >                 pins = "SCIF_TXD", "SCIF_RXD"; diff --git
> > a/arch/arm64/boot/dts/renesas/renesas-smarc2.dtsi
> > b/arch/arm64/boot/dts/renesas/renesas-smarc2.dtsi
> > index fd82df8adc1e..84fb955ad77b 100644
> > --- 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?

> 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?

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