Chrome platform driver development
 help / color / mirror / Atom feed
* [PATCH] platform/chrome: cros_ec: Send host event for prepare/complete
@ 2022-07-01 15:54 Tim Van Patten
  2022-07-01 16:58 ` Guenter Roeck
  2022-07-01 20:39 ` kernel test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Tim Van Patten @ 2022-07-01 15:54 UTC (permalink / raw)
  To: LKML
  Cc: robbarnes, rrangel, Tim Van Patten, Benson Leung, Guenter Roeck,
	chrome-platform

Update cros_ec_lpc_pm_ops to call cros_ec_lpc_suspend() during PM
.prepare() and cros_ec_lpc_resume() during .complete. This allows the
EC to log entry/exit of AP's suspend/resume more accurately.

Signed-off-by: Tim Van Patten <timvp@google.com>
---

 drivers/platform/chrome/cros_ec_lpc.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
index 7677ab3c0ead9..783a0e56bf5f3 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -534,19 +534,24 @@ static int cros_ec_lpc_suspend(struct device *dev)
 {
 	struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
 
+	dev_info(dev, "Prepare EC suspend\n");
+
 	return cros_ec_suspend(ec_dev);
 }
 
-static int cros_ec_lpc_resume(struct device *dev)
+static void cros_ec_lpc_resume(struct device *dev)
 {
 	struct cros_ec_device *ec_dev = dev_get_drvdata(dev);
 
-	return cros_ec_resume(ec_dev);
+	cros_ec_resume(ec_dev);
+
+	dev_info(dev, "EC resume completed\n");
 }
 #endif
 
 static const struct dev_pm_ops cros_ec_lpc_pm_ops = {
-	SET_LATE_SYSTEM_SLEEP_PM_OPS(cros_ec_lpc_suspend, cros_ec_lpc_resume)
+	.prepare = cros_ec_lpc_suspend,
+	.complete = cros_ec_lpc_resume
 };
 
 static struct platform_driver cros_ec_lpc_driver = {
-- 
2.37.0.rc0.161.g10f37bed90-goog


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

end of thread, other threads:[~2022-07-14 18:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-01 15:54 [PATCH] platform/chrome: cros_ec: Send host event for prepare/complete Tim Van Patten
2022-07-01 16:58 ` Guenter Roeck
2022-07-01 20:39 ` kernel test robot
     [not found]   ` <CANkg5eyrBz9aA+ZTSBz=VeSjufPpEaNPDHNMM83V36gAM4v1VQ@mail.gmail.com>
2022-07-14 18:17     ` Tim Van Patten

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox