diff options
author | RaviChandra Sadineni <ravisadineni@chromium.org> | 2018-08-20 08:34:19 -0700 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2018-10-23 08:58:34 +0100 |
commit | 61cc15dac01ae84281222452e338ca060179d8b1 (patch) | |
tree | 4982859a49f016abc8ba10cc3df2a8b4fe84f8a0 | |
parent | 4ded11d1cf128db8b5d5b57db3a50dd124358520 (diff) | |
download | linux-61cc15dac01ae84281222452e338ca060179d8b1.tar.gz linux-61cc15dac01ae84281222452e338ca060179d8b1.tar.bz2 linux-61cc15dac01ae84281222452e338ca060179d8b1.zip |
mfd: cros_ec: Check for mkbp events on resume only if supported.
Currently on every resume we check for mkbp events and notify the
clients. This helps in identifying the wakeup sources. But on devices
that do not support mkbp protocol, we might end up querying key state of
the keyboard in a loop which blocks the resume. Instead check for events
only if mkbp is supported.
Signed-off-by: RaviChandra Sadineni <ravisadineni@chromium.org>
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r-- | drivers/mfd/cros_ec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c index 65a9757a6d21..fe6f83766144 100644 --- a/drivers/mfd/cros_ec.c +++ b/drivers/mfd/cros_ec.c @@ -218,7 +218,8 @@ EXPORT_SYMBOL(cros_ec_suspend); static void cros_ec_report_events_during_suspend(struct cros_ec_device *ec_dev) { - while (cros_ec_get_next_event(ec_dev, NULL) > 0) + while (ec_dev->mkbp_event_supported && + cros_ec_get_next_event(ec_dev, NULL) > 0) blocking_notifier_call_chain(&ec_dev->event_notifier, 1, ec_dev); } |