23 #include <linux/module.h>
25 #include <linux/slab.h>
27 #define BUTTONS_POLL_INTERVAL 30
28 #define BUTTONS_COUNT_THRESHOLD 3
29 #define BUTTONS_STATUS_MASK 0xfe000000
31 static const unsigned short cobalt_map[] = {
49 static void handle_buttons(
struct input_polled_dev *
dev)
52 struct input_dev *
input = dev->input;
59 if (status & (1
U << i)) {
62 input_report_key(input, bdev->
keymap[i], 1);
68 input_report_key(input, bdev->
keymap[i], 0);
79 struct input_polled_dev *poll_dev;
80 struct input_dev *
input;
86 if (!bdev || !poll_dev) {
93 poll_dev->private = bdev;
94 poll_dev->poll = handle_buttons;
97 input = poll_dev->input;
98 input->name =
"Cobalt buttons";
99 input->phys =
"cobalt/input0";
101 input->dev.parent = &pdev->
dev;
103 input->keycode = bdev->
keymap;
105 input->keycodesize =
sizeof(
unsigned short);
159 .probe = cobalt_buttons_probe,
162 .name =
"Cobalt buttons",