aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-core.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2005-10-07 18:15:59 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-10-28 17:02:10 -0400
commit30dac7469741906436b50f9413dccd446366d371 (patch)
treeb5285192cd8b4274781d2dabd3bf89ceefadba82 /drivers/i2c/i2c-core.c
parentd3554b4a2fb0e2229eb0d3fa9ece5b2f0b906d3e (diff)
[PATCH] i2c: Drop I2C_SMBUS_I2C_BLOCK_MAX
Drop I2C_SMBUS_I2C_BLOCK_MAX, use I2C_SMBUS_BLOCK_MAX instead. I2C_SMBUS_I2C_BLOCK_MAX has always been defined to the same value as I2C_SMBUS_BLOCK_MAX, and this will never change: setting it to a lower value would make no sense, setting it to a higher value would break i2c_smbus_data compatibility. There is no point in changing i2c_smbus_data to support larger block transactions in SMBus mode, as no SMBus hardware supports more than 32 byte blocks. Thus, for larger transactions, direct I2C transfers are the way to go. Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-rw-r--r--drivers/i2c/i2c-core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 9583a54ce16b..15354176ff63 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1108,10 +1108,10 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter * adapter, u16 addr,
1108 return -1; 1108 return -1;
1109 case I2C_SMBUS_I2C_BLOCK_DATA: 1109 case I2C_SMBUS_I2C_BLOCK_DATA:
1110 if (read_write == I2C_SMBUS_READ) { 1110 if (read_write == I2C_SMBUS_READ) {
1111 msg[1].len = I2C_SMBUS_I2C_BLOCK_MAX; 1111 msg[1].len = I2C_SMBUS_BLOCK_MAX;
1112 } else { 1112 } else {
1113 msg[0].len = data->block[0] + 1; 1113 msg[0].len = data->block[0] + 1;
1114 if (msg[0].len > I2C_SMBUS_I2C_BLOCK_MAX + 1) { 1114 if (msg[0].len > I2C_SMBUS_BLOCK_MAX + 1) {
1115 dev_err(&adapter->dev, "i2c_smbus_xfer_emulated called with " 1115 dev_err(&adapter->dev, "i2c_smbus_xfer_emulated called with "
1116 "invalid block write size (%d)\n", 1116 "invalid block write size (%d)\n",
1117 data->block[0]); 1117 data->block[0]);
@@ -1144,8 +1144,8 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter * adapter, u16 addr,
1144 break; 1144 break;
1145 case I2C_SMBUS_I2C_BLOCK_DATA: 1145 case I2C_SMBUS_I2C_BLOCK_DATA:
1146 /* fixed at 32 for now */ 1146 /* fixed at 32 for now */
1147 data->block[0] = I2C_SMBUS_I2C_BLOCK_MAX; 1147 data->block[0] = I2C_SMBUS_BLOCK_MAX;
1148 for (i = 0; i < I2C_SMBUS_I2C_BLOCK_MAX; i++) 1148 for (i = 0; i < I2C_SMBUS_BLOCK_MAX; i++)
1149 data->block[i+1] = msgbuf1[i]; 1149 data->block[i+1] = msgbuf1[i];
1150 break; 1150 break;
1151 } 1151 }