]> git.zerfleddert.de Git - ms2-fixes/commitdiff
don't do unnecessary debounce configs
authorMichael Gernoth <michael@gernoth.net>
Sun, 21 Aug 2011 13:58:56 +0000 (15:58 +0200)
committerMichael Gernoth <michael@gernoth.net>
Sun, 21 Aug 2011 13:58:56 +0000 (15:58 +0200)
MS2Debounce/assets/debounce.ko
debounce.c

index fd7f4066d7fc02eaafc441ff23af8ec036747bc7..5c440d8bcbfd5ca426bf3c00931c960e7cf200c1 100644 (file)
Binary files a/MS2Debounce/assets/debounce.ko and b/MS2Debounce/assets/debounce.ko differ
index 45b01403fb1d31daef858cfa088578b808fc1ec9..0f45a4b09752dd2b832e2cf337856896ebf366d8 100644 (file)
@@ -33,15 +33,15 @@ static void hw_debounce_set(int enable, int time) {
        for (i = 0; i < gpio_evmi->ninputs; i++) {
                int gpio = gpio_evmi->input_gpios[i];
 
-               if (enable != -1) {
-                       printk(KERN_INFO PREFIX "%sabling hardware debounce for GPIO %d\n", (enable?"En":"Dis"), gpio);
-                       omap_set_gpio_debounce(gpio, enable);
-               }
-
-               if ((time != -1) && hw_debounce) {
+               if ((time != -1) && (time != hw_debounce_time) && hw_debounce) {
                        printk(KERN_INFO PREFIX "Setting hardware debounce time for GPIO %d to %d (%dus)\n", gpio, time, (time+1)*31);
                        omap_set_gpio_debounce_time(gpio, time);
                }
+
+               if ((enable != -1) && (enable != hw_debounce)) {
+                       printk(KERN_INFO PREFIX "%sabling hardware debounce for GPIO %d\n", (enable?"En":"Dis"), gpio);
+                       omap_set_gpio_debounce(gpio, enable);
+               }
        }
 }
 
Impressum, Datenschutz