linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/chrome: cros_ec_lpc: wake up from s2idle on Chrome EC
@ 2018-02-22 21:21 Wenkai Du
  2018-03-20  0:08 ` Benson Leung
  0 siblings, 1 reply; 2+ messages in thread
From: Wenkai Du @ 2018-02-22 21:21 UTC (permalink / raw)
  To: Benson Leung; +Cc: Olof Johansson, linux-kernel, Rafael J . Wysocki, Wenkai Du

Chrome platform installed a Chrome EC notify handler which prevents
default EC GPE handler getting called. Add pm_system_wakeup to the
Chrome EC notify handler so wake up from s2idle can happen.

Suggested-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Wenkai Du <wenkai.du@intel.com>
---
 drivers/platform/chrome/cros_ec_lpc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
index af89e82eecd2..2a40c2b1a7ff 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -31,6 +31,7 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/printk.h>
+#include <linux/suspend.h>
 
 #define DRV_NAME "cros_ec_lpcs"
 #define ACPI_DRV_NAME "GOOG0004"
@@ -235,6 +236,9 @@ static void cros_ec_lpc_acpi_notify(acpi_handle device, u32 value, void *data)
 	    cros_ec_get_next_event(ec_dev, NULL) > 0)
 		blocking_notifier_call_chain(&ec_dev->event_notifier, 0,
 					     ec_dev);
+
+	if (value == ACPI_NOTIFY_DEVICE_WAKE)
+		pm_system_wakeup();
 }
 
 static int cros_ec_lpc_probe(struct platform_device *pdev)
-- 
2.16.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/chrome: cros_ec_lpc: wake up from s2idle on Chrome EC
  2018-02-22 21:21 [PATCH] platform/chrome: cros_ec_lpc: wake up from s2idle on Chrome EC Wenkai Du
@ 2018-03-20  0:08 ` Benson Leung
  0 siblings, 0 replies; 2+ messages in thread
From: Benson Leung @ 2018-03-20  0:08 UTC (permalink / raw)
  To: Wenkai Du
  Cc: Benson Leung, Olof Johansson, linux-kernel, Rafael J . Wysocki, bleung

[-- Attachment #1: Type: text/plain, Size: 630 bytes --]

Hi Wenkai,

Thanks for providing the patch.

On Thu, Feb 22, 2018 at 01:21:17PM -0800, Wenkai Du wrote:
> Chrome platform installed a Chrome EC notify handler which prevents
> default EC GPE handler getting called. Add pm_system_wakeup to the
> Chrome EC notify handler so wake up from s2idle can happen.
> 
> Suggested-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Signed-off-by: Wenkai Du <wenkai.du@intel.com>

LGTM. Applied to my for v4.17 branch.

Thank you!
Benson
-- 
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
bleung@google.com
Chromium OS Project
bleung@chromium.org

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-20  0:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-22 21:21 [PATCH] platform/chrome: cros_ec_lpc: wake up from s2idle on Chrome EC Wenkai Du
2018-03-20  0:08 ` Benson Leung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).