[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220125101527.1812887-4-tzungbi@google.com>
Date: Tue, 25 Jan 2022 18:15:24 +0800
From: Tzung-Bi Shih <tzungbi@...gle.com>
To: bleung@...omium.org
Cc: groeck@...omium.org, tzungbi@...gle.com,
linux-kernel@...r.kernel.org
Subject: [PATCH 3/6] platform/chrome: cros_ec: determine `wake_enabled` in cros_ec_suspend()
`wake_enabled` indicates cros_ec_resume() needs to call
disable_irq_wake() to undo enable_irq_wake() in cros_ec_suspend().
Determines `wake_enabled` in cros_ec_suspend() instead of
reset-after-used in cros_ec_resume().
Signed-off-by: Tzung-Bi Shih <tzungbi@...gle.com>
---
drivers/platform/chrome/cros_ec.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
index a37448f3e179..abbe71309e40 100644
--- a/drivers/platform/chrome/cros_ec.c
+++ b/drivers/platform/chrome/cros_ec.c
@@ -342,6 +342,8 @@ int cros_ec_suspend(struct cros_ec_device *ec_dev)
if (device_may_wakeup(dev))
ec_dev->wake_enabled = !enable_irq_wake(ec_dev->irq);
+ else
+ ec_dev->wake_enabled = false;
disable_irq(ec_dev->irq);
ec_dev->suspended = true;
@@ -383,10 +385,9 @@ int cros_ec_resume(struct cros_ec_device *ec_dev)
dev_dbg(ec_dev->dev, "Error %d sending resume event to ec",
ret);
- if (ec_dev->wake_enabled) {
+ if (ec_dev->wake_enabled)
disable_irq_wake(ec_dev->irq);
- ec_dev->wake_enabled = 0;
- }
+
/*
* Let the mfd devices know about events that occur during
* suspend. This way the clients know what to do with them.
--
2.35.0.rc0.227.g00780c9af4-goog
Powered by blists - more mailing lists