]> git.karo-electronics.de Git - karo-tx-linux.git/commit
i2c-dev: Add support for I2C_M_RECV_LEN
authorJean Delvare <khali@linux-fr.org>
Mon, 9 Apr 2012 23:50:35 +0000 (09:50 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 9 Apr 2012 23:50:35 +0000 (09:50 +1000)
commit85bb1a80a25f5a72b888e75b39e4f0daa4b37400
treed40fede45ec1e89448a9baad3ba51fbc6059bc55
parentdd775ae2549217d3ae09363e3edb305d0fa19928
i2c-dev: Add support for I2C_M_RECV_LEN

As the bus driver side implementation of I2C_M_RECV_LEN is heavily
tied to SMBus, we can't support received length over 32 bytes, but
let's at least support that.

In practice, the caller will have to setup a buffer large enough to
cover the case where received length byte has value 32, so minimum
32 + 1 = 33 bytes, possibly more if there is a fixed number of bytes
added for the specific slave (for example a checksum.)

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Douglas Gilbert <dgilbert@interlog.com>
drivers/i2c/i2c-dev.c