Enable GPIO button command support and map the common VOL- button
label to the existing fastboot command.

Golden uses a different label for the same KEY_VOLUMEDOWN button.
Normalize it in the U-Boot overlay so the environment works for all
target boards.

Link: 
https://lore.kernel.org/linux-arm-kernel/20260818-ux500-dts-golden-voldown-label-v1-1-3edd581b0...@kernel.org/
Signed-off-by: Linus Walleij <[email protected]>
---
 arch/arm/dts/ste-ux500-samsung-golden-u-boot.dtsi | 4 ++++
 configs/stemmy_defconfig                          | 3 +++
 include/configs/stemmy.h                          | 4 +++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/ste-ux500-samsung-golden-u-boot.dtsi 
b/arch/arm/dts/ste-ux500-samsung-golden-u-boot.dtsi
index 647b3f73c413..34fc58ec1538 100644
--- a/arch/arm/dts/ste-ux500-samsung-golden-u-boot.dtsi
+++ b/arch/arm/dts/ste-ux500-samsung-golden-u-boot.dtsi
@@ -9,3 +9,7 @@
 &panel_reg_3v0 {
        regulator-name = "panel-fixed-supply-3v0";
 };
+
+&{/gpio-keys/volume-down} {
+       label = "VOL-";
+};
diff --git a/configs/stemmy_defconfig b/configs/stemmy_defconfig
index c253780df2ef..2bc395a2682e 100644
--- a/configs/stemmy_defconfig
+++ b/configs/stemmy_defconfig
@@ -15,6 +15,9 @@ CONFIG_DEFAULT_DEVICE_TREE="st/ste-ux500-samsung-janice"
 CONFIG_OF_UPSTREAM=y
 CONFIG_SYS_BOOTM_LEN=0x4000000
 CONFIG_SYS_LOAD_ADDR=0x100000
+CONFIG_BUTTON=y
+CONFIG_BUTTON_GPIO=y
+CONFIG_BUTTON_CMD=y
 CONFIG_BOOTSTD_FULL=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_USE_BOOTCOMMAND=y
diff --git a/include/configs/stemmy.h b/include/configs/stemmy.h
index e58ddd752cd3..08fa3dfd5b75 100644
--- a/include/configs/stemmy.h
+++ b/include/configs/stemmy.h
@@ -36,7 +36,9 @@
        "fastboot_partition_alias_userdata=DATAFS\0"
 
 #define BOOTCMD_ENV \
-       "fastbootcmd=echo '*** FASTBOOT MODE ***'; fastboot usb 0\0"
+       "fastbootcmd=echo '*** FASTBOOT MODE ***'; fastboot usb 0\0" \
+       "button_cmd_0_name=VOL-\0" \
+       "button_cmd_0=run fastbootcmd\0"
 
 #define CFG_EXTRA_ENV_SETTINGS \
        BOOT_ENV \

-- 
2.55.0

Reply via email to