ir: cannot wakeup system when keep pressing power key [1/1]
authorQianggui Song <qianggui.song@amlogic.com>
Sun, 29 Sep 2019 10:55:08 +0000 (18:55 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Mon, 30 Sep 2019 02:08:53 +0000 (19:08 -0700)
PD#SWPL-14797

Problem:
In freeze mode, keep press power key won't wake up system.

Solution:
replace pm_wakup_event with pm_stay_awake

Verify:
tl1

Change-Id: I5b88714ff45034280ec1d638f86b51fa54e2a011
Signed-off-by: Qianggui Song <qianggui.song@amlogic.com>
drivers/amlogic/input/remote/remote_core.c

index f9c25d5..f59c8c7 100644 (file)
@@ -65,6 +65,8 @@ static void ir_do_keyup(struct remote_dev *dev)
 {
        input_report_key(dev->input_device, dev->last_keycode, 0);
        input_sync(dev->input_device);
+       if (dev->last_keycode == KEY_POWER)
+               pm_relax(dev->dev);
        dev->keypressed = false;
        dev->last_scancode = -1;
        remote_dbg(dev->dev, "keyup!!\n");
@@ -145,7 +147,7 @@ void remote_keydown(struct remote_dev *dev, int scancode, int status)
        if (status == REMOTE_NORMAL) {
                keycode = dev->getkeycode(dev, scancode);
                if (keycode == KEY_POWER)
-                       pm_wakeup_event(dev->dev, 2000);
+                       pm_stay_awake(dev->dev);
                ir_do_keydown(dev, scancode, keycode);
        }