浏览代码

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>
RaviChandra Sadineni 7 年之前
父节点
当前提交
61cc15dac0
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/mfd/cros_ec.c

+ 2 - 1
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)
 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,
 		blocking_notifier_call_chain(&ec_dev->event_notifier,
 					     1, ec_dev);
 					     1, ec_dev);
 }
 }