i2c: stm32l: Increase timeout from 10ms to 30ms

We found some cases where the battery can flip out and get confused
and hold the i2c lines.  Since the battery is actually smbus it will
give up after 25ms.  Increase our timeout to 30ms so that the next
trasaction will work OK.

BRANCH=ToT
BUG=chrome-os-partner:28425
TEST=Revert (1cd618e Wait for battery boot-up) and use a problematic
battery; see boot works OK.

Change-Id: Ife051220cbbbd49d7bc9c8607ba177cd9582fe58
Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/198212
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Doug Anderson
2014-05-01 14:19:32 -07:00
committed by chrome-internal-fetch
parent c9cedde125
commit 6ed3fe80b2
2 changed files with 10 additions and 2 deletions

View File

@@ -44,9 +44,13 @@
* mode). The slave is supposed to wait forever for the master to read bytes.
* ...but we're going to keep the timeout to make sure we're robust. It may in
* fact be needed if the host resets itself mid-read.
*
* NOTE: One case where this timeout is useful is when the battery
* flips out. The battery may flip out and hold lines low for up to
* 25ms. If we just wait it will eventually let them go.
*/
#define I2C_TX_TIMEOUT_SLAVE (100 * MSEC)
#define I2C_TX_TIMEOUT_MASTER (10 * MSEC)
#define I2C_TX_TIMEOUT_MASTER (30 * MSEC)
/*
* We delay 5us in bitbang mode. That gives us 5us low and 5us high or

View File

@@ -34,8 +34,12 @@
* mode). The slave is supposed to wait forever for the master to read bytes.
* ...but we're going to keep the timeout to make sure we're robust. It may in
* fact be needed if the host resets itself mid-read.
*
* NOTE: One case where this timeout is useful is when the battery
* flips out. The battery may flip out and hold lines low for up to
* 25ms. If we just wait it will eventually let them go.
*/
#define I2C_TX_TIMEOUT_MASTER (10 * MSEC)
#define I2C_TX_TIMEOUT_MASTER (30 * MSEC)
/*
* Delay 5us in bitbang mode. That gives us roughly 5us low and 5us high or