20 #include <linux/module.h>
22 #include <linux/slab.h>
23 #include <linux/kernel.h>
24 #include <linux/errno.h>
25 #include <linux/input.h>
32 struct input_dev *
dev;
53 input_sync(wm831x_on->
dev);
55 dev_err(wm831x->
dev,
"Failed to read ON status: %d\n", ret);
65 struct wm831x_on *wm831x_on =
data;
75 struct wm831x_on *wm831x_on;
79 wm831x_on = kzalloc(
sizeof(
struct wm831x_on),
GFP_KERNEL);
88 wm831x_on->
dev = input_allocate_device();
89 if (!wm831x_on->
dev) {
90 dev_err(&pdev->
dev,
"Can't allocate input dev\n");
97 wm831x_on->
dev->name =
"wm831x_on";
98 wm831x_on->
dev->phys =
"wm831x_on/input0";
99 wm831x_on->
dev->dev.parent = &pdev->
dev;
105 dev_err(&pdev->
dev,
"Unable to request IRQ: %d\n", ret);
108 ret = input_register_device(wm831x_on->
dev);
110 dev_dbg(&pdev->
dev,
"Can't register input device: %d\n", ret);
114 platform_set_drvdata(pdev, wm831x_on);
121 input_free_device(wm831x_on->
dev);
129 struct wm831x_on *wm831x_on = platform_get_drvdata(pdev);
134 input_unregister_device(wm831x_on->
dev);
141 .probe = wm831x_on_probe,