diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2015-05-22 17:17:47 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-05-27 19:40:00 +0000 |
commit | 1b2f6b64510c061ddabd8d6a3d5e01fc71a68712 (patch) | |
tree | a1564c27d1bce516e8ab4433aeff30b7526124fe /chip/stm32 | |
parent | 315afdff429f08dd91193883348bc74e4f9edfb1 (diff) | |
download | chrome-ec-1b2f6b64510c061ddabd8d6a3d5e01fc71a68712.tar.gz |
i2c: Make i2c_xfer a wrapper function to chip_i2c_xfer
i2c_xfer was previously implemented at the chip-level, but now we want
to add some global retry logic. Rename the chip-level i2c_xfer functions
to chip_i2c_xfer and add a new global wrapper function i2c_xfer.
BUG=chrome-os-partner:39613
TEST=Run "battery" from EC console on Cyan, verify that values + strings
are correctly printed.
BRANCH=None
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: If37c85cc3cf94fd53feb6931553e10c30ad6cad6
Reviewed-on: https://chromium-review.googlesource.com/272939
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'chip/stm32')
-rw-r--r-- | chip/stm32/i2c-stm32f.c | 4 | ||||
-rw-r--r-- | chip/stm32/i2c-stm32f0.c | 4 | ||||
-rw-r--r-- | chip/stm32/i2c-stm32l.c | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/chip/stm32/i2c-stm32f.c b/chip/stm32/i2c-stm32f.c index 75d1587c76..1fab9c3b7c 100644 --- a/chip/stm32/i2c-stm32f.c +++ b/chip/stm32/i2c-stm32f.c @@ -703,8 +703,8 @@ static int i2c_master_receive(int port, int slave_addr, uint8_t *data, return wait_until_stop_sent(port); } -int i2c_xfer(int port, int slave_addr, const uint8_t *out, int out_bytes, - uint8_t *in, int in_bytes, int flags) +int chip_i2c_xfer(int port, int slave_addr, const uint8_t *out, int out_bytes, + uint8_t *in, int in_bytes, int flags) { int rv; diff --git a/chip/stm32/i2c-stm32f0.c b/chip/stm32/i2c-stm32f0.c index b1b530e600..1dfe7d9b36 100644 --- a/chip/stm32/i2c-stm32f0.c +++ b/chip/stm32/i2c-stm32f0.c @@ -358,8 +358,8 @@ DECLARE_IRQ(IRQ_SLAVE, i2c2_event_interrupt, 2); /*****************************************************************************/ /* Interface */ -int i2c_xfer(int port, int slave_addr, const uint8_t *out, int out_bytes, - uint8_t *in, int in_bytes, int flags) +int chip_i2c_xfer(int port, int slave_addr, const uint8_t *out, int out_bytes, + uint8_t *in, int in_bytes, int flags) { int rv = EC_SUCCESS; int i; diff --git a/chip/stm32/i2c-stm32l.c b/chip/stm32/i2c-stm32l.c index 510c138410..90fe7aa0d7 100644 --- a/chip/stm32/i2c-stm32l.c +++ b/chip/stm32/i2c-stm32l.c @@ -165,8 +165,8 @@ static void i2c_init_port(const struct i2c_port_t *p) /*****************************************************************************/ /* Interface */ -int i2c_xfer(int port, int slave_addr, const uint8_t *out, int out_bytes, - uint8_t *in, int in_bytes, int flags) +int chip_i2c_xfer(int port, int slave_addr, const uint8_t *out, int out_bytes, + uint8_t *in, int in_bytes, int flags) { int started = (flags & I2C_XFER_START) ? 0 : 1; int rv = EC_SUCCESS; @@ -302,7 +302,7 @@ int i2c_xfer(int port, int slave_addr, const uint8_t *out, int out_bytes, */ if (rv == I2C_ERROR_FAILED_START) { const struct i2c_port_t *p = i2c_ports; - CPRINTS("i2c_xfer start error; " + CPRINTS("chip_i2c_xfer start error; " "unwedging and resetting i2c %d", port); i2c_unwedge(port); |