diff options
author | Eric Yilun Lin <yllin@chromium.org> | 2021-04-07 17:55:47 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-08 03:30:45 +0000 |
commit | 8d70ee4c035e949d5e59655d93c43ebd81060c87 (patch) | |
tree | 1944058e21741d47bee13b1a131abe1f09675234 /common/usb_pd_protocol.c | |
parent | ee5451a866ad69461ae08e9e7e9b0bf818621d34 (diff) | |
download | chrome-ec-8d70ee4c035e949d5e59655d93c43ebd81060c87.tar.gz |
pd commands: support PD console command srccaps
This allows servo querying DUT's srccap easier.
BUG=b:140256624
TEST=on servo_v4 (TCPMv1) and Asurada (TCPMv2) tested that
1. plug adapter `pd 0 srccaps` show the PDOs
2. unplug adapter `pd 0 srccaps` show nothing
sample output:
> pd 1 srccaps
0: 5000mV/3000mA
1: 9000mV/2000mA
2: 12000mV/1500mA
3: 3300mV-5900mV/3000mA
4: 3300mV-11000mV/2000mA
BRANCH=servo
Change-Id: Iadf9f9d91359c96b188509a28b3dc42a7e7b2223
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2804008
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'common/usb_pd_protocol.c')
-rw-r--r-- | common/usb_pd_protocol.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c index 1734be269d..13e6c7842f 100644 --- a/common/usb_pd_protocol.c +++ b/common/usb_pd_protocol.c @@ -5200,6 +5200,8 @@ static int command_pd(int argc, char **argv) #endif else return EC_ERROR_PARAM3; + } else if (!strncasecmp(argv[2], "srccaps", 7)) { + pd_srccaps_dump(port); } else if (!strncasecmp(argv[2], "ping", 4)) { int enable; @@ -5317,7 +5319,7 @@ DECLARE_CONSOLE_COMMAND(pd, command_pd, "\n\t<port> flash [erase|reboot|signature|info|version]" #endif /* CONFIG_CMD_PD_FLASH */ #endif /* CONFIG_USB_PD_DUAL_ROLE */ - , + "\n\t<port> srccaps", "USB PD"); #ifdef HAS_TASK_HOSTCMD |