diff options
author | Nicolas Boichat <drinkcat@google.com> | 2016-05-19 08:58:47 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-05-24 19:23:27 -0700 |
commit | f5bba241fdcefcc0c1d2f82b097caa2923b3ccc5 (patch) | |
tree | 7844194da213c658c2558c54a966e4340e5f4246 /include/i2c.h | |
parent | d2bbc229f378b741bfc2ff0d2092d501531626a9 (diff) | |
download | chrome-ec-f5bba241fdcefcc0c1d2f82b097caa2923b3ccc5.tar.gz |
common/i2c: Add I2C passthru_protect command
This allows the AP to protect a I2C passthru bus. A board-specific
function then defines what I2C commands are allowed, so that we
can white/black list some addresses (e.g. I2C address allowing
PD chip FW updating).
BRANCH=none
BUG=chrome-os-partner:52431
TEST=Book elm-rev1
Change-Id: Ib106924418b16388ea8ea53c7b6bda6ef92e1d09
Signed-off-by: Nicolas Boichat <drinkcat@google.com>
Reviewed-on: https://chromium-review.googlesource.com/345761
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@google.com>
Diffstat (limited to 'include/i2c.h')
-rw-r--r-- | include/i2c.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/i2c.h b/include/i2c.h index fdda5a0187..d3329df64a 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -31,6 +31,10 @@ struct i2c_port_t { int kbps; /* Speed in kbps */ enum gpio_signal scl; /* Port SCL GPIO line */ enum gpio_signal sda; /* Port SDA GPIO line */ + /* When bus is protected, returns true if passthru allowed for address. + * If the function is not defined, the default value is true. */ + int (*passthru_allowed)(const struct i2c_port_t *port, + uint16_t address); }; extern const struct i2c_port_t i2c_ports[]; |