summaryrefslogtreecommitdiff
path: root/include/i2c.h
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 /include/i2c.h
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 'include/i2c.h')
-rw-r--r--include/i2c.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/i2c.h b/include/i2c.h
index dbc51eebbd..674dd84e80 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -162,6 +162,18 @@ void i2c_prepare_sysjump(void);
void i2c_set_timeout(int port, uint32_t timeout);
/**
+ * Read a 32-bit register from the slave at 8-bit slave address <slaveaddr>, at
+ * the specified 8-bit <offset> in the slave's address space.
+ */
+int i2c_read32(int port, int slave_addr, int offset, int *data);
+
+/**
+ * Write a 32-bit register to the slave at 8-bit slave address <slaveaddr>, at
+ * the specified 8-bit <offset> in the slave's address space.
+ */
+int i2c_write32(int port, int slave_addr, int offset, int data);
+
+/**
* Read a 16-bit register from the slave at 8-bit slave address <slaveaddr>, at
* the specified 8-bit <offset> in the slave's address space.
*/