X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/ms2-fixes/blobdiff_plain/308fc1a5e33464760d1f87b6cb3bff96b0ad3e5f..8440ec7c4b58305b60157d0ce8ae0260ed880bca:/debounce.c diff --git a/debounce.c b/debounce.c index 0f45a4b..e604016 100644 --- a/debounce.c +++ b/debounce.c @@ -354,8 +354,10 @@ static ssize_t store_hw_debounce(struct device *dev, struct device_attribute *at hw_debounce = 1; } else { + hw_debounce_set(-1, 0); hw_debounce_set(0, -1); hw_debounce = 0; + hw_debounce_time = 0; } return count; @@ -375,6 +377,9 @@ static ssize_t store_hw_debounce_time(struct device *dev, struct device_attribut if ((time < 0) || (time > 0xff)) return count; + if (!hw_debounce) + return count; + hw_debounce_set(-1, time); hw_debounce_time = time;