Input: cros_ec_keyb: Remove check before calling pm_wakeup_event.

From: RaviChandra Sadineni
Date: Fri Aug 17 2018 - 17:21:48 EST

From: RaviChandra Sadineni <ravisadineni@xxxxxxxxxx>

hi Merek,

Unfortunately I could not get the device to boot even after using the exynos_defconfig.
Can you please try this patch and see if this fixes the issue. If not can you enable the
debug logs and send me the logs.

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 getting key state of
the keyboard in a loop and block the resume. Instead check for events only
if mkbp is supported.

Signed-off-by: RaviChandra Sadineni <ravisadineni@xxxxxxxxxxxx>
drivers/mfd/cros_ec.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

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)
1, ec_dev);