[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1498039313-24220-6-git-send-email-jeffy.chen@rock-chips.com>
Date: Wed, 21 Jun 2017 18:01:52 +0800
From: Jeffy Chen <jeffy.chen@...k-chips.com>
To: linux-kernel@...r.kernel.org
Cc: briannorris@...omium.org, dmitry.torokhov@...il.com,
dianders@...omium.org, Jeffy Chen <jeffy.chen@...k-chips.com>,
Gwendal Grignou <gwendal@...omium.org>,
Guenter Roeck <linux@...ck-us.net>,
Arnd Bergmann <arnd@...db.de>,
Vic Yang <victoryang@...gle.com>, linux-input@...r.kernel.org,
Enric Balletbo Serra <enric.balletbo@...labora.com>,
Lee Jones <lee.jones@...aro.org>
Subject: [RFC PATCH v3 5/6] input: cros_ec_keyb: report wakeup events
Report wakeup events when process events.
Signed-off-by: Jeffy Chen <jeffy.chen@...k-chips.com>
---
Changes in v3:
Use wakeup-source property to enable wakeup.
Suggested by Dmitry Torokhov <dmitry.torokhov@...il.com>.
drivers/input/keyboard/cros_ec_keyb.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index 79eb295..5dc387b 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -293,6 +293,9 @@ static int cros_ec_keyb_work(struct notifier_block *nb,
return NOTIFY_DONE;
}
+ if (device_may_wakeup(ckdev->dev))
+ pm_wakeup_event(ckdev->dev, 0);
+
return NOTIFY_OK;
}
@@ -639,6 +642,9 @@ static int cros_ec_keyb_probe(struct platform_device *pdev)
return err;
}
+ if (device_property_read_bool(dev, "wakeup-source"))
+ device_init_wakeup(dev, true);
+
return 0;
}
@@ -649,6 +655,8 @@ static int cros_ec_keyb_remove(struct platform_device *pdev)
blocking_notifier_chain_unregister(&ckdev->ec->event_notifier,
&ckdev->notifier);
+ device_init_wakeup(&pdev->dev, false);
+
return 0;
}
--
2.1.4
Powered by blists - more mailing lists