]> git.zerfleddert.de Git - ms2-fixes/commitdiff
save and restore more
authorMichael Gernoth <michael@gernoth.net>
Mon, 4 Jul 2011 08:26:04 +0000 (10:26 +0200)
committerMichael Gernoth <michael@gernoth.net>
Mon, 4 Jul 2011 08:26:04 +0000 (10:26 +0200)
debounce.c

index 852118f020e8a3449fe52c6e1252f7898c1b99c9..c138574d81d4a3ce620e3483051a1d75da73a10c 100644 (file)
@@ -7,8 +7,10 @@
 
 static int debounce_delay = 15;
 
-static int old_delay = 0;
 static unsigned old_flags = 0;
+ktime_t old_debounce_delay;
+ktime_t old_settle_time;
+ktime_t old_poll_time;
 static struct gpio_event_matrix_info *gpio_evmi = NULL;
 
 module_param(debounce_delay, int, S_IRUSR | S_IRGRP | S_IROTH);
@@ -49,7 +51,10 @@ static int __init debounce_init(void)
        printk(KERN_INFO PREFIX "debounce_delay: %u\n", gpio_evmi->debounce_delay.tv.nsec);
        printk(KERN_INFO PREFIX "flags: 0x%x\n", gpio_evmi->flags);
 
-       old_delay = gpio_evmi->debounce_delay.tv.nsec;
+       old_debounce_delay = gpio_evmi->debounce_delay;
+       old_settle_time = gpio_evmi->settle_time;
+       old_poll_time = gpio_evmi->poll_time;
+       old_flags = gpio_evmi->flags;
 
        if (gpio_evmi->debounce_delay.tv.nsec != debounce_delay * NSEC_PER_MSEC) {
                printk(KERN_INFO PREFIX "Changing debounce_delay\n");
@@ -57,7 +62,9 @@ static int __init debounce_init(void)
                printk(KERN_INFO PREFIX "debounce_delay: %u\n", gpio_evmi->debounce_delay.tv.nsec);
        }
 
-       old_flags = gpio_evmi->flags;
+#if 0
+       gpio_evmi->flags &= ~GPIOKPF_REMOVE_SOME_PHANTOM_KEYS;
+#endif
 
        if (gpio_evmi->debounce_delay.tv.nsec != 0) {
                /* GPIOKPF_DEBOUNCE should already be set by GPIOKPF_REMOVE_PHANTOM_KEYS */
@@ -78,9 +85,9 @@ static int __init debounce_init(void)
 static void __exit debounce_exit(void)
 {
        if (gpio_evmi) {
-               if (gpio_evmi->debounce_delay.tv.nsec != old_delay) {
+               if (gpio_evmi->debounce_delay.tv.nsec != old_debounce_delay.tv.nsec) {
                        printk(KERN_INFO PREFIX "Restoring debounce_delay\n");
-                       gpio_evmi->debounce_delay.tv.nsec = old_delay;
+                       gpio_evmi->debounce_delay = old_debounce_delay;
                        printk(KERN_INFO PREFIX "debounce_delay: %u\n", gpio_evmi->debounce_delay.tv.nsec);
                }
                if (gpio_evmi->flags != old_flags) {
@@ -88,6 +95,8 @@ static void __exit debounce_exit(void)
                        gpio_evmi->flags = old_flags;
                        printk(KERN_INFO PREFIX "flags: 0x%x\n", gpio_evmi->flags);
                }
+               gpio_evmi->settle_time = old_settle_time;
+               gpio_evmi->poll_time = old_poll_time;
        }
 }
 
Impressum, Datenschutz