summaryrefslogtreecommitdiff
path: root/test/stress.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2015-06-13 19:41:24 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-06-17 13:10:58 +0000
commitcca70a517b21d32e45880d1296997436d026e7b7 (patch)
tree1c37f28074f4d9050070d7a540780fd592ff9719 /test/stress.c
parentb33531e262561e297ba1a02fc829a2110c6df515 (diff)
downloadchrome-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 'test/stress.c')
-rw-r--r--test/stress.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/stress.c b/test/stress.c
index 58a727adbe..5e31d4e466 100644
--- a/test/stress.c
+++ b/test/stress.c
@@ -98,6 +98,12 @@ static int test_i2c(void)
else if (param->width == 16 && param->data >= 0)
res = i2c_write16(param->port, param->addr,
param->offset, param->data);
+ else if (param->width == 32 && param->data == -1)
+ res = i2c_read32(param->port, param->addr,
+ param->offset, &dummy_data);
+ else if (param->width == 32 && param->data >= 0)
+ res = i2c_write32(param->port, param->addr,
+ param->offset, param->data);
return res;
}