diff options
author | Frank Schaefer <fschaefer.oss@googlemail.com> | 2013-01-03 12:27:04 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-01-04 22:16:54 -0500 |
commit | eaf33c404cd60ba4b442324766abbb5da8c94381 (patch) | |
tree | 5a5448283e24d675107d4deb87c0e8fd64ef5e28 | |
parent | 2fcc82d8831a74afd55c3cb898beb9fde5f2a1fd (diff) |
[media] em28xx: fix the i2c adapter functionality flags
I2C_FUNC_SMBUS_EMUL includes flag I2C_FUNC_SMBUS_WRITE_BLOCK_DATA which signals
that up to 31 data bytes can be written to the ic2 client.
But the EM2800 supports only i2c messages with max. 4 data bytes.
I2C_FUNC_IC2 should be set if a master_xfer function pointer is provided in
struct i2c_algorithm.
Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-i2c.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c index 67a8e623dd8c..4a24ed08e46a 100644 --- a/drivers/media/usb/em28xx/em28xx-i2c.c +++ b/drivers/media/usb/em28xx/em28xx-i2c.c | |||
@@ -445,7 +445,11 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned char *eedata, int len) | |||
445 | */ | 445 | */ |
446 | static u32 functionality(struct i2c_adapter *adap) | 446 | static u32 functionality(struct i2c_adapter *adap) |
447 | { | 447 | { |
448 | return I2C_FUNC_SMBUS_EMUL; | 448 | struct em28xx *dev = adap->algo_data; |
449 | u32 func_flags = I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; | ||
450 | if (dev->board.is_em2800) | ||
451 | func_flags &= ~I2C_FUNC_SMBUS_WRITE_BLOCK_DATA; | ||
452 | return func_flags; | ||
449 | } | 453 | } |
450 | 454 | ||
451 | static struct i2c_algorithm em28xx_algo = { | 455 | static struct i2c_algorithm em28xx_algo = { |