提交 0c43ea54 编写于 作者: Z Zhangfei Gao 提交者: Jean Delvare

i2c: Document the message size limit

i2c_master_send & i2c_master_recv do not support more than 64 kb
transfer, since msg.len is u16.
Signed-off-by: NZhangfei Gao <zgao6@marvell.com>
Signed-off-by: NJean Delvare <khali@linux-fr.org>
上级 eec74a25
...@@ -318,8 +318,9 @@ Plain I2C communication ...@@ -318,8 +318,9 @@ Plain I2C communication
These routines read and write some bytes from/to a client. The client These routines read and write some bytes from/to a client. The client
contains the i2c address, so you do not have to include it. The second contains the i2c address, so you do not have to include it. The second
parameter contains the bytes to read/write, the third the number of bytes parameter contains the bytes to read/write, the third the number of bytes
to read/write (must be less than the length of the buffer.) Returned is to read/write (must be less than the length of the buffer, also should be
the actual number of bytes read/written. less than 64k since msg.len is u16.) Returned is the actual number of bytes
read/written.
int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg, int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg,
int num); int num);
......
...@@ -1183,7 +1183,7 @@ EXPORT_SYMBOL(i2c_transfer); ...@@ -1183,7 +1183,7 @@ EXPORT_SYMBOL(i2c_transfer);
* i2c_master_send - issue a single I2C message in master transmit mode * i2c_master_send - issue a single I2C message in master transmit mode
* @client: Handle to slave device * @client: Handle to slave device
* @buf: Data that will be written to the slave * @buf: Data that will be written to the slave
* @count: How many bytes to write * @count: How many bytes to write, must be less than 64k since msg.len is u16
* *
* Returns negative errno, or else the number of bytes written. * Returns negative errno, or else the number of bytes written.
*/ */
...@@ -1210,7 +1210,7 @@ EXPORT_SYMBOL(i2c_master_send); ...@@ -1210,7 +1210,7 @@ EXPORT_SYMBOL(i2c_master_send);
* i2c_master_recv - issue a single I2C message in master receive mode * i2c_master_recv - issue a single I2C message in master receive mode
* @client: Handle to slave device * @client: Handle to slave device
* @buf: Where to store data read from slave * @buf: Where to store data read from slave
* @count: How many bytes to read * @count: How many bytes to read, must be less than 64k since msg.len is u16
* *
* Returns negative errno, or else the number of bytes read. * Returns negative errno, or else the number of bytes read.
*/ */
......
...@@ -53,6 +53,7 @@ struct i2c_board_info; ...@@ -53,6 +53,7 @@ struct i2c_board_info;
* on a bus (or read from them). Apart from two basic transfer functions to * on a bus (or read from them). Apart from two basic transfer functions to
* transmit one message at a time, a more complex version can be used to * transmit one message at a time, a more complex version can be used to
* transmit an arbitrary number of messages without interruption. * transmit an arbitrary number of messages without interruption.
* @count must be be less than 64k since msg.len is u16.
*/ */
extern int i2c_master_send(struct i2c_client *client, const char *buf, extern int i2c_master_send(struct i2c_client *client, const char *buf,
int count); int count);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册