From 82684250ae9c24ce6706aa3d9093ba46e66ca238 Mon Sep 17 00:00:00 2001 From: Roman Birg Date: Mon, 18 Aug 2014 14:04:44 -0700 Subject: [PATCH] input: gpio_keys: report SW_LID instead of SW_FLIP * Android expects SW_LID for lid events. It also expects a different sequence of lid state since windowed covers are not yet supported. Change-Id: Iebffbabdbb3748eec4f887ebd227c67adf01d8ef Signed-off-by: Roman Birg --- drivers/input/flip_cover.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/input/flip_cover.c b/drivers/input/flip_cover.c index b0d34ea8b57..6996810f390 100755 --- a/drivers/input/flip_cover.c +++ b/drivers/input/flip_cover.c @@ -171,7 +171,7 @@ static void flip_cover_work(struct work_struct *work) if(first == second) { flip_cover = first; - input_report_switch(ddata->input, SW_FLIP, flip_cover); + input_report_switch(ddata->input, SW_LID, !flip_cover); input_sync(ddata->input); } } @@ -204,7 +204,7 @@ static void flip_cover_work(struct work_struct *work) #endif flip_cover = first; input_report_switch(ddata->input, - SW_FLIP, flip_cover); + SW_LID, !flip_cover); input_sync(ddata->input); } #endif @@ -361,7 +361,7 @@ static int hall_probe(struct platform_device *pdev) input->dev.parent = &pdev->dev; input->evbit[0] |= BIT_MASK(EV_SW); - input_set_capability(input, EV_SW, SW_FLIP); + input_set_capability(input, EV_SW, SW_LID); input->open = hall_open; input->close = hall_close; @@ -474,8 +474,8 @@ static int hall_resume(struct device *dev) struct input_dev *input = ddata->input; printk("%s start\n", __func__); - input_report_switch(ddata->input, SW_FLIP, - gpio_get_value_cansleep(ddata->gpio_flip_cover)); + input_report_switch(ddata->input, SW_LID, + !gpio_get_value_cansleep(ddata->gpio_flip_cover)); input_sync(input); #ifdef CONFIG_SENSORS_HALL_IRQ_CTRL /* gsm_area can be controlled only in hall_irq_set */ -- 2.20.1