From: Michael Gernoth Date: Sun, 21 Aug 2011 13:58:56 +0000 (+0200) Subject: don't do unnecessary debounce configs X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/ms2-fixes/commitdiff_plain/308fc1a5e33464760d1f87b6cb3bff96b0ad3e5f?ds=inline don't do unnecessary debounce configs --- diff --git a/MS2Debounce/assets/debounce.ko b/MS2Debounce/assets/debounce.ko index fd7f406..5c440d8 100644 Binary files a/MS2Debounce/assets/debounce.ko and b/MS2Debounce/assets/debounce.ko differ diff --git a/debounce.c b/debounce.c index 45b0140..0f45a4b 100644 --- a/debounce.c +++ b/debounce.c @@ -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); + } } }