]> git.zerfleddert.de Git - ms2-fixes/commitdiff
Set GPIOKPF_DEBOUNCE, just in case
authorMichael Gernoth <michael@gernoth.net>
Thu, 19 May 2011 13:14:05 +0000 (15:14 +0200)
committerMichael Gernoth <michael@gernoth.net>
Thu, 19 May 2011 13:14:05 +0000 (15:14 +0200)
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

index ec20fdb55444a8e222e3250955d1e3cd01a908b2..7489f8cb535164b7ed25026699fefd56ad211dde 100644 (file)
@@ -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;
Impressum, Datenschutz