summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2020-10-27 15:51:30 -0700
committerCommit Bot <commit-bot@chromium.org>2020-10-28 21:40:06 +0000
commitb171bc438988ff1f2f988293d5025b7f333aee6d (patch)
tree451124b4e1680774990cd1dd2782d8e9834b8be5
parentd11ddb03215f91660b9e0f07cf1cdd05af6ca99a (diff)
downloadchrome-ec-b171bc438988ff1f2f988293d5025b7f333aee6d.tar.gz
usb_pd: Redo the change of DP alt-mode event
The CL:1685787 changed the DP alt-mode event from the host event MODE_CHANGE to the MKBP event EC_MKBP_EVENT_DP_ALT_MODE_ENTERED. Later a refactoring CL:2132871 merged the logic of TCPMv1 and TCPMv2 stacks and accidentally changed it back to MODE_CHANGE. As TCPMv2 still used the old event. This CL redoes the first CL to use the MKBP event EC_MKBP_EVENT_DP_ALT_MODE_ENTERED. BRANCH=None BUG=chromium:786721, b:170893877 TEST=Triggered HPD L->H event in S3 and checked the new MKBP event is sent. Change-Id: I5a8f35d40ad8e724841c771738c01a381e163250 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2504476 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--common/usb_pd_host_cmd.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/common/usb_pd_host_cmd.c b/common/usb_pd_host_cmd.c
index 19e74b47aa..39c70cecf0 100644
--- a/common/usb_pd_host_cmd.c
+++ b/common/usb_pd_host_cmd.c
@@ -13,6 +13,7 @@
#include "console.h"
#include "ec_commands.h"
#include "host_command.h"
+#include "mkbp_event.h"
#include "tcpm.h"
#include "usb_mux.h"
#include "usb_pd_tcpm.h"
@@ -466,22 +467,13 @@ DECLARE_HOST_COMMAND(EC_CMD_USB_PD_FW_UPDATE,
EC_VER_MASK(0));
#endif /* CONFIG_HOSTCMD_FLASHPD && CONFIG_USB_PD_TCPMV2 */
-#ifdef CONFIG_HOSTCMD_EVENTS
+#ifdef CONFIG_MKBP_EVENT
void pd_notify_dp_alt_mode_entry(void)
{
- /*
- * Note: EC_HOST_EVENT_PD_MCU may be a more appropriate host event to
- * send, but we do not send that here because there are other cases
- * where we send EC_HOST_EVENT_PD_MCU such as charger insertion or
- * removal. Currently, those do not wake the system up, but
- * EC_HOST_EVENT_MODE_CHANGE does. If we made the system wake up on
- * EC_HOST_EVENT_PD_MCU, we would be turning the internal display on on
- * every charger insertion/removal, which is not desired.
- */
CPRINTS("Notifying AP of DP Alt Mode Entry...");
- host_set_single_event(EC_HOST_EVENT_MODE_CHANGE);
+ mkbp_send_event(EC_MKBP_EVENT_DP_ALT_MODE_ENTERED);
}
-#endif /* CONFIG_HOSTCMD_EVENTS */
+#endif /* CONFIG_MKBP_EVENT */
__overridable enum ec_pd_port_location board_get_pd_port_location(int port)
{