summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-08-18 17:49:53 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-08-22 05:47:49 +0000
commitc7c312d057b84ebc13bf462ac884cdaf40fcb3a2 (patch)
tree46a7b585928d0c18872737eaf95ae3d336aa5554 /common
parent445691932cb08dbfb8c22a50c9071b5fd8df3c3c (diff)
downloadchrome-ec-c7c312d057b84ebc13bf462ac884cdaf40fcb3a2.tar.gz
zinger: add custom VDM to read last measured current
Add custom VDM to read last measured output current in mA. BUG=chrome-os-partner:30850 BRANCH=none TEST=Run "pd 0 vdm curr" on samus pd console and verify reasonable current Change-Id: Ie1f1ab235560eb4e90f399ceac31c5cd93003d80 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/212981
Diffstat (limited to 'common')
-rw-r--r--common/usb_pd_protocol.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index 0d6fbb7ef6..d0759184af 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -1581,6 +1581,9 @@ static int command_pd(int argc, char **argv)
return EC_ERROR_PARAM4;
pd_send_vdm(port, USB_VID_GOOGLE, VDO_CMD_PING_ENABLE,
&enable, 1);
+ } else if (!strncasecmp(argv[3], "curr", 4)) {
+ pd_send_vdm(port, USB_VID_GOOGLE, VDO_CMD_CURRENT,
+ NULL, 0);
} else {
return EC_ERROR_PARAM_COUNT;
}
@@ -1638,7 +1641,7 @@ static int command_pd(int argc, char **argv)
DECLARE_CONSOLE_COMMAND(pd, command_pd,
"<port> "
"[tx|bist|charger|dev|dump|dualrole|enable"
- "|soft|hard|clock|ping|state|vdm [ping]]",
+ "|soft|hard|clock|ping|state|vdm [ping | curr]]",
"USB PD",
NULL);