kernel_optimize_test/Documentation/i2c
Jean Delvare 4b2643d7d9 i2c: Fix the i2c_smbus_read_i2c_block_data() prototype
Let the drivers specify how many bytes they want to read with
i2c_smbus_read_i2c_block_data(). So far, the block count was
hard-coded to I2C_SMBUS_BLOCK_MAX (32), which did not make much sense.
Many driver authors complained about this before, and I believe it's
about time to fix it. Right now, authors have to do technically stupid
things, such as individual byte reads or full-fledged I2C messaging,
to work around the problem. We do not want to encourage that.

I even found that some bus drivers (e.g. i2c-amd8111) already
implemented I2C block read the "right" way, that is, they didn't
follow the old, broken standard. The fact that it was never noticed
before just shows how little i2c_smbus_read_i2c_block_data() was used,
which isn't that surprising given how broken its prototype was so far.

There are some obvious compatiblity considerations:
* This changes the i2c_smbus_read_i2c_block_data() prototype. Users
  outside the kernel tree will notice at compilation time, and will
  have to update their code.
* User-space has access to i2c_smbus_xfer() directly using i2c-dev, so
  the changed expectations would affect tools such as i2cdump. In order
  to preserve binary compatibility, we give I2C_SMBUS_I2C_BLOCK_DATA
  a new numeric value, and define I2C_SMBUS_I2C_BLOCK_BROKEN with the
  old numeric value. When i2c-dev receives a transaction with the
  old value, it can convert it to the new format on the fly.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2007-07-12 14:12:29 +02:00
..
busses documentation: convert the Documentation directory to UTF-8 2007-05-09 08:58:19 +02:00
chips i2c: Fix the i2c_smbus_read_i2c_block_data() prototype 2007-07-12 14:12:29 +02:00
dev-interface [PATCH] I2C: Clarify the usage of i2c-dev.h 2005-07-11 14:10:37 -07:00
functionality [PATCH] i2c: Fix I2C_FUNC_PROTOCOL_MANGLING documentation 2005-10-28 14:02:07 -07:00
i2c-protocol documentation: convert the Documentation directory to UTF-8 2007-05-09 08:58:19 +02:00
i2c-stub i2c-stub: Chip address as a module parameter 2006-09-26 15:38:51 -07:00
porting-clients i2c: Documentation update 2007-05-01 23:26:35 +02:00
smbus-protocol i2c: Fix typo in SMBus Write Word Data description 2007-02-13 22:08:59 +01:00
summary i2c: i2c probe() and remove() documented 2007-05-01 23:26:31 +02:00
ten-bit-addresses Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
writing-clients i2c: Fix the i2c_smbus_read_i2c_block_data() prototype 2007-07-12 14:12:29 +02:00