Skip to content

Commit 521a72e

Browse files
Wolfram SangWolfram Sang
authored andcommitted
i2c: add a message flag for DMA safe buffers
I2C has no requirement that the buffer of a message needs to be DMA safe. In case it is, it can now be flagged, so drivers wishing to do DMA can use the buffer directly. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
1 parent 14911c6 commit 521a72e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/uapi/linux/i2c.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ struct i2c_msg {
7272
#define I2C_M_RD 0x0001 /* read data, from slave to master */
7373
/* I2C_M_RD is guaranteed to be 0x0001! */
7474
#define I2C_M_TEN 0x0010 /* this is a ten bit chip address */
75+
#define I2C_M_DMA_SAFE 0x0200 /* the buffer of this message is DMA safe */
76+
/* makes only sense in kernelspace */
77+
/* userspace buffers are copied anyway */
7578
#define I2C_M_RECV_LEN 0x0400 /* length will be first received byte */
7679
#define I2C_M_NO_RD_ACK 0x0800 /* if I2C_FUNC_PROTOCOL_MANGLING */
7780
#define I2C_M_IGNORE_NAK 0x1000 /* if I2C_FUNC_PROTOCOL_MANGLING */

0 commit comments

Comments
 (0)