diff options
author | Randall Spangler <rspangler@chromium.org> | 2014-07-25 15:43:49 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-07-30 00:23:25 +0000 |
commit | 4692a1387a492d5697ae12a7195eac6e1249fc6b (patch) | |
tree | b2a88ded7123eee5d4f1b1fa4f8d9af697eae249 /include | |
parent | e449a42f08a6b9e70b50c7f67dfd00d2f4e30fb4 (diff) | |
download | chrome-ec-4692a1387a492d5697ae12a7195eac6e1249fc6b.tar.gz |
i2c: add support for timeout configuration at runtime
When the EC sends longer commands to the PD chip (such as flash
erase/write over the passthru from AP), allow it to take a second
instead of the default 100ms timeout.
BUG=chrome-os-partner:30935
BRANCH=none
TEST=samus boots
battery command works from EC console
ectool passthru of flash erase to PD works (requires hacked ectool)
Change-Id: I08ff94f7ac6aee351aa73c9d28b5fd715d463b3a
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/209936
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/i2c.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/i2c.h b/include/i2c.h index ac572960df..9cb884ba19 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -126,6 +126,14 @@ int i2c_raw_mode(int port, int enable); */ void i2c_lock(int port, int lock); +/** + * Set the timeout for an I2C transaction. + * + * @param port Port to set timeout for + * @param timeout Timeout in usec, or 0 to use default + */ +void i2c_set_timeout(int port, uint32_t timeout); + /* 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. */ int i2c_read16(int port, int slave_addr, int offset, int *data); |