diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2015-06-13 19:41:24 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-06-17 13:10:58 +0000 |
commit | cca70a517b21d32e45880d1296997436d026e7b7 (patch) | |
tree | 1c37f28074f4d9050070d7a540780fd592ff9719 /include/test_util.h | |
parent | b33531e262561e297ba1a02fc829a2110c6df515 (diff) | |
download | chrome-ec-cca70a517b21d32e45880d1296997436d026e7b7.tar.gz |
common: Add i2c 32bit read/write
Add functions and associated test to read/write a 32 bit register
BRANCH=smaug
TEST=Test on smaug with bm160 driver
BUG=chromium:39900
Change-Id: Ieff24b65f1eb8610874fe13c4a8fadf583a218cb
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/277535
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/test_util.h')
-rw-r--r-- | include/test_util.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/test_util.h b/include/test_util.h index f8f50fcc76..b62e965563 100644 --- a/include/test_util.h +++ b/include/test_util.h @@ -256,6 +256,18 @@ struct test_i2c_write_dev { __attribute__((section(".rodata.test_i2c.write16"))) \ = {routine} +/* Register an I2C 32-bit read function. */ +#define DECLARE_TEST_I2C_READ32(routine) \ + const struct test_i2c_read_dev __test_i2c_read32_##routine \ + __attribute__((section(".rodata.test_i2c.read32"))) \ + = {routine} + +/* Register an I2C 32-bit write function. */ +#define DECLARE_TEST_I2C_WRITE32(routine) \ + const struct test_i2c_write_dev __test_i2c_write32_##routine \ + __attribute__((section(".rodata.test_i2c.write32"))) \ + = {routine} + #define DECLARE_TEST_I2C_READ_STRING(routine) \ const struct test_i2c_read_string_dev __test_i2c_rs_##routine \ __attribute__((section(".rodata.test_i2c.read_string"))) \ |