summaryrefslogtreecommitdiffstats
path: root/drivers/platform/chrome
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/platform/chrome
parent0f1747692ccc06fff9a5eb975b2a5cf92cec4030 (diff)
downloadop-kernel-dev-a9eb186e13144782232cc6fa731441be54baf505.zip
op-kernel-dev-a9eb186e13144782232cc6fa731441be54baf505.tar.gz
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/platform/chrome')
-rw-r--r--drivers/platform/chrome/cros_ec_proto.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/platform/chrome/cros_ec_proto.c b/drivers/platform/chrome/cros_ec_proto.c
index 04053fe..ed5dee7 100644
--- a/drivers/platform/chrome/cros_ec_proto.c
+++ b/drivers/platform/chrome/cros_ec_proto.c
@@ -447,6 +447,11 @@ static int get_next_event(struct cros_ec_device *ec_dev)
struct cros_ec_command *msg = (struct cros_ec_command *)&buffer;
int ret;
+ if (ec_dev->suspended) {
+ dev_dbg(ec_dev->dev, "Device suspended.\n");
+ return -EHOSTDOWN;
+ }
+
msg->version = 0;
msg->command = EC_CMD_GET_NEXT_EVENT;
msg->insize = sizeof(ec_dev->event_data);
OpenPOWER on IntegriCloud