[U-Boot] [PATCH v3 4/4] samsung: misc: keys: fix gpio key bouncing by adding 50 ms delay

Przemyslaw Marczak p.marczak at samsung.com
Thu Apr 3 10:27:59 CEST 2014


This change prevents gpio keys bouncing by adding 50 ms delay
when key pressed condition met.

Signed-off-by: Przemyslaw Marczak <p.marczak at samsung.com>
Cc: Minkyu Kang <mk7.kang at samsung.com>

---
Changes v2:
- new commit

Changes v3:
- correct commit message
---
 board/samsung/common/misc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index 65b5c30..5b43821 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -105,6 +105,10 @@ static int check_keys(void)
 	if (key_pressed(KEY_VOLUMEDOWN))
 		keys += KEY_VOLUMEDOWN;
 
+	/* Avoids gpio keys debouncing */
+	if (keys)
+		mdelay(50);
+
 	return keys;
 }
 
-- 
1.9.0



More information about the U-Boot mailing list