Skip to content

Commit 662ce0d

Browse files
bijudasgeertu
authored andcommitted
arm64: dts: renesas: r9a08g046l48-smarc: Add gpio keys
RZ/G3L SMARC EVK has 3 user buttons called USER_SW1, USER_SW2 and USER_SW3. Instantiate the gpio-keys driver for these buttons by removing place holders and replacing proper pins for the buttons. USER_SW{1,2,3} are configured as wakeup-sources, so they can wake up the system during s2idle. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260528070239.33352-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
1 parent f4418ce commit 662ce0d

2 files changed

Lines changed: 37 additions & 6 deletions

File tree

arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@
77

88
/dts-v1/;
99

10-
/* Add place holder to avoid compilation error with renesas-smarc2.dtsi */
11-
#define KEY_1_GPIO 1
12-
#define KEY_2_GPIO 2
13-
#define KEY_3_GPIO 3
10+
/* Switch selection settings */
11+
#define RZ_BOOT_MODE3 1
12+
#define SW_DPI_EN 0
13+
#define SW_GPIO4 1
14+
15+
#define PMOD_GPIO4 0
16+
#define PMOD_GPIO6 0
17+
#define PMOD_GPIO7 0
18+
19+
#define KEY_1_GPIO RZG3L_GPIO(J, 3)
20+
#define KEY_2_GPIO RZG3L_GPIO(6, 4)
21+
#define KEY_3_GPIO RZG3L_GPIO(6, 5)
1422

1523
#include <dt-bindings/gpio/gpio.h>
1624
#include <dt-bindings/input/input.h>
@@ -30,11 +38,17 @@
3038
};
3139

3240
&keys {
33-
status = "disabled";
34-
41+
#if !RZ_BOOT_MODE3 || !SW_GPIO4 || PMOD_GPIO4
3542
/delete-node/ key-1;
43+
#endif
44+
45+
#if SW_DPI_EN || PMOD_GPIO6
3646
/delete-node/ key-2;
47+
#endif
48+
49+
#if SW_DPI_EN || PMOD_GPIO7
3750
/delete-node/ key-3;
51+
#endif
3852
};
3953

4054
&pinctrl {

arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@
55
* Copyright (C) 2026 Renesas Electronics Corp.
66
*/
77

8+
/*
9+
* Please set the below switch position on the SoM and the corresponding macro
10+
* on the board DTS:
11+
*
12+
* Switch position SYS.5, Macro SW_DPI_EN:
13+
* 0 - Select multiple SMARC signals active
14+
* 1 - Select LCD
15+
*
16+
* Switch position BOOT.1, Macro RZ_BOOT_MODE3:
17+
* 0 - Select JTAG enabled
18+
* 1 - Select SDIO {CD,IOVS,PWEN} and GPIO4 Active
19+
*
20+
* Switch position SW_GPIO4, Macro SW_GPIO4:
21+
* 0 - Select RZ_VBAT_TAMPER (position 2-1)
22+
* 1 - Select GPIO4 (position 2-3)
23+
*/
24+
825
/ {
926
compatible = "renesas,rzg3l-smarcm", "renesas,r9a08g046l48", "renesas,r9a08g046";
1027

0 commit comments

Comments
 (0)