diff options
author | Alec Berg <alecaberg@chromium.org> | 2014-06-03 14:38:21 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-06-04 20:59:15 +0000 |
commit | eac695e983028156563e4f5aa9df12db752c0583 (patch) | |
tree | 1ecbf081cd33abaef53afdbe80981e972ef2db3e | |
parent | 46e9d7b468085c6c1c3c4e3852484a75a74faa08 (diff) | |
download | chrome-ec-eac695e983028156563e4f5aa9df12db752c0583.tar.gz |
lm4: decrease i2c timeout
The i2c timeout on lm4 is currently 1 second, which is very long.
This changes it to 100ms. Note, the biggest transfer we might
every do is probably ~256 bytes to do a flash program using a host
command over i2c. And the slowest bus speed is ~100kHz. So, worst
case, the transaction shouldn't be more than about 25ms.
Decreasing the timeout is useful when peripherals are not plugged
in. For example, the ALS is sampled in the hooks task every second.
We don't want the ALS sampling to be delayed for a second because
it will throw off all of our other hooks.
BUG=chrome-os-partner:29003
BRANCH=none
TEST=ran on a samus and tested i2c commands to various peripherals
Change-Id: I5e1b6d0f8b100cbcb6cd9209c6198e31d99bb085
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/202515
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | chip/lm4/i2c.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/chip/lm4/i2c.c b/chip/lm4/i2c.c index 457236cc93..1f1797f1c1 100644 --- a/chip/lm4/i2c.c +++ b/chip/lm4/i2c.c @@ -48,7 +48,7 @@ #define I2C_IDLE_US 500 /* Maximum time we allow for an I2C transfer */ -#define I2C_TIMEOUT_US SECOND +#define I2C_TIMEOUT_US (100*MSEC) /* IRQ for each port */ static const uint32_t i2c_irqs[] = {LM4_IRQ_I2C0, LM4_IRQ_I2C1, LM4_IRQ_I2C2, |