diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2017-11-04 21:20:02 +0100 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2017-12-03 20:47:44 +0100 |
commit | e94bc5d18be03dac8e9d73d30c5523728edeff76 (patch) | |
tree | b27ccb2a6eced40136fb73208f3e77cb8809c8e7 /include | |
parent | i2c: add a message flag for DMA safe buffers (diff) | |
download | linux-e94bc5d18be03dac8e9d73d30c5523728edeff76.tar.xz linux-e94bc5d18be03dac8e9d73d30c5523728edeff76.zip |
i2c: add helpers to ease DMA handling
One helper checks if DMA is suitable and optionally creates a bounce
buffer, if not. The other function returns the bounce buffer and makes
sure the data is properly copied back to the message.
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/i2c.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index a556db976fc6..9d9d379b5a15 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -768,6 +768,9 @@ static inline u8 i2c_8bit_addr_from_msg(const struct i2c_msg *msg) return (msg->addr << 1) | (msg->flags & I2C_M_RD ? 1 : 0); } +u8 *i2c_get_dma_safe_msg_buf(struct i2c_msg *msg, unsigned int threshold); +void i2c_release_dma_safe_msg_buf(struct i2c_msg *msg, u8 *buf); + int i2c_handle_smbus_host_notify(struct i2c_adapter *adap, unsigned short addr); /** * module_i2c_driver() - Helper macro for registering a modular I2C driver |