bus: mhi: ep: Introduce async read/write callbacks
[ Upstream commit 8b786ed8fb089e347af21d13ba5677325fcd4cd8 ] These callbacks can be implemented by the controller drivers to perform async read/write operation that increases the throughput. For aiding the async operation, a completion callback is also introduced. Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Stable-dep-of: c7d0b2db5bc5 ("bus: mhi: ep: Do not allocate memory for MHI objects from DMA zone") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
efdfa92a82
commit
a77e5950f9
|
@ -54,11 +54,16 @@ struct mhi_ep_db_info {
|
||||||
* @dev_addr: Address of the buffer in endpoint
|
* @dev_addr: Address of the buffer in endpoint
|
||||||
* @host_addr: Address of the bufffer in host
|
* @host_addr: Address of the bufffer in host
|
||||||
* @size: Size of the buffer
|
* @size: Size of the buffer
|
||||||
|
* @cb: Callback to be executed by controller drivers after transfer completion (async)
|
||||||
|
* @cb_buf: Opaque buffer to be passed to the callback
|
||||||
*/
|
*/
|
||||||
struct mhi_ep_buf_info {
|
struct mhi_ep_buf_info {
|
||||||
void *dev_addr;
|
void *dev_addr;
|
||||||
u64 host_addr;
|
u64 host_addr;
|
||||||
size_t size;
|
size_t size;
|
||||||
|
|
||||||
|
void (*cb)(struct mhi_ep_buf_info *buf_info);
|
||||||
|
void *cb_buf;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -96,6 +101,8 @@ struct mhi_ep_buf_info {
|
||||||
* @unmap_free: CB function to unmap and free the allocated memory in endpoint for storing host context
|
* @unmap_free: CB function to unmap and free the allocated memory in endpoint for storing host context
|
||||||
* @read_sync: CB function for reading from host memory synchronously
|
* @read_sync: CB function for reading from host memory synchronously
|
||||||
* @write_sync: CB function for writing to host memory synchronously
|
* @write_sync: CB function for writing to host memory synchronously
|
||||||
|
* @read_async: CB function for reading from host memory asynchronously
|
||||||
|
* @write_async: CB function for writing to host memory asynchronously
|
||||||
* @mhi_state: MHI Endpoint state
|
* @mhi_state: MHI Endpoint state
|
||||||
* @max_chan: Maximum channels supported by the endpoint controller
|
* @max_chan: Maximum channels supported by the endpoint controller
|
||||||
* @mru: MRU (Maximum Receive Unit) value of the endpoint controller
|
* @mru: MRU (Maximum Receive Unit) value of the endpoint controller
|
||||||
|
@ -151,6 +158,8 @@ struct mhi_ep_cntrl {
|
||||||
void __iomem *virt, size_t size);
|
void __iomem *virt, size_t size);
|
||||||
int (*read_sync)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
|
int (*read_sync)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
|
||||||
int (*write_sync)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
|
int (*write_sync)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
|
||||||
|
int (*read_async)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
|
||||||
|
int (*write_async)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
|
||||||
|
|
||||||
enum mhi_state mhi_state;
|
enum mhi_state mhi_state;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue