1 #include <linux/module.h>
2 #include <linux/device.h>
3 #include <linux/platform_device.h>
4 #include <linux/gpio_event.h>
5 #include <linux/interrupt.h>
8 #include <linux/earlysuspend.h>
9 #include <linux/wakelock.h>
10 #include <plat/board-mapphone.h>
12 #define PREFIX "debounce: "
14 #define PADCONF_PULL_UP ( OMAP343X_PADCONF_OFF_WAKEUP_ENABLED | \
15 OMAP343X_PADCONF_INPUT_ENABLED | \
16 OMAP343X_PADCONF_PULL_UP | \
17 OMAP343X_PADCONF_PUD_ENABLED | \
18 OMAP343X_PADCONF_MUXMODE4 )
20 #define PADCONF_PULL_DOWN ( OMAP343X_PADCONF_OFF_WAKEUP_ENABLED | \
21 OMAP343X_PADCONF_INPUT_ENABLED | \
22 OMAP343X_PADCONF_PULL_DOWN | \
23 OMAP343X_PADCONF_PUD_ENABLED | \
24 OMAP343X_PADCONF_MUXMODE4 )
26 #define OMAP_CTRL_REGADDR(reg) (OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE) + (reg))
28 static unsigned old_flags
= 0;
29 static ktime_t old_debounce_delay
;
30 static ktime_t old_settle_time
;
31 static ktime_t old_poll_time
;
32 static int (*old_sw_fixup
)(int index
);
33 static struct gpio_event_matrix_info
*gpio_evmi
= NULL
;
34 static int hw_debounce
= 0;
35 static int hw_debounce_time
= 0;
38 struct gpio_event_input_devs
*input_devs
;
39 const struct gpio_event_platform_data
*info
;
40 struct early_suspend early_suspend
;
45 struct gpio_event_input_devs
*input_devs
;
46 struct gpio_event_matrix_info
*keypad_info
;
48 struct wake_lock wake_lock
;
50 unsigned int use_irq
:1;
51 unsigned int key_state_changed
:1;
52 unsigned int last_key_state_changed
:1;
53 unsigned int some_keys_pressed
:2;
54 unsigned long keys_pressed
[0];
57 static struct gpio_kp
*gpio_kp_state
= NULL
;
59 static int find_ms2_dev(struct device
*dev
, void *data
)
61 if (!strncmp((char*)data
, dev_name(dev
), strlen((char*)data
))) {
62 printk(KERN_INFO PREFIX
"Found it\n");
68 /* hardware debounce: (time + 1) * 31us */
69 static void hw_debounce_set(int enable
, int time
) {
72 if (gpio_evmi
== NULL
)
75 for (i
= 0; i
< gpio_evmi
->ninputs
; i
++) {
76 int gpio
= gpio_evmi
->input_gpios
[i
];
78 if ((time
!= -1) && (time
!= hw_debounce_time
) && hw_debounce
) {
79 printk(KERN_INFO PREFIX
"Setting hardware debounce time for GPIO %d to %d (%dus)\n", gpio
, time
, (time
+1)*31);
80 omap_set_gpio_debounce_time(gpio
, time
);
83 if ((enable
!= -1) && (enable
!= hw_debounce
)) {
84 printk(KERN_INFO PREFIX
"%sabling hardware debounce for GPIO %d\n", (enable
?"En":"Dis"), gpio
);
85 omap_set_gpio_debounce(gpio
, enable
);
90 static void set_irq_types(void) {
96 if (gpio_evmi
== NULL
)
99 switch (gpio_evmi
->flags
& (GPIOKPF_ACTIVE_HIGH
|GPIOKPF_LEVEL_TRIGGERED_IRQ
)) {
101 type
= IRQ_TYPE_EDGE_FALLING
;
103 case GPIOKPF_ACTIVE_HIGH
:
104 type
= IRQ_TYPE_EDGE_RISING
;
106 case GPIOKPF_LEVEL_TRIGGERED_IRQ
:
107 type
= IRQ_TYPE_LEVEL_LOW
;
109 case GPIOKPF_LEVEL_TRIGGERED_IRQ
| GPIOKPF_ACTIVE_HIGH
:
110 type
= IRQ_TYPE_LEVEL_HIGH
;
114 printk(KERN_INFO PREFIX
"Settinhg IRQ type to 0x%lx\n", type
);
116 for (i
= 0; i
< gpio_evmi
->ninputs
; i
++) {
118 err
= irq
= gpio_to_irq(gpio_evmi
->input_gpios
[i
]);
123 err
= set_irq_type(irq
, type
);
127 static ssize_t
show_debounce_delay(struct device
*dev
, struct device_attribute
*attr
, char *buf
)
132 return snprintf(buf
, PAGE_SIZE
, "%ld\n", (gpio_evmi
->debounce_delay
.tv
.nsec
/ NSEC_PER_MSEC
));
135 static void set_debounce_delay(long delay
)
137 if (gpio_evmi
->debounce_delay
.tv
.nsec
!= delay
* NSEC_PER_MSEC
) {
138 printk(KERN_INFO PREFIX
"Changing debounce_delay\n");
139 gpio_evmi
->debounce_delay
.tv
.nsec
= delay
* NSEC_PER_MSEC
;
140 printk(KERN_INFO PREFIX
"debounce_delay: %u\n", gpio_evmi
->debounce_delay
.tv
.nsec
);
144 if (gpio_evmi
->debounce_delay
.tv
.nsec
!= 0) {
145 if (!(gpio_evmi
->flags
& GPIOKPF_DEBOUNCE
)) {
146 printk(KERN_INFO PREFIX
"Activating debounce\n");
147 gpio_evmi
->flags
|= GPIOKPF_DEBOUNCE
;
150 if (gpio_evmi
->flags
& GPIOKPF_DEBOUNCE
) {
151 printk(KERN_INFO PREFIX
"Deactivating debounce\n");
152 gpio_evmi
->flags
&= ~GPIOKPF_DEBOUNCE
;
158 static ssize_t
store_debounce_delay(struct device
*dev
, struct device_attribute
*attr
, const char *buf
, size_t count
)
165 sscanf(buf
, "%ld", &delay
);
166 set_debounce_delay(delay
);
171 static ssize_t
show_settle_time(struct device
*dev
, struct device_attribute
*attr
, char *buf
)
176 return snprintf(buf
, PAGE_SIZE
, "%ld\n", (gpio_evmi
->settle_time
.tv
.nsec
/ NSEC_PER_USEC
));
179 static ssize_t
store_settle_time(struct device
*dev
, struct device_attribute
*attr
, const char *buf
, size_t count
)
186 sscanf(buf
, "%ld", &delay
);
187 gpio_evmi
->settle_time
.tv
.nsec
= delay
* NSEC_PER_USEC
;
192 static ssize_t
show_poll_time(struct device
*dev
, struct device_attribute
*attr
, char *buf
)
197 return snprintf(buf
, PAGE_SIZE
, "%ld\n", (gpio_evmi
->poll_time
.tv
.nsec
/ NSEC_PER_MSEC
));
200 static ssize_t
store_poll_time(struct device
*dev
, struct device_attribute
*attr
, const char *buf
, size_t count
)
207 sscanf(buf
, "%ld", &delay
);
208 gpio_evmi
->poll_time
.tv
.nsec
= delay
* NSEC_PER_MSEC
;
213 static ssize_t
show_flags(struct device
*dev
, struct device_attribute
*attr
, char *buf
)
218 return snprintf(buf
, PAGE_SIZE
, "0x%x\n", gpio_evmi
->flags
);
221 static ssize_t
store_flags(struct device
*dev
, struct device_attribute
*attr
, const char *buf
, size_t count
)
228 sscanf(buf
, "0x%x", &flags
);
230 printk(KERN_INFO PREFIX
"flags: 0x%x\n", flags
);
232 gpio_evmi
->flags
= flags
;
237 static ssize_t
show_debounce_flag(struct device
*dev
, struct device_attribute
*attr
, char *buf
)
242 return snprintf(buf
, PAGE_SIZE
, "%u\n", (gpio_evmi
->flags
& GPIOKPF_DEBOUNCE
) ? 1 : 0);
245 static ssize_t
store_debounce_flag(struct device
*dev
, struct device_attribute
*attr
, const char *buf
, size_t count
)
252 sscanf(buf
, "%u", &flag
);
255 gpio_evmi
->flags
|= GPIOKPF_DEBOUNCE
;
257 gpio_evmi
->flags
&= ~GPIOKPF_DEBOUNCE
;
263 static ssize_t
show_remove_some_phantom_keys_flag(struct device
*dev
, struct device_attribute
*attr
, char *buf
)
268 return snprintf(buf
, PAGE_SIZE
, "%u\n", (gpio_evmi
->flags
& GPIOKPF_REMOVE_SOME_PHANTOM_KEYS
) ? 1 : 0);
271 static ssize_t
store_remove_some_phantom_keys_flag(struct device
*dev
, struct device_attribute
*attr
, const char *buf
, size_t count
)
278 sscanf(buf
, "%u", &flag
);
281 gpio_evmi
->flags
|= GPIOKPF_REMOVE_SOME_PHANTOM_KEYS
;
283 gpio_evmi
->flags
&= ~GPIOKPF_REMOVE_SOME_PHANTOM_KEYS
;
289 static ssize_t
show_print_unmapped_keys_flag(struct device
*dev
, struct device_attribute
*attr
, char *buf
)
294 return snprintf(buf
, PAGE_SIZE
, "%u\n", (gpio_evmi
->flags
& GPIOKPF_PRINT_UNMAPPED_KEYS
) ? 1 : 0);
297 static ssize_t
store_print_unmapped_keys_flag(struct device
*dev
, struct device_attribute
*attr
, const char *buf
, size_t count
)
304 sscanf(buf
, "%u", &flag
);
307 gpio_evmi
->flags
|= GPIOKPF_PRINT_UNMAPPED_KEYS
;
309 gpio_evmi
->flags
&= ~GPIOKPF_PRINT_UNMAPPED_KEYS
;
315 static ssize_t
show_print_mapped_keys_flag(struct device
*dev
, struct device_attribute
*attr
, char *buf
)
320 return snprintf(buf
, PAGE_SIZE
, "%u\n", (gpio_evmi
->flags
& GPIOKPF_PRINT_MAPPED_KEYS
) ? 1 : 0);
323 static ssize_t
store_print_mapped_keys_flag(struct device
*dev
, struct device_attribute
*attr
, const char *buf
, size_t count
)
330 sscanf(buf
, "%u", &flag
);
333 gpio_evmi
->flags
|= GPIOKPF_PRINT_MAPPED_KEYS
;
335 gpio_evmi
->flags
&= ~GPIOKPF_PRINT_MAPPED_KEYS
;
341 static ssize_t
show_print_phantom_keys_flag(struct device
*dev
, struct device_attribute
*attr
, char *buf
)
346 return snprintf(buf
, PAGE_SIZE
, "%u\n", (gpio_evmi
->flags
& GPIOKPF_PRINT_PHANTOM_KEYS
) ? 1 : 0);
349 static ssize_t
store_print_phantom_keys_flag(struct device
*dev
, struct device_attribute
*attr
, const char *buf
, size_t count
)
356 sscanf(buf
, "%u", &flag
);
359 gpio_evmi
->flags
|= GPIOKPF_PRINT_PHANTOM_KEYS
;
361 gpio_evmi
->flags
&= ~GPIOKPF_PRINT_PHANTOM_KEYS
;
367 static ssize_t
show_active_high_flag(struct device
*dev
, struct device_attribute
*attr
, char *buf
)
372 return snprintf(buf
, PAGE_SIZE
, "%u\n", (gpio_evmi
->flags
& GPIOKPF_ACTIVE_HIGH
) ? 1 : 0);
375 static ssize_t
store_active_high_flag(struct device
*dev
, struct device_attribute
*attr
, const char *buf
, size_t count
)
383 sscanf(buf
, "%u", &flag
);
386 gpio_evmi
->flags
|= GPIOKPF_ACTIVE_HIGH
;
387 for (i
= 0x7a; i
<= 0x88; i
+= 2) {
388 __raw_writew(PADCONF_PULL_DOWN
, OMAP_CTRL_REGADDR(i
));
391 gpio_evmi
->flags
&= ~GPIOKPF_ACTIVE_HIGH
;
392 for (i
= 0x7a; i
<= 0x88; i
+= 2) {
393 __raw_writew(PADCONF_PULL_UP
, OMAP_CTRL_REGADDR(i
));
402 static ssize_t
show_level_triggered_irq_flag(struct device
*dev
, struct device_attribute
*attr
, char *buf
)
407 return snprintf(buf
, PAGE_SIZE
, "%u\n", (gpio_evmi
->flags
& GPIOKPF_LEVEL_TRIGGERED_IRQ
) ? 1 : 0);
410 static ssize_t
store_level_triggered_irq_flag(struct device
*dev
, struct device_attribute
*attr
, const char *buf
, size_t count
)
417 sscanf(buf
, "%u", &flag
);
420 gpio_evmi
->flags
|= GPIOKPF_LEVEL_TRIGGERED_IRQ
;
422 gpio_evmi
->flags
&= ~GPIOKPF_LEVEL_TRIGGERED_IRQ
;
430 static ssize_t
show_drive_inactive_flag(struct device
*dev
, struct device_attribute
*attr
, char *buf
)
435 return snprintf(buf
, PAGE_SIZE
, "%u\n", (gpio_evmi
->flags
& GPIOKPF_DRIVE_INACTIVE
) ? 1 : 0);
438 static ssize_t
store_drive_inactive_flag(struct device
*dev
, struct device_attribute
*attr
, const char *buf
, size_t count
)
445 sscanf(buf
, "%u", &flag
);
448 gpio_evmi
->flags
|= GPIOKPF_DRIVE_INACTIVE
;
450 gpio_evmi
->flags
&= ~GPIOKPF_DRIVE_INACTIVE
;
456 static ssize_t
show_hw_debounce(struct device
*dev
, struct device_attribute
*attr
, char *buf
)
458 return snprintf(buf
, PAGE_SIZE
, "%d\n", hw_debounce
);
461 static ssize_t
store_hw_debounce(struct device
*dev
, struct device_attribute
*attr
, const char *buf
, size_t count
)
465 sscanf(buf
, "%d", &enable
);
468 hw_debounce_set(1, -1);
472 hw_debounce_set(-1, 0);
473 hw_debounce_set(0, -1);
475 hw_debounce_time
= 0;
481 static ssize_t
show_hw_debounce_time(struct device
*dev
, struct device_attribute
*attr
, char *buf
)
483 return snprintf(buf
, PAGE_SIZE
, "%d\n", hw_debounce_time
);
486 static ssize_t
store_hw_debounce_time(struct device
*dev
, struct device_attribute
*attr
, const char *buf
, size_t count
)
490 sscanf(buf
, "%d", &time
);
492 if ((time
< 0) || (time
> 0xff))
498 hw_debounce_set(-1, time
);
499 hw_debounce_time
= time
;
504 static DEVICE_ATTR(debounce_delay
, (S_IRUGO
| S_IWUGO
), show_debounce_delay
, store_debounce_delay
);
505 static DEVICE_ATTR(settle_time
, (S_IRUGO
| S_IWUGO
), show_settle_time
, store_settle_time
);
506 static DEVICE_ATTR(poll_time
, (S_IRUGO
| S_IWUGO
), show_poll_time
, store_poll_time
);
507 static DEVICE_ATTR(flags
, (S_IRUGO
), show_flags
, store_flags
);
508 static DEVICE_ATTR(debounce_flag
, (S_IRUGO
| S_IWUGO
), show_debounce_flag
, store_debounce_flag
);
509 static DEVICE_ATTR(remove_some_phantom_keys_flag
, (S_IRUGO
| S_IWUGO
), show_remove_some_phantom_keys_flag
, store_remove_some_phantom_keys_flag
);
510 static DEVICE_ATTR(print_unmapped_keys_flag
, (S_IRUGO
| S_IWUGO
), show_print_unmapped_keys_flag
, store_print_unmapped_keys_flag
);
511 static DEVICE_ATTR(print_mapped_keys_flag
, (S_IRUGO
| S_IWUGO
), show_print_mapped_keys_flag
, store_print_mapped_keys_flag
);
512 static DEVICE_ATTR(print_phantom_keys_flag
, (S_IRUGO
| S_IWUGO
), show_print_phantom_keys_flag
, store_print_phantom_keys_flag
);
513 static DEVICE_ATTR(active_high_flag
, (S_IRUGO
| S_IWUGO
), show_active_high_flag
, store_active_high_flag
);
514 static DEVICE_ATTR(level_triggered_irq_flag
, (S_IRUGO
| S_IWUGO
), show_level_triggered_irq_flag
, store_level_triggered_irq_flag
);
515 static DEVICE_ATTR(drive_inactive_flag
, (S_IRUGO
| S_IWUGO
), show_drive_inactive_flag
, store_drive_inactive_flag
);
516 static DEVICE_ATTR(hw_debounce
, (S_IRUGO
| S_IWUGO
), show_hw_debounce
, store_hw_debounce
);
517 static DEVICE_ATTR(hw_debounce_time
, (S_IRUGO
| S_IWUGO
), show_hw_debounce_time
, store_hw_debounce_time
);
520 static int debounce_fixup(int index
)
524 printk(KERN_INFO PREFIX
"key_state_changed: %d, last_key_state_changed: %d, some_keys_pressed: %d\n",
525 gpio_kp_state
->key_state_changed
,
526 gpio_kp_state
->last_key_state_changed
,
527 gpio_kp_state
->some_keys_pressed
);
529 ret
= old_sw_fixup(index
);
531 printk(KERN_INFO PREFIX
"Index 0x%x ignored!\n", index
);
537 static void debounce_release(struct device
*dev
)
541 static struct device debounce_device
= {
542 .init_name
= "debounce",
543 .release
= debounce_release
,
546 static int __init
debounce_init(void)
548 struct device
*event_dev
= NULL
;
549 struct platform_device
*pdev
= NULL
;
550 struct gpio_event_platform_data
*gpio_epd
;
551 struct gpio_event_info
*gpio_ei
;
552 struct gpio_event
*gpio_e
;
556 printk(KERN_INFO PREFIX
"Searching for " GPIO_EVENT_DEV_NAME
"...\n");
558 event_dev
= device_find_child(&platform_bus
, GPIO_EVENT_DEV_NAME
, find_ms2_dev
);
559 if (event_dev
== NULL
)
562 pdev
= container_of(event_dev
, struct platform_device
, dev
);
566 gpio_epd
= (struct gpio_event_platform_data
*)event_dev
->platform_data
;
567 printk(KERN_INFO PREFIX
"And there is a %s connected...\n", gpio_epd
->name
);
568 if (strcmp(gpio_epd
->name
, "sholes-keypad"))
571 gpio_ei
= (struct gpio_event_info
*)gpio_epd
->info
[0];
572 gpio_evmi
= container_of(gpio_ei
, struct gpio_event_matrix_info
, info
);
574 gpio_e
= platform_get_drvdata(pdev
);
575 printk(KERN_INFO PREFIX
"Number of states: %d\n", gpio_e
->info
->info_count
);
577 /* Search for correct gpio_event state */
578 for (i
= 0; i
< gpio_e
->info
->info_count
; i
++) {
579 if (gpio_e
->info
->info
[i
]->func
== gpio_ei
->func
) {
580 printk(KERN_INFO PREFIX
"Keypad state: %d\n", i
);
581 gpio_kp_state
= gpio_e
->state
[i
];
585 if (!gpio_kp_state
) {
586 printk(KERN_ERR PREFIX
"Can't determine correct keypad state!\n");
590 printk(KERN_INFO PREFIX
"kp_use_irq: %d\n", gpio_kp_state
->use_irq
);
592 gpio_kp_state
->use_irq
=0;
593 hrtimer_start(&(gpio_kp_state
->timer
), gpio_evmi
->poll_time
, HRTIMER_MODE_REL
);
594 printk(KERN_INFO PREFIX
"kp_use_irq: %d\n", gpio_kp_state
->use_irq
);
597 err
= device_register(&debounce_device
);
602 err
= device_create_file(&debounce_device
, &dev_attr_debounce_delay
);
603 err
= device_create_file(&debounce_device
, &dev_attr_settle_time
);
604 err
= device_create_file(&debounce_device
, &dev_attr_poll_time
);
605 err
= device_create_file(&debounce_device
, &dev_attr_flags
);
606 err
= device_create_file(&debounce_device
, &dev_attr_debounce_flag
);
607 err
= device_create_file(&debounce_device
, &dev_attr_remove_some_phantom_keys_flag
);
608 err
= device_create_file(&debounce_device
, &dev_attr_print_unmapped_keys_flag
);
609 err
= device_create_file(&debounce_device
, &dev_attr_print_mapped_keys_flag
);
610 err
= device_create_file(&debounce_device
, &dev_attr_print_phantom_keys_flag
);
611 err
= device_create_file(&debounce_device
, &dev_attr_active_high_flag
);
612 err
= device_create_file(&debounce_device
, &dev_attr_level_triggered_irq_flag
);
613 err
= device_create_file(&debounce_device
, &dev_attr_drive_inactive_flag
);
614 err
= device_create_file(&debounce_device
, &dev_attr_hw_debounce
);
615 err
= device_create_file(&debounce_device
, &dev_attr_hw_debounce_time
);
617 printk(KERN_INFO PREFIX
"settle_time: %u\n", gpio_evmi
->settle_time
.tv
.nsec
);
618 printk(KERN_INFO PREFIX
"poll_time: %u\n", gpio_evmi
->poll_time
.tv
.nsec
);
619 printk(KERN_INFO PREFIX
"debounce_delay: %u\n", gpio_evmi
->debounce_delay
.tv
.nsec
);
620 printk(KERN_INFO PREFIX
"flags: 0x%x\n", gpio_evmi
->flags
);
622 old_debounce_delay
= gpio_evmi
->debounce_delay
;
623 old_settle_time
= gpio_evmi
->settle_time
;
624 old_poll_time
= gpio_evmi
->poll_time
;
625 old_flags
= gpio_evmi
->flags
;
626 old_sw_fixup
= gpio_evmi
->sw_fixup
;
629 printk(KERN_INFO PREFIX
"Registering fixup handler\n");
630 gpio_evmi
->sw_fixup
= debounce_fixup
;
636 static void __exit
debounce_exit(void)
641 if (gpio_evmi
->debounce_delay
.tv
.nsec
!= old_debounce_delay
.tv
.nsec
) {
642 printk(KERN_INFO PREFIX
"Restoring debounce_delay\n");
643 gpio_evmi
->debounce_delay
= old_debounce_delay
;
644 printk(KERN_INFO PREFIX
"debounce_delay: %u\n", gpio_evmi
->debounce_delay
.tv
.nsec
);
646 if (gpio_evmi
->flags
!= old_flags
) {
647 printk(KERN_INFO PREFIX
"Restoring flags\n");
648 gpio_evmi
->flags
= old_flags
;
649 printk(KERN_INFO PREFIX
"flags: 0x%x\n", gpio_evmi
->flags
);
650 if (gpio_evmi
->flags
& GPIOKPF_ACTIVE_HIGH
) {
651 for (i
= 0x7a; i
<= 0x88; i
+= 2) {
652 __raw_writew(PADCONF_PULL_DOWN
, OMAP_CTRL_REGADDR(i
));
655 for (i
= 0x7a; i
<= 0x88; i
+= 2) {
656 __raw_writew(PADCONF_PULL_UP
, OMAP_CTRL_REGADDR(i
));
661 gpio_evmi
->settle_time
= old_settle_time
;
662 gpio_evmi
->poll_time
= old_poll_time
;
664 if (gpio_evmi
->sw_fixup
!= old_sw_fixup
) {
665 printk(KERN_INFO PREFIX
"Restoring fixup handler\n");
666 gpio_evmi
->sw_fixup
= old_sw_fixup
;
669 hw_debounce_set(0, 0);
670 device_remove_file(&debounce_device
, &dev_attr_debounce_delay
);
671 device_remove_file(&debounce_device
, &dev_attr_settle_time
);
672 device_remove_file(&debounce_device
, &dev_attr_poll_time
);
673 device_remove_file(&debounce_device
, &dev_attr_flags
);
674 device_remove_file(&debounce_device
, &dev_attr_debounce_flag
);
675 device_remove_file(&debounce_device
, &dev_attr_remove_some_phantom_keys_flag
);
676 device_remove_file(&debounce_device
, &dev_attr_print_unmapped_keys_flag
);
677 device_remove_file(&debounce_device
, &dev_attr_print_mapped_keys_flag
);
678 device_remove_file(&debounce_device
, &dev_attr_print_phantom_keys_flag
);
679 device_remove_file(&debounce_device
, &dev_attr_active_high_flag
);
680 device_remove_file(&debounce_device
, &dev_attr_level_triggered_irq_flag
);
681 device_remove_file(&debounce_device
, &dev_attr_drive_inactive_flag
);
682 device_remove_file(&debounce_device
, &dev_attr_hw_debounce
);
683 device_remove_file(&debounce_device
, &dev_attr_hw_debounce_time
);
684 device_unregister(&debounce_device
);
687 module_init(debounce_init
);
688 module_exit(debounce_exit
);
690 MODULE_LICENSE("GPL");
691 MODULE_AUTHOR("Michael Gernoth <michael@gernoth.net>");