12 #include <linux/module.h>
23 static void gpio_mouse_scan(
struct input_polled_dev *
dev)
26 struct input_dev *
input = dev->input;
44 input_report_rel(input,
REL_X, x);
45 input_report_rel(input,
REL_Y, y);
52 struct input_polled_dev *input_poll;
53 struct input_dev *
input;
77 "missing GPIO for directions\n");
83 dev_dbg(&pdev->
dev,
"no left button defined\n");
99 dev_err(&pdev->
dev,
"not enough memory for input device\n");
104 platform_set_drvdata(pdev, input_poll);
107 input_poll->private =
pdata;
108 input_poll->poll = gpio_mouse_scan;
109 input_poll->poll_interval = pdata->
scan_ms;
111 input = input_poll->input;
112 input->name = pdev->
name;
114 input->dev.parent = &pdev->
dev;
118 if (pdata->
bleft >= 0)
127 dev_err(&pdev->
dev,
"could not register input device\n");
128 goto out_free_polldev;
131 dev_dbg(&pdev->
dev,
"%d ms scan time, buttons: %s%s%s\n",
133 pdata->
bleft < 0 ?
"" :
"left ",
134 pdata->
bmiddle < 0 ?
"" :
"middle ",
135 pdata->
bright < 0 ?
"" :
"right");
141 platform_set_drvdata(pdev,
NULL);
145 pin = pdata->
pins[
i];
155 struct input_polled_dev *input = platform_get_drvdata(pdev);
163 pin = pdata->
pins[
i];
168 platform_set_drvdata(pdev,
NULL);
174 .probe = gpio_mouse_probe,
177 .name =
"gpio_mouse",