diff options
author | Bartosz Golaszewski | 2015-10-27 17:15:03 +0100 |
---|---|---|
committer | Denys Vlasenko | 2015-11-01 20:55:09 +0100 |
commit | 1fe75b8ef10933d047f7ab6060d4710a39611e92 (patch) | |
tree | ba996199060d15dbb5ad9f7bf470ab14ba277fe3 | |
parent | 1cde5f79d4c077cd6a2a8998a9180dfcc2800852 (diff) | |
download | busybox-1fe75b8ef10933d047f7ab6060d4710a39611e92.zip busybox-1fe75b8ef10933d047f7ab6060d4710a39611e92.tar.gz |
i2cdump: use I2C block mode for the 'i' mode parameter
Currently we're calling i2c_smbus_read_block_data() for both 'i' and 's'
mode parameters. If the bus doesn't support SMBus block mode, then the
i2c access ioctl() fails. Make i2cdump behave compatibly with upstream
version by calling i2c_smbus_read_i2c_block_data() for I2C block.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | miscutils/i2c_tools.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c index 094bf9e..6d221e9 100644 --- a/miscutils/i2c_tools.c +++ b/miscutils/i2c_tools.c @@ -723,7 +723,7 @@ static int read_block_data(int buf_fd, int mode, int *block) uint8_t cblock[I2C_SMBUS_BLOCK_MAX + I2CDUMP_NUM_REGS]; int res, blen = 0, tmp, i; - if (mode == I2C_SMBUS_BLOCK_DATA || mode == I2C_SMBUS_I2C_BLOCK_DATA) { + if (mode == I2C_SMBUS_BLOCK_DATA) { res = i2c_smbus_read_block_data(buf_fd, 0, cblock); blen = res; } else { |