diff options
author | Peter Meerwald <pmeerw@pmeerw.net> | 2009-06-29 15:48:33 -0400 |
---|---|---|
committer | Heiko Schocher <hs@denx.de> | 2009-06-30 08:27:45 +0200 |
commit | 98ab14e858bf60306d0aa3f0df5a7a5f88264aff (patch) | |
tree | 412c45f36acd5164bbebfbf9e3c51a9c0c243292 | |
parent | 3e88337b225bf796f6df21d0a7f591530e9d4ce0 (diff) | |
download | u-boot-imx-98ab14e858bf60306d0aa3f0df5a7a5f88264aff.zip u-boot-imx-98ab14e858bf60306d0aa3f0df5a7a5f88264aff.tar.gz u-boot-imx-98ab14e858bf60306d0aa3f0df5a7a5f88264aff.tar.bz2 |
Blackfin: TWI/I2C: fix pure writes
If doing a pure write with register address and data (not a read/write
combo transfer), we don't set the initial transfer length properly which
ends up causing only the register address to be transferred.
While we're here, fix the i2c_write() parameter description of the buffer.
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r-- | drivers/i2c/bfin-twi_i2c.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/bfin-twi_i2c.c b/drivers/i2c/bfin-twi_i2c.c index cfe55cd..e790634 100644 --- a/drivers/i2c/bfin-twi_i2c.c +++ b/drivers/i2c/bfin-twi_i2c.c @@ -164,7 +164,7 @@ static int i2c_transfer(uchar chip, uint addr, int alen, uchar *buffer, int len, /* prime the pump */ if (msg.alen) { - len = msg.alen; + len = (msg.flags & I2C_M_COMBO) ? msg.alen : msg.alen + len; debugi("first byte=0x%02x", *msg.abuf); bfin_write_TWI_XMT_DATA8(*(msg.abuf++)); --msg.alen; @@ -275,7 +275,7 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len) * @chip: i2c chip addr * @addr: memory (register) address in the chip * @alen: byte size of address - * @buffer: buffer to store data read from chip + * @buffer: buffer holding data to write to chip * @len: how many bytes to write * @return: 0 on success, non-0 on failure */ |