aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-mediatek/patches/303-mt7986-generic-reset-button-ignore-env.patch
diff options
context:
space:
mode:
Diffstat (limited to 'package/boot/uboot-mediatek/patches/303-mt7986-generic-reset-button-ignore-env.patch')
-rw-r--r--package/boot/uboot-mediatek/patches/303-mt7986-generic-reset-button-ignore-env.patch7
1 files changed, 5 insertions, 2 deletions
diff --git a/package/boot/uboot-mediatek/patches/303-mt7986-generic-reset-button-ignore-env.patch b/package/boot/uboot-mediatek/patches/303-mt7986-generic-reset-button-ignore-env.patch
index 0af267c50d..45290149f3 100644
--- a/package/boot/uboot-mediatek/patches/303-mt7986-generic-reset-button-ignore-env.patch
+++ b/package/boot/uboot-mediatek/patches/303-mt7986-generic-reset-button-ignore-env.patch
@@ -17,7 +17,7 @@
#include <mtd.h>
#include <linux/mtd/mtd.h>
-@@ -24,7 +31,19 @@ int board_init(void)
+@@ -24,7 +31,22 @@ int board_init(void)
int board_late_init(void)
{
@@ -28,7 +28,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");