diff options
author | Tzung-Bi Shih <tzungbi@kernel.org> | 2022-02-16 09:03:04 +0100 |
---|---|---|
committer | Tzung-Bi Shih <tzungbi@kernel.org> | 2022-04-18 09:39:27 +0200 |
commit | 9fbe967d4e6e017c85c94aead6a1310b5f77db9a (patch) | |
tree | 750f227705159b4210a33bfe028beaf4664642a5 /drivers/platform | |
parent | platform/chrome: cros_ec: remove unused variable `was_wake_device` (diff) | |
download | linux-9fbe967d4e6e017c85c94aead6a1310b5f77db9a.tar.xz linux-9fbe967d4e6e017c85c94aead6a1310b5f77db9a.zip |
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().
Determine `wake_enabled` in cros_ec_suspend() instead of
reset-after-used in cros_ec_resume().
Reviewed-by: Prashant Malani <pmalani@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/chrome/cros_ec.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c index 836794871443..3bd2b548179d 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -340,6 +340,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; @@ -381,10 +383,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. |