input: gpio_keys: report SW_LID instead of SW_FLIP
authorRoman Birg <roman@cyngn.com>
Mon, 18 Aug 2014 21:04:44 +0000 (14:04 -0700)
committerDario Trombello <dariotr@outlook.de>
Sat, 23 Jan 2021 11:56:41 +0000 (12:56 +0100)
* 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 <roman@cyngn.com>
drivers/input/flip_cover.c

index b0d34ea8b57bf6e33849bed9e9dacb0ce63595c2..6996810f39067808a290bcc5f51e9f751ef40876 100755 (executable)
@@ -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 */