summaryrefslogtreecommitdiff
path: root/common/mkbp_event.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2016-05-02 16:50:27 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-06-22 02:03:09 -0700
commit00aef53a7b4c1a302b8f1448f2c634712c7b77eb (patch)
tree677b36ee77c3ccc7bee7abf1dc664dff5d227d22 /common/mkbp_event.c
parent9ceaa9d8e0706a4a7f416e76d8b0248579b54939 (diff)
downloadchrome-ec-00aef53a7b4c1a302b8f1448f2c634712c7b77eb.tar.gz
mkpb: Add MKBP support over ACPI
Add a host event to support MKPB: When sent, the ACPI code will send a notification to the kernel cros-ec-lpcs driver that will issue EC_CMD_GET_NEXT_EVENT. We can allow code (sensor stack for instance) that uses MKBP to work on ACPI based architecture. Obviously, host event over MKPB is not supported. BRANCH=none BUG=b:27849483 TEST=Check we get sensor events on Cyan through the sensor ring. (cyan branch) Change-Id: Iadc9c852b410cf69ef15bcbbb1b086c36687c687 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/353634 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/mkbp_event.c')
-rw-r--r--common/mkbp_event.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/mkbp_event.c b/common/mkbp_event.c
index 95bb4fd3f5..60ca19d645 100644
--- a/common/mkbp_event.c
+++ b/common/mkbp_event.c
@@ -36,7 +36,12 @@ static int event_is_set(uint8_t event_type)
static void set_host_interrupt(int active)
{
/* interrupt host by using active low EC_INT signal */
+#ifdef CONFIG_MKBP_USE_HOST_EVENT
+ if (active)
+ host_set_single_event(EC_HOST_EVENT_MKBP);
+#else
gpio_set_level(GPIO_EC_INT_L, !active);
+#endif
}
void mkbp_send_event(uint8_t event_type)