summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2020-12-11 10:24:21 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-24 22:36:34 +0000
commite7fa354e015ce3feab447e8a9b4df0e4b3bd95eb (patch)
tree6e8865e4e784ee62f1b4895a1d92d8ade85dfdb8
parent0ae4a0452a5f1e4d6234d22af09aa3ddf0861bcb (diff)
downloadchrome-ec-e7fa354e015ce3feab447e8a9b4df0e4b3bd95eb.tar.gz
Trogdor: Add debug messages to show the HPD change
Show the HPD change message to help debugging issues. BRANCH=Trogdor BUG=b:170598152,b:209092452 TEST=Plug and unplug a Type-C monitor and check the messages. Change-Id: Ie1e79560a7553a825baa181524a01b3e2983f1c1 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2586042 Reviewed-by: Stephen Boyd <swboyd@chromium.org> (cherry picked from commit a59bb5eafeca925babaf42fd62059ebaee755790) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3852646 Commit-Queue: Stephen Boyd <swboyd@chromium.org> Tested-by: Stephen Boyd <swboyd@chromium.org>
-rw-r--r--baseboard/trogdor/usb_pd_policy.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/baseboard/trogdor/usb_pd_policy.c b/baseboard/trogdor/usb_pd_policy.c
index ef5c470611..5258cd4f8c 100644
--- a/baseboard/trogdor/usb_pd_policy.c
+++ b/baseboard/trogdor/usb_pd_policy.c
@@ -231,9 +231,11 @@ __override int svdm_dp_attention(int port, uint32_t *payload)
usleep(svdm_hpd_deadline[port] - now);
/* Generate IRQ_HPD pulse */
+ CPRINTS("C%d: Recv IRQ. HPD->0", port);
gpio_set_level(hpd, 0);
usleep(HPD_DSTREAM_DEBOUNCE_IRQ);
gpio_set_level(hpd, 1);
+ CPRINTS("C%d: Recv IRQ. HPD->1", port);
/* Set the minimum time delay (2ms) for the next HPD IRQ */
svdm_hpd_deadline[port] = get_time().val +
@@ -242,6 +244,7 @@ __override int svdm_dp_attention(int port, uint32_t *payload)
CPRINTF("ERR:HPD:IRQ&LOW\n");
return 0;
} else {
+ CPRINTS("C%d: Recv lvl. HPD->%d", port, lvl);
gpio_set_level(hpd, lvl);
/* Set the minimum time delay (2ms) for the next HPD IRQ */
svdm_hpd_deadline[port] = get_time().val +
@@ -253,6 +256,7 @@ __override int svdm_dp_attention(int port, uint32_t *payload)
__override void svdm_exit_dp_mode(int port)
{
+ CPRINTS("%s(%d)", __func__, port);
if (is_dp_muxable(port)) {
/* Disconnect the DP port selection mux. */
gpio_set_level(GPIO_DP_MUX_OE_L, 1);
@@ -260,6 +264,7 @@ __override void svdm_exit_dp_mode(int port)
/* Signal AP for the HPD low event */
usb_mux_hpd_update(port, 0, 0);
+ CPRINTS("C%d: DP exit. HPD->0", port);
gpio_set_level(GPIO_DP_HOT_PLUG_DET, 0);
}
}