summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorYilun Lin <yllin@google.com>2019-02-25 19:05:32 +0800
committerCommit Bot <commit-bot@chromium.org>2019-08-02 17:47:36 +0000
commitd23008a4968af91bb2d31391f8d5e1ee69cbffa5 (patch)
treee176fa0bdbe9616e4ede643c22672f718fbad34e /common
parent7c1cf77dca6203807c825b8c33f5a550acf90966 (diff)
downloadchrome-ec-d23008a4968af91bb2d31391f8d5e1ee69cbffa5.tar.gz
mkbp_event,include/config.h: Clarify MKBP delivery method.
Now we have two MKBP delivery methods: 1. define CONFIG_MKBP_USE_HOST_EVENT to notify via host event 2. undef CONFIG_MKBP_USE_HOST_EVENT to notify via GPIO interrupt It may become more complicated if new notification methods introduced. e.g.: mt_scp uses IPI, rather than host event and GPIO interrupt. This CL does: 1. add CONFIG_MKBP_USE_GPIO to explicilty declare that MKBP event are sent via GPIO interrupt. 2. CONFIG_MKBP_USE_CUSTOM for boards which have custmized methods. 3. Remove weak attribute in mkbp_set_host_active (which can be done with CONFIG_MKBP_USE_CUSTOM now. 4. Removes mkbp_set_host_active function in board Nocturne. It only deliver MKBP events through GPIO interrupt now. BRANCH=None BUG=b:120808999 TEST=grep -rn "CONFIG_MKBP_USE_GPIO\|EC_INT_L" board/ baseboard/ and see the result is reasonable: 1. EC_INT_L must be 1-to-1 mapped to define CONFIG_MKBP_USE_GPIO in every board, except that meep, yorp, ampton which are defined in baseboard octopus. 2. undef CONFIG_MKBP_USE_GPIO in bip and casta, which use host event, but also have baseboard octopus. Change-Id: I4af6110e4fd3c009968075c3623ef2d91cbd770b Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1490794 Commit-Ready: Jett Rink <jettrink@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1719541 Reviewed-by: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/mkbp_event.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/common/mkbp_event.c b/common/mkbp_event.c
index 9dddcab519..b4b163121d 100644
--- a/common/mkbp_event.c
+++ b/common/mkbp_event.c
@@ -33,24 +33,28 @@ static int event_is_set(uint8_t event_type)
return events & (1 << event_type);
}
-#ifndef CONFIG_MKBP_USE_HOST_EVENT
+#ifdef CONFIG_MKBP_USE_GPIO
void mkbp_set_host_active_via_gpio(int active)
{
gpio_set_level(GPIO_EC_INT_L, !active);
}
#endif
+#ifdef CONFIG_MKBP_USE_HOST_EVENT
void mkbp_set_host_active_via_event(int active)
{
if (active)
host_set_single_event(EC_HOST_EVENT_MKBP);
}
+#endif
-__attribute__((weak)) void mkbp_set_host_active(int active)
+void mkbp_set_host_active(int active)
{
-#ifdef CONFIG_MKBP_USE_HOST_EVENT
+#if defined(CONFIG_MKBP_USE_CUSTOM)
+ mkbp_set_host_active_via_custom(active);
+#elif defined(CONFIG_MKBP_USE_HOST_EVENT)
mkbp_set_host_active_via_event(active);
-#else
+#elif defined(CONFIG_MKBP_USE_GPIO)
mkbp_set_host_active_via_gpio(active);
#endif
}