From: Roman Birg Date: Mon, 18 Aug 2014 21:04:44 +0000 (-0700) Subject: input: gpio_keys: report SW_LID instead of SW_FLIP X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9cbd4472299d2a18c770f9f9f79fb018490b09c0;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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 --- 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 */