11 #include <linux/kernel.h>
13 #include <linux/slab.h>
14 #include <linux/input.h>
20 #include <linux/module.h>
105 static irqreturn_t dm355evm_keys_irq(
int irq,
void *_keys)
107 static u16 last_event;
109 const struct key_entry *ke;
148 if (event == last_event) {
158 ke = sparse_keymap_entry_from_scancode(keys->
input, event);
161 "input event 0x%04x--> keycode %d\n",
165 input_report_key(keys->
input, keycode, 1);
166 input_sync(keys->
input);
167 input_report_key(keys->
input, keycode, 0);
168 input_sync(keys->
input);
179 struct input_dev *
input;
184 input = input_allocate_device();
185 if (!keys || !input) {
199 input_set_drvdata(input, keys);
201 input->name =
"DM355 EVM Controls";
202 input->phys =
"dm355evm/input0";
203 input->dev.parent = &pdev->
dev;
206 input->id.product = 0x0355;
217 dev_name(&pdev->
dev), keys);
222 status = input_register_device(input);
226 platform_set_drvdata(pdev, keys);
233 sparse_keymap_free(input);
235 input_free_device(input);
237 dev_err(&pdev->
dev,
"can't register, err %d\n", status);
247 sparse_keymap_free(keys->
input);
248 input_unregister_device(keys->
input);
264 .probe = dm355evm_keys_probe,
268 .name =
"dm355evm_keys",