diff options
author | Sam Hurst <shurst@google.com> | 2019-12-11 14:35:18 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-04-14 15:36:46 +0000 |
commit | acffdcdb357824bfa009af01290875257de30646 (patch) | |
tree | 79ef7bf3828c4e86f287b59e2a8858682b1f2527 /test/fake_usbc.c | |
parent | f1d4d43109c8c97b2a84d58d4f2b3d871f8ba322 (diff) | |
download | chrome-ec-acffdcdb357824bfa009af01290875257de30646.tar.gz |
TCPMv2: Add pd console command
Add pd console commands that enables the device
to work with PD FAFT. Other pd commands such as
bist, vdm and ping will be added in another CL.
BUG=b:151481791
BUG=chromium:1021235
BRANCH=none
TEST=make -j buildall
manual:
Verified that system:
pd tryscr 0 - did not trysrc
pd tryscr 1 - did trysrc
pd tryscr 2 - normal trysrc operation
pd 0 tx - started as snk
pd 0 charger - started as src
pd 0 dev 5 - charged at 5V
pd 0 dev 12 - charged at 12V
pd 0 dev 15 - charged at 15V
pd 0 dev 20 - charged at 20V
pd 0 disable - pd was disabled
pd 0 enable - pd was enabled
pd 0 soft - sent soft reset
pd 0 hard - sent hard reset
pd 0 dualrole off - stayed in src and switched to snk on disconnect
pd 0 dualrole on - toggled from snk to src and vice versa
pd 0 dualrole sink - was a sink only
pd 0 dualrole source - was a source only
pd 0 dualrole freeze - stayed in current power role and switched
to snk on disconnect
pd 0 swap power - initiated a power role swap
pd 0 swap vconn - initiated a vconn swap
pd 0 swap data - initiated a data role swap
Change-Id: Id1542001c0e52d1d5bfbc5b9cb826b9a204e5b2e
Signed-off-by: Sam Hurst <shurst@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1962506
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Diffstat (limited to 'test/fake_usbc.c')
-rw-r--r-- | test/fake_usbc.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/test/fake_usbc.c b/test/fake_usbc.c index e62fa5ac62..d98e7017f9 100644 --- a/test/fake_usbc.c +++ b/test/fake_usbc.c @@ -130,12 +130,17 @@ __overridable void pe_invalidate_explicit_contract(int port) { } -enum pd_dual_role_states pd_get_dual_role(int port) +__overridable enum pd_dual_role_states pd_get_dual_role(int port) { return PD_DRP_TOGGLE_ON; } -int pd_comm_is_enabled(int port) +__overridable void pd_dev_get_rw_hash(int port, uint16_t *dev_id, + uint8_t *rw_hash, uint32_t *current_image) +{ +} + +__overridable int pd_comm_is_enabled(int port) { return 0; } @@ -190,11 +195,11 @@ void dfp_consume_cable_response(int port, int cnt, uint32_t *payload, { } -void pd_set_dual_role(int port, enum pd_dual_role_states state) +__overridable void pd_set_dual_role(int port, enum pd_dual_role_states state) { } -enum tcpc_cc_polarity pd_get_polarity(int port) +__overridable enum tcpc_cc_polarity pd_get_polarity(int port) { return POLARITY_CC1; } |