diff options
author | Yuval Peress <peress@chromium.org> | 2021-09-20 13:30:55 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-09-21 02:41:45 +0000 |
commit | 5a12a3dbca6e07882d1760b115dcbf3b7ec5931c (patch) | |
tree | 82d80374a980ec2135408075113d1c1299e7ce21 /zephyr/emul/Kconfig.i2c_mock | |
parent | 26e3f0f8596300e1b7f64f426c0469f9bfee669f (diff) | |
download | chrome-ec-5a12a3dbca6e07882d1760b115dcbf3b7ec5931c.tar.gz |
zephyr: test: add a generic I2C mock
Add a simple mock with no state to test common i2c code.
BRANCH=none
BUG=b:200589041
TEST=zmake testall
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: I99730361a298708278106deb58890a0ed2c9febf
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3171694
Tested-by: Yuval Peress <peress@google.com>
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Yuval Peress <peress@google.com>
Diffstat (limited to 'zephyr/emul/Kconfig.i2c_mock')
-rw-r--r-- | zephyr/emul/Kconfig.i2c_mock | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/zephyr/emul/Kconfig.i2c_mock b/zephyr/emul/Kconfig.i2c_mock new file mode 100644 index 0000000000..6c98a32739 --- /dev/null +++ b/zephyr/emul/Kconfig.i2c_mock @@ -0,0 +1,22 @@ +# Copyright 2021 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. + +DT_COMPAT_I2C_MOCK := cros,i2c-mock + +menuconfig I2C_MOCK + bool "Mock implementation of an I2C device" + default $(dt_compat_enabled,$(DT_COMPAT_I2C_MOCK)) + depends on I2C_EMUL + help + Enable the I2C mock. This driver is a pure mock and does nothing by + default. It is used to test common i2c code. Mock API is available in + zephyr/include/emul/i2c_mock.h + +if I2C_MOCK + +module = I2C_MOCK +module-str = i2c_mock +source "subsys/logging/Kconfig.template.log_config" + +endif # I2C_MOCK |