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 PM8607_WAKEUP 0x0b
32 #define LONG_ONKEY_EN (1 << 1)
33 #define ONKEY_STATUS (1 << 0)
52 input_sync(info->
idev);
79 info->
idev = input_allocate_device();
81 dev_err(chip->
dev,
"Failed to allocate input dev\n");
86 info->
idev->name =
"88pm860x_on";
87 info->
idev->phys =
"88pm860x_on/input0";
89 info->
idev->dev.parent = &pdev->
dev;
93 ret = input_register_device(info->
idev);
95 dev_err(chip->
dev,
"Can't register input device: %d\n", ret);
102 dev_err(chip->
dev,
"Failed to request IRQ: #%d: %d\n",
107 platform_set_drvdata(pdev, info);
113 input_unregister_device(info->
idev);
118 input_free_device(info->
idev);
129 input_unregister_device(info->
idev);
134 #ifdef CONFIG_PM_SLEEP
135 static int pm860x_onkey_suspend(
struct device *
dev)
140 if (device_may_wakeup(dev))
144 static int pm860x_onkey_resume(
struct device *dev)
149 if (device_may_wakeup(dev))
155 static SIMPLE_DEV_PM_OPS(pm860x_onkey_pm_ops, pm860x_onkey_suspend, pm860x_onkey_resume);
159 .name =
"88pm860x-onkey",
161 .pm = &pm860x_onkey_pm_ops,
163 .probe = pm860x_onkey_probe,