summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Marheine <pmarheine@chromium.org>2023-04-05 13:50:48 +1000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-04-06 01:19:47 +0000
commit76c0324c1b504f269fee877b0e5eb662092d2085 (patch)
treebc8731bfec2c2a5b7bf8a483e3103ab32850c8a4
parentff796c209d90e349f2b8d27ac61e5b2bfebf0ab0 (diff)
downloadchrome-ec-76c0324c1b504f269fee877b0e5eb662092d2085.tar.gz
zephyr/tcpc_emul: automatically include prerequisites
The generic TCPCI emulator requires common I2C emulation code, so make it automatically select it. Also include i2c.h from tcpc_generic_emul.h because it uses the I2C_PORT_BY_DEV macro defined therein. BUG=b:271118112 TEST=./twister BRANCH=none Change-Id: I2282085ee00f49de7ae1a6a3bccff059d78d7400 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4402750 Reviewed-by: Tristan Honscheid <honscheid@google.com>
-rw-r--r--zephyr/emul/tcpc/Kconfig1
-rw-r--r--zephyr/shim/include/usbc/tcpc_generic_emul.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/zephyr/emul/tcpc/Kconfig b/zephyr/emul/tcpc/Kconfig
index 30867b5f91..e1738e6381 100644
--- a/zephyr/emul/tcpc/Kconfig
+++ b/zephyr/emul/tcpc/Kconfig
@@ -7,6 +7,7 @@ menuconfig EMUL_TCPCI
default y
depends on DT_HAS_CROS_TCPCI_GENERIC_EMUL_ENABLED
depends on I2C_EMUL
+ select EMUL_COMMON_I2C
help
Enable the TCPCI emulator. This driver uses the emulated I2C bus.
It is used to test tcpci code. It supports reads and writes to all
diff --git a/zephyr/shim/include/usbc/tcpc_generic_emul.h b/zephyr/shim/include/usbc/tcpc_generic_emul.h
index 1ce29fd2e5..9fcff480eb 100644
--- a/zephyr/shim/include/usbc/tcpc_generic_emul.h
+++ b/zephyr/shim/include/usbc/tcpc_generic_emul.h
@@ -4,6 +4,7 @@
*/
#include "driver/tcpm/tcpci.h"
+#include "i2c/i2c.h"
#include <zephyr/devicetree.h>