summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSam Hurst <shurst@google.com>2019-11-07 17:55:55 -0800
committerCommit Bot <commit-bot@chromium.org>2019-11-21 23:41:16 +0000
commit2e2dcb986bfe952cd9a87bf2cd3498fafde6e805 (patch)
tree2d63c1ceb0ab7bad0f2e414b73243307dff87676 /test
parent154f597b8656fbcc16f6652f6fe8713943440939 (diff)
downloadchrome-ec-2e2dcb986bfe952cd9a87bf2cd3498fafde6e805.tar.gz
TCPMv2: Enable TCPC low power when port is looking for a connection
When the port is in a state where it is looking for a connection, to save power, we should put the TCPC in its low power mode and enable auto toggling. Low power mode can happen when DRP auto toggling, acting as a SNK only, or acting as a SRC only. BUG=chromium:1022217 BRANCH=none TEST=make -j buildall manual tests: 1: (S0) Nothing plugged in, port is drp and low power mode 2: (S5/S3/S0ix) Port is SNK only, and low power with nothing plugged in 3: (S3/S0ix) If TypeC sink was previously plugged in, port remains powered 4: (S5/S3/S0ix) TypeC source is recognized 5: (S3->S0) TypeC sink plugged in, port is powered when S0 is reached Low power exit test: Using this command from the AP console: ectool i2cread 8 2 0x16 0x0d Transfer failed with status=0x1 # This means the TCPC was asleep. On the EC console: 2019-11-21 09:50:24 [315.235538 TCPC p1 init ready] 2019-11-21 09:50:24 [315.236048 TCPC p1 Exit Low Power Mode] 2019-11-21 09:50:24 [315.242837 TCPC p1 init ready] 2019-11-21 09:50:24 [315.243229 C1: DRPAutoToggle] 2019-11-21 09:50:24 [315.246471 C1: Unattached.SNK] 2019-11-21 09:50:24 [315.252504 C1: DRPAutoToggle] 2019-11-21 09:50:24 [315.362878 C1: LowPowerMode] 2019-11-21 09:50:24 [315.363314 TCPC p1 Enter Low Power Mode] Change-Id: I7e853d05e0ece1f6b3031f17a18fcbf0d9a15a51 Signed-off-by: Sam Hurst <shurst@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1904974 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/usb_typec_drp_acc_trysrc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/usb_typec_drp_acc_trysrc.c b/test/usb_typec_drp_acc_trysrc.c
index 07496ca600..205ef6ad3a 100644
--- a/test/usb_typec_drp_acc_trysrc.c
+++ b/test/usb_typec_drp_acc_trysrc.c
@@ -40,6 +40,7 @@ __maybe_unused static int test_mux_con_dis_as_src(void)
mock_tcpc.cc1 = TYPEC_CC_VOLT_RD;
mock_tcpc.cc2 = TYPEC_CC_VOLT_OPEN;
task_set_event(TASK_ID_PD_C0, PD_EVENT_CC, 0);
+ pd_set_dual_role(0, PD_DRP_TOGGLE_ON);
/* This wait trainsitions through AttachWait.SRC then Attached.SRC */
task_wait_event(SECOND);