summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJameson Thies <jthies@google.com>2022-08-30 17:36:36 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-09-01 00:25:56 +0000
commitd269be62d115c75cf4a531d55b7daf7de2dce27b (patch)
tree71117dcfc4302a49faf4d585cbecda3744a0cfb7
parent2aaee77c3797d5b7fcf4876f9306f33e4b15a640 (diff)
downloadchrome-ec-d269be62d115c75cf4a531d55b7daf7de2dce27b.tar.gz
usb_common: Move HPD Wake MKBP Source to TCPMv1/TCPMv2 common file
MKBP sources are declared using DECLARE_EVENT_SOURCE. For the EC_MKBP_EVENT_DP_ALT_MODE_ENTERED MKBP event, the source is only declared in usb_pd_policy.c, which is a TCPMv1 file. For boards using TCPMv2, the source is never declared causing mkbp_get_next_event in mkbp_event.c to return EC_RES_ERROR (0x2). This CL will move the EC_MKBP_EVENT_DP_ALT_MODE_ENTERED MKBP event source declaration to usb_common.c so that it exists in both TCPMv1 and TCPMv2. BUG=b:220875780 TEST=make try_builds_boards. make runhosttests. Triggered HPD wake event on a TCPMv2 device and received no "HC 0x0067 err 2" message. BRANCH=None Signed-off-by: Jameson Thies <jthies@google.com> Change-Id: Ib873b0b68fcf3bd1a191583d694bd6209d7205f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3866153 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--common/usb_common.c9
-rw-r--r--common/usb_pd_policy.c9
2 files changed, 9 insertions, 9 deletions
diff --git a/common/usb_common.c b/common/usb_common.c
index 372d55d2a0..59eaf7946b 100644
--- a/common/usb_common.c
+++ b/common/usb_common.c
@@ -1065,6 +1065,15 @@ void pd_send_host_event(int mask)
}
#endif /* defined(HAS_TASK_HOSTCMD) && !defined(TEST_BUILD) */
+#ifdef CONFIG_MKBP_EVENT
+static int dp_alt_mode_entry_get_next_event(uint8_t *data)
+{
+ return EC_SUCCESS;
+}
+DECLARE_EVENT_SOURCE(EC_MKBP_EVENT_DP_ALT_MODE_ENTERED,
+ dp_alt_mode_entry_get_next_event);
+#endif /* CONFIG_MKBP_EVENT */
+
__overridable void pd_notify_dp_alt_mode_entry(int port)
{
if (IS_ENABLED(CONFIG_MKBP_EVENT)) {
diff --git a/common/usb_pd_policy.c b/common/usb_pd_policy.c
index 3b2d6b4b8f..e07e028fc2 100644
--- a/common/usb_pd_policy.c
+++ b/common/usb_pd_policy.c
@@ -78,15 +78,6 @@ __overridable void pd_check_dr_role(int port, enum pd_data_role dr_role,
pd_request_data_swap(port);
}
-#ifdef CONFIG_MKBP_EVENT
-static int dp_alt_mode_entry_get_next_event(uint8_t *data)
-{
- return EC_SUCCESS;
-}
-DECLARE_EVENT_SOURCE(EC_MKBP_EVENT_DP_ALT_MODE_ENTERED,
- dp_alt_mode_entry_get_next_event);
-#endif /* CONFIG_MKBP_EVENT */
-
/* Last received source cap */
static uint32_t pd_src_caps[CONFIG_USB_PD_PORT_MAX_COUNT][PDO_MAX_OBJECTS];
static uint8_t pd_src_cap_cnt[CONFIG_USB_PD_PORT_MAX_COUNT];