Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: Blackfin TWI: implement I2C_FUNC_SMBUS_I2C_BLOCK functionality

Some drivers need i2c_smbus_read_i2c_block_data() functionality, so add
support for it to the Blackfin I2C bus driver.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
[ben-linux@fluff.org: shortened subject]
Signed-off-by: Ben Dooks <ben-linux@fluff.org>

authored by

Michael Hennerich and committed by
Ben Dooks
e0cd2dd5 94327d00

+11 -1
+11 -1
drivers/i2c/busses/i2c-bfin-twi.c
··· 449 449 } 450 450 iface->transPtr = data->block; 451 451 break; 452 + case I2C_SMBUS_I2C_BLOCK_DATA: 453 + if (read_write == I2C_SMBUS_READ) { 454 + iface->readNum = data->block[0]; 455 + iface->cur_mode = TWI_I2C_MODE_COMBINED; 456 + } else { 457 + iface->writeNum = data->block[0]; 458 + iface->cur_mode = TWI_I2C_MODE_STANDARDSUB; 459 + } 460 + iface->transPtr = (u8 *)&data->block[1]; 461 + break; 452 462 default: 453 463 return -1; 454 464 } ··· 582 572 return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | 583 573 I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | 584 574 I2C_FUNC_SMBUS_BLOCK_DATA | I2C_FUNC_SMBUS_PROC_CALL | 585 - I2C_FUNC_I2C; 575 + I2C_FUNC_I2C | I2C_FUNC_SMBUS_I2C_BLOCK; 586 576 } 587 577 588 578 static struct i2c_algorithm bfin_twi_algorithm = {