diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2017-12-27 13:56:29 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-01-04 19:17:57 -0800 |
commit | 069182f5e4082ae1cf569598cdc2d9d423dafaaa (patch) | |
tree | 4195fd9b09e0fd003f562c34ab4f581539e48a95 | |
parent | eb15d23f3e1e04573bf4445e7bdcabe923b6c524 (diff) | |
download | chrome-ec-069182f5e4082ae1cf569598cdc2d9d423dafaaa.tar.gz |
USB/PD: Request discover identity on boot
This patch makes the TCPM request discover identity on boot instead of
resume.
BUG=chromium:644663,b:70165261
BRANCH=none
TEST=Verified display works in the following cases:
1. On Fizz, plug in Dell type-c HDMI adapter in S0, shutdown, boot.
2. On Fizz, plug in Dell type-c HDMI adapter in S5, boot.
3. On Fizz, plug in type-c monitor in S0, suspend, resume.
4. On Fizz, plug in type-c monitor in S5, boot.
5. On elm, S5. Plug adapter with power+HDMI, boot.
Change-Id: Ib068c60bc51ebddc461378028a48c64662bc5b81
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/847970
Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r-- | common/usb_pd_protocol.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index ab485963ee..5104f1a5a0 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -3403,7 +3403,7 @@ void pd_task(void *u) } #ifdef CONFIG_USB_PD_DUAL_ROLE -static void dual_role_on(void) +static void pd_chipset_resume(void) { int i; @@ -3413,29 +3413,36 @@ static void dual_role_on(void) #endif pd[i].flags |= PD_FLAGS_CHECK_PR_ROLE | PD_FLAGS_CHECK_DR_ROLE; - - pd[i].flags |= PD_FLAGS_CHECK_IDENTITY; } pd_set_dual_role(PD_DRP_TOGGLE_ON); - CPRINTS("chipset -> S0"); + CPRINTS("PD:S3->S0"); } -DECLARE_HOOK(HOOK_CHIPSET_RESUME, dual_role_on, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_CHIPSET_RESUME, pd_chipset_resume, HOOK_PRIO_DEFAULT); -static void dual_role_off(void) +static void pd_chipset_suspend(void) { pd_set_dual_role(PD_DRP_TOGGLE_OFF); - CPRINTS("chipset -> S3"); + CPRINTS("PD:S0->S3"); +} +DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, pd_chipset_suspend, HOOK_PRIO_DEFAULT); + +static void pd_chipset_startup(void) +{ + int i; + pd_set_dual_role(PD_DRP_TOGGLE_OFF); + for (i = 0; i < CONFIG_USB_PD_PORT_COUNT; i++) + pd[i].flags |= PD_FLAGS_CHECK_IDENTITY; + CPRINTS("PD:S5->S3"); } -DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, dual_role_off, HOOK_PRIO_DEFAULT); -DECLARE_HOOK(HOOK_CHIPSET_STARTUP, dual_role_off, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_CHIPSET_STARTUP, pd_chipset_startup, HOOK_PRIO_DEFAULT); -static void dual_role_force_sink(void) +static void pd_chipset_shutdown(void) { pd_set_dual_role(PD_DRP_FORCE_SINK); - CPRINTS("chipset -> S5"); + CPRINTS("PD:S3->S5"); } -DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, dual_role_force_sink, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, pd_chipset_shutdown, HOOK_PRIO_DEFAULT); #endif /* CONFIG_USB_PD_DUAL_ROLE */ |