From 20bf1c9e511d6839d28a6b3a24dfe66a3d700484 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Thu, 19 May 2011 15:14:05 +0200 Subject: [PATCH] Set GPIOKPF_DEBOUNCE, just in case This flag is already set by Motorola, as it is included in GPIOKPF_REMOVE_PHANTOM_KEYS. I assume that nobody at Motorola looked at this flag, as they would have seen that it also enable the debouncing code which needs to have a debounce_delay set. When the delay is 0 and the code is active, the bouncing even gets worse, as the keypad is scanned more rapidly --- debounce.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debounce.c b/debounce.c index ec20fdb..7489f8c 100644 --- a/debounce.c +++ b/debounce.c @@ -37,10 +37,15 @@ static int __init debounce_init(void) printk(KERN_INFO "settle_time: %u\n", gpio_evmi->settle_time.tv.nsec); printk(KERN_INFO "poll_time: %u\n", gpio_evmi->poll_time.tv.nsec); printk(KERN_INFO "debounce_delay: %u\n", gpio_evmi->debounce_delay.tv.nsec); + printk(KERN_INFO "flags: %x\n", gpio_evmi->flags); if (!gpio_evmi->debounce_delay.tv.nsec) { printk(KERN_INFO "Activating debounce!\n"); gpio_evmi->debounce_delay.tv.nsec = 5 * NSEC_PER_MSEC; + + /* GPIOKPF_DEBOUNCE should already be set by GPIOKPF_REMOVE_PHANTOM_KEYS */ + gpio_evmi->flags |= GPIOKPF_DEBOUNCE; printk(KERN_INFO "debounce_delay: %u\n", gpio_evmi->debounce_delay.tv.nsec); + printk(KERN_INFO "flags: %x\n", gpio_evmi->flags); } return 0; -- 2.39.5