bus: mhi: ep: Add support for reading from the host
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Sat, 12 Feb 2022 15:39:23 +0000 (21:09 +0530)
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Mon, 4 Apr 2022 04:47:51 +0000 (10:17 +0530)
commit20c01fde1b36dec0a3ffdbd22f6d117a29cf586d
treef6cef4a781ca5208026e2b50d1e95ff13749f52c
parent2b231a40e9073a6828fb960f055b07707b6dd205
bus: mhi: ep: Add support for reading from the host

Data transfer between host and the ep device happens over the transfer
ring associated with each bi-directional channel pair. Host defines the
transfer ring by allocating memory for it. The read and write pointer
addresses of the transfer ring are stored in the channel context.

Once host places the elements in the transfer ring, it increments the
write pointer and rings the channel doorbell. Device will receive the
doorbell interrupt and will process the transfer ring elements.

This commit adds support for reading the transfer ring elements from
the transfer ring till write pointer, incrementing the read pointer and
finally sending the completion event to the host through corresponding
event ring.

Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/bus/mhi/ep/main.c
include/linux/mhi_ep.h