summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-11-04 13:00:22 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-11-10 20:43:00 +0000
commit8a9d0cae28c77be4ce1013802ea6f8713b3e5033 (patch)
tree5798d5bd56dda7b6a263910536b216fe955f766b /test
parente35494e4acaaf0d33d237fbfcedfc9ecbb87fd13 (diff)
downloadchrome-ec-8a9d0cae28c77be4ce1013802ea6f8713b3e5033.tar.gz
pd: for request message, add operational and max current
For request message, add the operational and max current for each board. If the requested power is less than the operational power required, then set mismatch bit. BUG=none BRANCH=samus TEST=make buildall. load onto samus, plug in zinger and see that request 20V, operational current 3000mA and max current of 3000mA. Change-Id: I4df45d88b7e060f66ff5b806f6fe30803f1afcf7 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/227393 Reviewed-by: Todd Broch <tbroch@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/usb_pd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/usb_pd.c b/test/usb_pd.c
index e3486488e8..2916d4eb94 100644
--- a/test/usb_pd.c
+++ b/test/usb_pd.c
@@ -145,6 +145,8 @@ static void unplug(int port)
static int test_request(void)
{
+ uint32_t expected_rdo = RDO_FIXED(1, 900, 900, RDO_CAP_MISMATCH);
+
plug_in_source(0, 0);
task_wake(PORT_TO_TASK_ID(0));
task_wait_event(100 * MSEC);
@@ -165,7 +167,7 @@ static int test_request(void)
TEST_ASSERT(pd_test_tx_msg_verify_short(0,
PD_HEADER(PD_DATA_REQUEST, PD_ROLE_SINK, PD_ROLE_UFP,
pd_port[0].msg_tx_id, 1)));
- TEST_ASSERT(pd_test_tx_msg_verify_word(0, RDO_FIXED(1, 450, 900, 0)));
+ TEST_ASSERT(pd_test_tx_msg_verify_word(0, expected_rdo));
TEST_ASSERT(pd_test_tx_msg_verify_crc(0));
TEST_ASSERT(pd_test_tx_msg_verify_eop(0));
inc_tx_id(0);