diff options
author | Ayushee <ayushee.shah@intel.com> | 2019-03-07 16:38:41 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-03-28 11:17:32 -0700 |
commit | fe2f414d2dcccb6faa30c369eac2c4665b18677a (patch) | |
tree | 57a0d9fac3fbe5a010fcd3dd1eb5cdeac873249d /util/ectool.c | |
parent | 0490e8afde1b90cb600e68630a1ebe08a88cb681 (diff) | |
download | chrome-ec-fe2f414d2dcccb6faa30c369eac2c4665b18677a.tar.gz |
usb_pd: Get current DP pin mode
DP pin mode is needed to configure the Intel virtual muxes hence,
added a board level function that returns the current DP pin mode.
Also added a variable to return the DP pin mode in USB_PD_CONTROL
host command.
BUG=b:112311321
BRANCH=None
TEST=Verified on Dragonegg, able to get correct pin mode
USB:0x0 (No DP)
DP cable:0x4 (Mode:C)
USBC dock:0x8 (Mode:D)
Change-Id: I997de80d0963e8ac45e97e5da0064694d5572942
Signed-off-by: Ayushee <ayushee.shah@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1512134
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'util/ectool.c')
-rw-r--r-- | util/ectool.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/util/ectool.c b/util/ectool.c index 522daa572e..51bf39ca3a 100644 --- a/util/ectool.c +++ b/util/ectool.c @@ -5127,7 +5127,7 @@ int cmd_usb_pd(int argc, char *argv[]) r_v1->polarity + 1); if (cmdver == 2) { - printf("CC State: %d:", r_v2->cc_state); + printf("CC State:"); if (r_v2->cc_state == USBC_PD_CC_NONE) printf("None"); else if (r_v2->cc_state == USBC_PD_CC_NO_UFP) @@ -5143,6 +5143,25 @@ int cmd_usb_pd(int argc, char *argv[]) else printf("UNKNOWN"); printf("\n"); + + if (r_v2->dp_mode) { + printf("DP pin mode:"); + if (r_v2->dp_mode == MODE_DP_PIN_A) + printf("A"); + else if (r_v2->dp_mode == MODE_DP_PIN_B) + printf("B"); + else if (r_v2->dp_mode == MODE_DP_PIN_C) + printf("C"); + else if (r_v2->dp_mode == MODE_DP_PIN_D) + printf("D"); + else if (r_v2->dp_mode == MODE_DP_PIN_E) + printf("E"); + else if (r_v2->dp_mode == MODE_DP_PIN_F) + printf("F"); + else + printf("UNKNOWN"); + printf("\n"); + } } /* If connected to a PD device, then print port partner info */ |