diff options
author | Michael Hennerich <michael.hennerich@analog.com> | 2009-05-27 05:24:10 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-06-13 05:39:25 -0400 |
commit | e0cd2dd5dd2b7c6512e46ce0b4f119cd7b0c74a4 (patch) | |
tree | aad364352e65a328fa21db7169d6c1a47c0d8768 /drivers/i2c/busses/i2c-bfin-twi.c | |
parent | 94327d009e3aa20214e9dfa486a1fd14445fe736 (diff) |
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>
Diffstat (limited to 'drivers/i2c/busses/i2c-bfin-twi.c')
-rw-r--r-- | drivers/i2c/busses/i2c-bfin-twi.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c index 40136ea7a46f..26d8987e69bf 100644 --- a/drivers/i2c/busses/i2c-bfin-twi.c +++ b/drivers/i2c/busses/i2c-bfin-twi.c | |||
@@ -449,6 +449,16 @@ int bfin_twi_smbus_xfer(struct i2c_adapter *adap, u16 addr, | |||
449 | } | 449 | } |
450 | iface->transPtr = data->block; | 450 | iface->transPtr = data->block; |
451 | break; | 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 | default: | 462 | default: |
453 | return -1; | 463 | return -1; |
454 | } | 464 | } |
@@ -572,7 +582,7 @@ static u32 bfin_twi_functionality(struct i2c_adapter *adap) | |||
572 | return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | | 582 | return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | |
573 | I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | | 583 | I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | |
574 | I2C_FUNC_SMBUS_BLOCK_DATA | I2C_FUNC_SMBUS_PROC_CALL | | 584 | I2C_FUNC_SMBUS_BLOCK_DATA | I2C_FUNC_SMBUS_PROC_CALL | |
575 | I2C_FUNC_I2C; | 585 | I2C_FUNC_I2C | I2C_FUNC_SMBUS_I2C_BLOCK; |
576 | } | 586 | } |
577 | 587 | ||
578 | static struct i2c_algorithm bfin_twi_algorithm = { | 588 | static struct i2c_algorithm bfin_twi_algorithm = { |