summaryrefslogtreecommitdiff
path: root/chip/lm4
diff options
context:
space:
mode:
authorAlexandru M Stan <amstan@chromium.org>2019-08-27 17:15:56 -0700
committerCommit Bot <commit-bot@chromium.org>2019-10-24 02:25:54 +0000
commit56662a29b010870338c4338c32a3f6afd9912cb7 (patch)
tree24c7921a8008a0da499146349c308254b6094682 /chip/lm4
parent5f683e3de7f605302ec8af791044cff23b0920ee (diff)
downloadchrome-ec-56662a29b010870338c4338c32a3f6afd9912cb7.tar.gz
main: Initialize I2C pretty early
Some devices (like the keyboard, CBI) need I2C access pretty early. Until now I2C would get initialized pretty late in a hook, which was far too late for some stuff. As a result from this change, CONFIG_I2C_MASTER now implies the i2c_init() function will be called at board boot. Some chips (cr50, host tests) needed a stub i2c_init in order to compile cleanly. BUG=b/138384267 TEST=EFS doesn't happen significantly later than it used to TEST=Recovery keys now work with I2C keyboard on jacuzzi TEST=make buildall TEST=Sanity check i2c behavior (booting, "i2scan", "battery") on a variety of ECs: * ampton (ite EC, x86 AP) * bobba (npcx EC, x86 AP) * jacuzzi (stm32f0 EC, ARM AP) * cheza (npcx EC, ARM AP) BRANCH=master Change-Id: Ifa830e8e509ff16b36b4dcc86617869b1cb86ac3 Signed-off-by: Alexandru M Stan <amstan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1772490 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'chip/lm4')
-rw-r--r--chip/lm4/i2c.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/chip/lm4/i2c.c b/chip/lm4/i2c.c
index b95fcba0b0..7cd06c430f 100644
--- a/chip/lm4/i2c.c
+++ b/chip/lm4/i2c.c
@@ -343,7 +343,7 @@ static void i2c_freq_changed(void)
}
DECLARE_HOOK(HOOK_FREQ_CHANGE, i2c_freq_changed, HOOK_PRIO_DEFAULT);
-static void i2c_init(void)
+void i2c_init(void)
{
uint32_t mask = 0;
int i;
@@ -374,7 +374,6 @@ static void i2c_init(void)
i2c_set_timeout(i, 0);
}
}
-DECLARE_HOOK(HOOK_INIT, i2c_init, HOOK_PRIO_INIT_I2C);
/**
* Handle an interrupt on the specified port.