15 #include <linux/input.h>
16 #include <linux/module.h>
30 static void da9052_onkey_query(
struct da9052_onkey *onkey)
37 "Failed to read onkey event %d\n", key_stat);
46 input_sync(onkey->
input);
62 da9052_onkey_query(onkey);
69 da9052_onkey_query(onkey);
78 struct input_dev *input_dev;
83 dev_err(&pdev->
dev,
"Failed to get the driver's data\n");
90 "Failed to get an IRQ for input device, %d\n", irq);
95 input_dev = input_allocate_device();
96 if (!onkey || !input_dev) {
97 dev_err(&pdev->
dev,
"Failed to allocate memory\n");
102 onkey->
input = input_dev;
107 input_dev->name =
"da9052-onkey";
108 input_dev->phys =
"da9052-onkey/input0";
109 input_dev->dev.parent = &pdev->
dev;
119 "Failed to register ONKEY IRQ %d, error = %d\n",
124 error = input_register_device(onkey->
input);
126 dev_err(&pdev->
dev,
"Unable to register input device, %d\n",
131 platform_set_drvdata(pdev, onkey);
138 input_free_device(input_dev);
146 struct da9052_onkey *onkey = platform_get_drvdata(pdev);
151 input_unregister_device(onkey->
input);
158 .probe = da9052_onkey_probe,
161 .name =
"da9052-onkey",