From: Michael Gernoth Date: Thu, 19 May 2011 13:14:05 +0000 (+0200) Subject: Set GPIOKPF_DEBOUNCE, just in case X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/ms2-fixes/commitdiff_plain/20bf1c9e511d6839d28a6b3a24dfe66a3d700484 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 --- 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;