diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-12 13:25:00 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-12 13:25:00 -0700 |
commit | 068345f4a873e8b0b511e8f94a595a20e176eeff (patch) | |
tree | f67503164f017b45ab425827d71fb7d23920a519 /drivers/i2c/i2c-dev.c | |
parent | c39736823232bc3ca113c8228fa852c09fba300e (diff) | |
parent | 0a85e9a271a754e352af8a8b625025017fd97449 (diff) |
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: (26 commits)
i2c-rpx: Remove
i2c-mpc: work around missing-9th-clock-pulse bug
i2c: New PMC MSP71xx TWI bus driver
i2c-savage4: Delete many unused defines
i2c/tsl2550: Speed up initialization
i2c: New bus driver for the TAOS evaluation modules
i2c-i801: Use the internal 32-byte buffer on ICH4+
i2c-i801: Various cleanups
i2c: Add support for the TSL2550
i2c-pxa: Support new-style I2C drivers
i2c-gpio: Make some internal functions static
i2c-gpio: Add support for new-style clients
i2c-iop3xx: Switch to static adapter numbering
i2c-sis5595: Resolve resource conflict with sis5595
matroxfb: Clean-up i2c header inclusions
i2c-nforce2: Add support for SMBus block transactions
i2c-mpc: Use i2c_add_numbered_adapter
i2c-mv64xxx: Use i2c_add_numbered_adapter
i2c-piix4: Add support for the ATI SB700
i2c: New DS1682 chip driver
...
Diffstat (limited to 'drivers/i2c/i2c-dev.c')
-rw-r--r-- | drivers/i2c/i2c-dev.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c index e7a70971059..64eee9551b2 100644 --- a/drivers/i2c/i2c-dev.c +++ b/drivers/i2c/i2c-dev.c @@ -283,6 +283,7 @@ static int i2cdev_ioctl(struct inode *inode, struct file *file, (data_arg.size != I2C_SMBUS_WORD_DATA) && (data_arg.size != I2C_SMBUS_PROC_CALL) && (data_arg.size != I2C_SMBUS_BLOCK_DATA) && + (data_arg.size != I2C_SMBUS_I2C_BLOCK_BROKEN) && (data_arg.size != I2C_SMBUS_I2C_BLOCK_DATA) && (data_arg.size != I2C_SMBUS_BLOCK_PROC_CALL)) { dev_dbg(&client->adapter->dev, @@ -329,10 +330,18 @@ static int i2cdev_ioctl(struct inode *inode, struct file *file, if ((data_arg.size == I2C_SMBUS_PROC_CALL) || (data_arg.size == I2C_SMBUS_BLOCK_PROC_CALL) || + (data_arg.size == I2C_SMBUS_I2C_BLOCK_DATA) || (data_arg.read_write == I2C_SMBUS_WRITE)) { if (copy_from_user(&temp, data_arg.data, datasize)) return -EFAULT; } + if (data_arg.size == I2C_SMBUS_I2C_BLOCK_BROKEN) { + /* Convert old I2C block commands to the new + convention. This preserves binary compatibility. */ + data_arg.size = I2C_SMBUS_I2C_BLOCK_DATA; + if (data_arg.read_write == I2C_SMBUS_READ) + temp.block[0] = I2C_SMBUS_BLOCK_MAX; + } res = i2c_smbus_xfer(client->adapter,client->addr,client->flags, data_arg.read_write, data_arg.command,data_arg.size,&temp); |