10 #include <linux/kernel.h>
11 #include <linux/module.h>
13 #include <linux/input.h>
17 #include <linux/slab.h>
40 else if (irq == ponkey->
irq_dbr)
43 input_sync(ponkey->
idev);
52 struct input_dev *
input;
58 dev_err(&pdev->
dev,
"No IRQ for ONKEY_DBF, error=%d\n", irq_dbf);
64 dev_err(&pdev->
dev,
"No IRQ for ONKEY_DBR, error=%d\n", irq_dbr);
69 input = input_allocate_device();
70 if (!ponkey || !input) {
80 input->name =
"AB8500 POn(PowerOn) Key";
81 input->dev.parent = &pdev->
dev;
86 0,
"ab8500-ponkey-dbf", ponkey);
88 dev_err(ab8500->
dev,
"Failed to request dbf IRQ#%d: %d\n",
94 0,
"ab8500-ponkey-dbr", ponkey);
96 dev_err(ab8500->
dev,
"Failed to request dbr IRQ#%d: %d\n",
98 goto err_free_dbf_irq;
101 error = input_register_device(ponkey->
idev);
103 dev_err(ab8500->
dev,
"Can't register input device: %d\n", error);
104 goto err_free_dbr_irq;
107 platform_set_drvdata(pdev, ponkey);
115 input_free_device(input);
127 input_unregister_device(ponkey->
idev);
130 platform_set_drvdata(pdev,
NULL);
136 static const struct of_device_id ab8500_ponkey_match[] = {
137 { .
compatible =
"stericsson,ab8500-ponkey", },
144 .name =
"ab8500-poweron-key",
148 .probe = ab8500_ponkey_probe,