From 42eeb22450f2c3225fa79a75c0ba881ac6809a77 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 20 Apr 2023 11:31:49 +0100 Subject: uboot-mediatek: fix factory/reset button U-Boot commit ea6fdc13595 ("dm: button: add support for linux_code in button-gpio.c driver") makes it mandatory to specify linux,code for all buttons. As that broke handling of the reset button in U-Boot with the update to U-Boot 2023.04, add linux,code for all butons. Reported-by: @DragonBluep Fixes: 50f7c5af4a ("uboot-mediatek: update to v2023.04") Signed-off-by: Daniel Golle --- .../patches/302-mt7623-generic-reset-button-ignore-env.patch | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'package/boot/uboot-mediatek/patches/302-mt7623-generic-reset-button-ignore-env.patch') diff --git a/package/boot/uboot-mediatek/patches/302-mt7623-generic-reset-button-ignore-env.patch b/package/boot/uboot-mediatek/patches/302-mt7623-generic-reset-button-ignore-env.patch index e144f42c47..928dfe8428 100644 --- a/package/boot/uboot-mediatek/patches/302-mt7623-generic-reset-button-ignore-env.patch +++ b/package/boot/uboot-mediatek/patches/302-mt7623-generic-reset-button-ignore-env.patch @@ -18,7 +18,7 @@ DECLARE_GLOBAL_DATA_PTR; -@@ -41,3 +50,22 @@ int mmc_get_env_dev(void) +@@ -41,3 +50,25 @@ int mmc_get_env_dev(void) return mmc_get_boot_dev(); } #endif @@ -30,7 +30,10 @@ + if (!button_get_by_label(CONFIG_RESET_BUTTON_LABEL, &dev)) { + puts("reset button found\n"); +#ifdef CONFIG_RESET_BUTTON_SETTLE_DELAY -+ mdelay(CONFIG_RESET_BUTTON_SETTLE_DELAY); ++ if (CONFIG_RESET_BUTTON_SETTLE_DELAY > 0) { ++ button_get_state(dev); ++ mdelay(CONFIG_RESET_BUTTON_SETTLE_DELAY); ++ } +#endif + if (button_get_state(dev) == BUTTON_ON) { + puts("button pushed, resetting environment\n"); -- cgit v1.2.3