diff options
author | Aseda Aboagye <aaboagye@google.com> | 2018-08-19 17:14:29 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-08-22 00:10:38 -0700 |
commit | fe16ade3ea5dfdd01cf466a9a6bff76d8fa17f11 (patch) | |
tree | f8dde4ea45bb74f588ea111b6094a0e2a8c0e14f /include/i2c.h | |
parent | af908bfce225415c01d56b3f57cfc399d8485d3e (diff) | |
download | chrome-ec-fe16ade3ea5dfdd01cf466a9a6bff76d8fa17f11.tar.gz |
i2c: Don't try to unwedge unpowered busses.
If an i2c bus is known to be unpowered, we should not spend time trying
to unwedge it. It's futile, so stop trying. This commit adds a config
option,
CONFIG_I2C_BUS_MAY_BE_UNPOWERED
which can be defined by a board if a bus may be unpowered during
runtime.
BUG=b:111683988
BRANCH=nocturne
TEST=Verify that unwedge attempts are skipped if the bus is deemed
unpowered.
Change-Id: Ice12b3957121be476ef0173a86f239f183010b47
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1182877
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
Diffstat (limited to 'include/i2c.h')
-rw-r--r-- | include/i2c.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/i2c.h b/include/i2c.h index 8ae21566cb..1dcfe46332 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -361,6 +361,16 @@ void i2cm_init(void); int board_allow_i2c_passthru(int port); /** + * Board level function that can indicate if a particular i2c bus is known to be + * currently powered or not. + * + * @param port: I2C port number + * + * @return non-zero if powered, 0 if the bus is not powered. + */ +int board_is_i2c_port_powered(int port); + +/** * Function to allow board to take any action before starting a new i2c * transaction on a given port. Board must implement this if it defines * CONFIG_I2C_XFER_BOARD_CALLBACK. |