linux/drivers/i2c/chips
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
..
ds1337.c i2c: fix broken ds1337 initialization 2006-12-10 21:21:31 +01:00
ds1374.c i2c/ds1374: Check workqueue creation status 2007-03-22 19:49:01 +01:00
eeprom.c i2c: Fix the i2c_smbus_read_i2c_block_data() prototype 2007-07-12 14:12:29 +02:00
isp1301_omap.c USB: <linux/usb_ch9.h> becomes <linux/usb/ch9.h> 2007-02-07 15:44:32 -08:00
Kconfig i2c: Deprecate legacy RTC drivers 2007-07-12 14:12:29 +02:00
m41t00.c i2c/m41t00: Do not forget to write year 2007-01-05 17:54:05 +01:00
Makefile [PATCH] RTC subsystem: I2C cleanup 2006-03-27 08:44:51 -08:00
max6875.c i2c: Fix the i2c_smbus_read_i2c_block_data() prototype 2007-07-12 14:12:29 +02:00
pca9539.c i2c: __must_check fixes (chip drivers) 2006-09-26 15:38:51 -07:00
pcf8574.c i2c: __must_check fixes (chip drivers) 2006-09-26 15:38:51 -07:00
pcf8591.c i2c: __must_check fixes (chip drivers) 2006-09-26 15:38:51 -07:00
tps65010.c PM: Separate hibernation code from suspend code 2007-05-09 12:30:48 -07:00