+static ssize_t show_hw_debounce(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ return snprintf(buf, PAGE_SIZE, "%d\n", hw_debounce);
+}
+
+static ssize_t store_hw_debounce(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+{
+ int enable;
+
+ sscanf(buf, "%d", &enable);
+
+ if (enable) {
+ hw_debounce_set(1, -1);
+ hw_debounce = 1;
+ }
+ else {
+ hw_debounce_set(-1, 0);
+ hw_debounce_set(0, -1);
+ hw_debounce = 0;
+ hw_debounce_time = 0;
+ }
+
+ return count;
+}
+
+static ssize_t show_hw_debounce_time(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ return snprintf(buf, PAGE_SIZE, "%d\n", hw_debounce_time);
+}
+
+static ssize_t store_hw_debounce_time(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+{
+ int time;
+
+ sscanf(buf, "%d", &time);
+
+ if ((time < 0) || (time > 0xff))
+ return count;
+
+ if (!hw_debounce)
+ return count;
+
+ hw_debounce_set(-1, time);
+ hw_debounce_time = time;
+
+ return count;
+}
+