#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/reboot.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of_irq.h>
#include <linux/input.h>
#include <linux/slab.h>
/* the held interrupt will trigger after 4 seconds */
#define MAX_HELD_TIME (4 * MSEC_PER_SEC)
static irqreturn_t hi65xx_power_press_isr(int irq, void *q)
{
struct input_dev *input = q;
pm_wakeup_event(input->dev.parent, MAX_HELD_TIME);
input_report_key(input, KEY_POWER, 1);
input_sync(input);
return IRQ_HANDLED;
}
static irqreturn_t hi65xx_power_release_isr(int irq, void *q)
{
struct input_dev *input = q;
pm_wakeup_event(input->dev.parent, MAX_HELD_TIME);
input_report_key(input, KEY_POWER, 0);
input_sync(input);
return IRQ_HANDLED;