mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-20 05:43:09 +00:00
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>
This commit is contained in:
parent
521a72e1f2
commit
e94bc5d18b
2 changed files with 49 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue