14 #include <linux/module.h>
18 #include <linux/input.h>
20 #include <linux/slab.h>
28 static irqreturn_t pcap_keys_handler(
int irq,
void *_pcap_keys)
46 input_sync(pcap_keys->
input);
55 struct input_dev *input_dev;
63 input_dev = input_allocate_device();
67 pcap_keys->
input = input_dev;
69 platform_set_drvdata(pdev, pcap_keys);
70 input_dev->name = pdev->
name;
71 input_dev->phys =
"pcap-keys/input0";
73 input_dev->dev.parent = &pdev->
dev;
79 err = input_register_device(input_dev);
84 pcap_keys_handler, 0,
"Power key", pcap_keys);
89 pcap_keys_handler, 0,
"Headphone button", pcap_keys);
98 input_unregister_device(input_dev);
101 input_free_device(input_dev);
109 struct pcap_keys *pcap_keys = platform_get_drvdata(pdev);
114 input_unregister_device(pcap_keys->
input);
121 .probe = pcap_keys_probe,