X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/ms2-fixes/blobdiff_plain/c0cd650e5a84b1259a79f520a102297d418a92e0..2bb83a0e6c37053577c741fd25eeeeeb3364fd66:/debounce.c diff --git a/debounce.c b/debounce.c index 08dc7f4..e604016 100644 --- a/debounce.c +++ b/debounce.c @@ -352,8 +352,6 @@ static ssize_t store_hw_debounce(struct device *dev, struct device_attribute *at if (enable) { hw_debounce_set(1, -1); hw_debounce = 1; - hw_debounce_set(-1, 0); - hw_debounce_time = 0; } else { hw_debounce_set(-1, 0); @@ -379,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;