static ktime_t old_debounce_delay;
static ktime_t old_settle_time;
static ktime_t old_poll_time;
+static int (*old_sw_fixup)(int index);
static struct gpio_event_matrix_info *gpio_evmi = NULL;
static int hw_debounce = 0;
static int hw_debounce_time = 0;
static DEVICE_ATTR(hw_debounce, (S_IRUGO | S_IWUGO), show_hw_debounce, store_hw_debounce);
static DEVICE_ATTR(hw_debounce_time, (S_IRUGO | S_IWUGO), show_hw_debounce_time, store_hw_debounce_time);
+#if 0
+static int debounce_fixup(int index)
+{
+ int ret;
+
+ printk(KERN_INFO PREFIX "0x%x\n", index);
+
+ ret = old_sw_fixup(index);
+ if (!ret)
+ printk(KERN_INFO PREFIX "IGNORED!\n");
+
+ return ret;
+}
+#endif
+
static void debounce_release(struct device *dev)
{
}
old_settle_time = gpio_evmi->settle_time;
old_poll_time = gpio_evmi->poll_time;
old_flags = gpio_evmi->flags;
+ old_sw_fixup = gpio_evmi->sw_fixup;
- printk(KERN_INFO PREFIX "flags: 0x%x\n", gpio_evmi->flags);
+#if 0
+ printk(KERN_INFO PREFIX "Registering fixup handler\n");
+ gpio_evmi->sw_fixup = debounce_fixup;
+#endif
return 0;
}
}
gpio_evmi->settle_time = old_settle_time;
gpio_evmi->poll_time = old_poll_time;
+
+ if (gpio_evmi->sw_fixup != old_sw_fixup) {
+ printk(KERN_INFO PREFIX "Restoring fixup handler\n");
+ gpio_evmi->sw_fixup = old_sw_fixup;
+ }
}
hw_debounce_set(0, 0);
device_remove_file(&debounce_device, &dev_attr_debounce_delay);