summaryrefslogtreecommitdiff
path: root/common/usb_pd_protocol.c
diff options
context:
space:
mode:
authorSam Hurst <shurst@google.com>2019-09-11 11:25:34 -0700
committerCommit Bot <commit-bot@chromium.org>2019-09-17 15:01:04 +0000
commitaa771bf3d3610477d5f359e43f873084201203a4 (patch)
tree00f5a37dbd50b4c008fdfcddc4d1aaf2bfb1775e /common/usb_pd_protocol.c
parent4e9246ab4f7a2c512bd9b9e08860091d91cb3b6f (diff)
downloadchrome-ec-aa771bf3d3610477d5f359e43f873084201203a4.tar.gz
pd: Exit DP mode on sysjump
Exits all USB PD Alternate Modes after a system jump BUG=b:140807930 BRANCH=none TEST=manual Change-Id: Ie0843e0c9f1dcacecc2109cd0565a90cfafed306 Signed-off-by: Sam Hurst <shurst@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1797661 Tested-by: Sam Hurst <shurst@google.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'common/usb_pd_protocol.c')
-rw-r--r--common/usb_pd_protocol.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index a5423748f0..fdf21d2089 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -2311,19 +2311,6 @@ static void exit_dp_mode(int port)
}
#endif /* CONFIG_POWER_COMMON */
-#ifdef CONFIG_USB_PD_ALT_MODE_DFP
-static void notify_sysjump_ready(void)
-{
- /*
- * If event was set from pd_prepare_sysjump, wake the
- * task waiting on us to complete.
- */
- if (sysjump_task_waiting != TASK_ID_INVALID)
- task_set_event(sysjump_task_waiting,
- TASK_EVENT_SYSJUMP_READY, 0);
-}
-#endif
-
#ifdef CONFIG_POWER_COMMON
static void handle_new_power_state(int port)
{
@@ -3072,7 +3059,7 @@ void pd_task(void *u)
#if defined(CONFIG_USB_PD_ALT_MODE_DFP)
if (evt & PD_EVENT_SYSJUMP) {
exit_dp_mode(port);
- notify_sysjump_ready();
+ notify_sysjump_ready(&sysjump_task_waiting);
}
#endif
@@ -3802,7 +3789,8 @@ void pd_task(void *u)
if (evt & PD_EVENT_SYSJUMP)
/* Nothing to do for sysjump prep */
- notify_sysjump_ready();
+ notify_sysjump_ready(
+ &sysjump_task_waiting);
#else
task_wait_event(-1);
#endif