From b377e7bac030069cf0b38cbdcf7572c39f046188 Mon Sep 17 00:00:00 2001 From: Dino Li Date: Mon, 24 Apr 2017 17:30:27 +0800 Subject: it83xx: i2c: increase clock low timeout to maximum This timeout is described in SMBus specification (25ms). Some I2C devices may required longer clock stretch (The I2C specification does not specify any timeout conditions for clock stretching). So we increase this timeout to maximum. NOTE: Because this codebase already handle timeout of an I2C transfer, so maybe we can disable this mechanism. But we don't have any register to execute this, so we maximize the timeout. BRANCH=none BUG=none TEST=console commands: i2cscan, battery, charger, and accelinfo. Change-Id: I5025f640c027105152247212fc688388f645c5ba Signed-off-by: Dino Li Reviewed-on: https://chromium-review.googlesource.com/485203 Reviewed-by: Randall Spangler --- chip/it83xx/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chip/it83xx/i2c.c b/chip/it83xx/i2c.c index da45735cf1..146c38294c 100644 --- a/chip/it83xx/i2c.c +++ b/chip/it83xx/i2c.c @@ -22,7 +22,7 @@ * The count number of the counter for 25 ms register. * The 25 ms register is calculated by (count number *1.024 kHz). */ -#define I2C_CLK_LOW_TIMEOUT 25 /* ~= 25ms */ +#define I2C_CLK_LOW_TIMEOUT 255 /* ~=249 ms */ /* Default maximum time we allow for an I2C transfer */ #define I2C_TIMEOUT_DEFAULT_US (100 * MSEC) -- cgit v1.2.1