summaryrefslogtreecommitdiff
path: root/drivers/mfd/cros_ec.c
diff options
context:
space:
mode:
authorJoseph Lo <josephl@nvidia.com>2016-12-16 18:57:36 +0100
committerLee Jones <lee.jones@linaro.org>2017-02-13 09:29:42 +0000
commita9eb186e13144782232cc6fa731441be54baf505 (patch)
tree84516b09ee9f92af21eec842db5cd9efb85df9dc /drivers/mfd/cros_ec.c
parent0f1747692ccc06fff9a5eb975b2a5cf92cec4030 (diff)
mfd: cros_ec: Prevent data transfer while device is suspended
The cros_ec driver is still active while the device is suspended. Besides that, it also tries to transfer data even after the I2C host had been suspended. This patch uses a simple flag to prevent this. Signed-off-by: Joseph Lo <josephl@nvidia.com> Signed-off-by: Thierry Escande <thierry.escande@collabora.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/cros_ec.c')
-rw-r--r--drivers/mfd/cros_ec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c
index abd83424b498..ad48633c9a47 100644
--- a/drivers/mfd/cros_ec.c
+++ b/drivers/mfd/cros_ec.c
@@ -165,6 +165,7 @@ int cros_ec_suspend(struct cros_ec_device *ec_dev)
disable_irq(ec_dev->irq);
ec_dev->was_wake_device = ec_dev->wake_enabled;
+ ec_dev->suspended = true;
return 0;
}
@@ -179,6 +180,7 @@ static void cros_ec_drain_events(struct cros_ec_device *ec_dev)
int cros_ec_resume(struct cros_ec_device *ec_dev)
{
+ ec_dev->suspended = false;
enable_irq(ec_dev->irq);
/*