21 #include <linux/kernel.h>
22 #include <linux/module.h>
24 #include <linux/i2c.h>
25 #include <linux/input.h>
28 #include <linux/slab.h>
30 #define SW_INPUT (1 << 7)
31 #define HARDRESET_EN (1 << 7)
32 #define PWREN_EN (1 << 7)
54 input_sync(info->
idev);
69 struct input_dev *
input;
85 input = input_allocate_device();
86 if (!info || !input) {
94 info->
irq[0] = irq[0];
95 info->
irq[1] = irq[1];
97 input->name =
"max8925_on";
98 input->phys =
"max8925_on/input0";
100 input->dev.parent = &pdev->
dev;
109 dev_err(chip->
dev,
"Failed to request IRQ: #%d: %d\n",
117 dev_err(chip->
dev,
"Failed to request IRQ: #%d: %d\n",
122 error = input_register_device(info->
idev);
124 dev_err(chip->
dev,
"Can't register input device: %d\n", error);
128 platform_set_drvdata(pdev, info);
138 input_free_device(input);
151 input_unregister_device(info->
idev);
154 platform_set_drvdata(pdev,
NULL);
159 #ifdef CONFIG_PM_SLEEP
160 static int max8925_onkey_suspend(
struct device *
dev)
166 if (device_may_wakeup(dev)) {
174 static int max8925_onkey_resume(
struct device *dev)
180 if (device_may_wakeup(dev)) {
189 static SIMPLE_DEV_PM_OPS(max8925_onkey_pm_ops, max8925_onkey_suspend, max8925_onkey_resume);
193 .name =
"max8925-onkey",
195 .pm = &max8925_onkey_pm_ops,
197 .probe = max8925_onkey_probe,