summaryrefslogtreecommitdiff
path: root/include/mock
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2020-07-06 16:56:47 -0600
committerCommit Bot <commit-bot@chromium.org>2020-07-15 05:03:50 +0000
commitf0d3fff8b1d060d2a90eecebee70e01af017b615 (patch)
tree792a1b6cd153092ca70a8ea8f3093d04c42c5fca /include/mock
parent3d0b1298968922bbb7fa11f8fe9b7cfa4562180c (diff)
downloadchrome-ec-f0d3fff8b1d060d2a90eecebee70e01af017b615.tar.gz
tcpmv2: Add usb_tcpmv2_tcpci test
Add a new test that runs a full set of TCPMv2 layers and state machines, talking to a simulated TCPC via I2C. Initial test cases: 1) Plug in a non-PD power supply -> we connect as sink. 2) AP S5 > S3 > S0 -> auto-toggle + low power. BUG=b:161167893 BRANCH=none TEST=make -j run-usb_tcpmv2_tcpci Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: If8b8eb2cca722ed01cbe1d6000fb3e4f4b70149c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2283911 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'include/mock')
-rw-r--r--include/mock/tcpci_i2c_mock.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/mock/tcpci_i2c_mock.h b/include/mock/tcpci_i2c_mock.h
new file mode 100644
index 0000000000..87f163836c
--- /dev/null
+++ b/include/mock/tcpci_i2c_mock.h
@@ -0,0 +1,14 @@
+/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "common.h"
+
+#define MOCK_TCPCI_I2C_ADDR_FLAGS 0x99
+
+void mock_tcpci_reset(void);
+
+void mock_tcpci_set_reg(int reg, uint16_t value);
+
+uint16_t mock_tcpci_get_reg(int reg_offset);