9 #include <linux/kernel.h>
10 #include <linux/module.h>
13 #include <linux/input.h>
16 #include <linux/slab.h>
23 #define SBCR_ERSB (1 << 5)
69 static int pxa930_rotary_open(
struct input_dev *
dev)
89 struct input_dev *input_dev;
96 dev_err(&pdev->
dev,
"no irq for rotary controller\n");
102 dev_err(&pdev->
dev,
"no I/O memory defined\n");
107 dev_err(&pdev->
dev,
"no platform data defined\n");
117 dev_err(&pdev->
dev,
"failed to remap IO memory\n");
123 platform_set_drvdata(pdev, r);
126 input_dev = input_allocate_device();
128 dev_err(&pdev->
dev,
"failed to allocate input device\n");
133 input_dev->name = pdev->
name;
135 input_dev->open = pxa930_rotary_open;
136 input_dev->close = pxa930_rotary_close;
137 input_dev->dev.parent = &pdev->
dev;
149 input_set_drvdata(input_dev, r);
152 "enhanced rotary", r);
154 dev_err(&pdev->
dev,
"failed to request IRQ\n");
155 goto failed_free_input;
158 err = input_register_device(input_dev);
160 dev_err(&pdev->
dev,
"failed to register input device\n");
161 goto failed_free_irq;
169 input_free_device(input_dev);
184 platform_set_drvdata(pdev,
NULL);
192 .name =
"pxa930-rotary",
195 .probe = pxa930_rotary_probe,