summaryrefslogtreecommitdiff
path: root/drivers/rpmsg/qcom_glink_rpm.c
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2017-08-24 10:21:36 +0300
committerBjorn Andersson <bjorn.andersson@linaro.org>2017-08-30 06:34:13 +0300
commitb88eee975a26b1542c9da91571f79c110c108dd1 (patch)
tree024182d504531d4628e2e3665558738c53a2b9ee /drivers/rpmsg/qcom_glink_rpm.c
parent64f95f87920da673d84396ff1253be2098751e38 (diff)
downloadlinux-b88eee975a26b1542c9da91571f79c110c108dd1.tar.xz
rpmsg: glink: Make RX FIFO peak accessor to take an offset
To fully read the received rx data from FIFO both the command and data has to be read. Currently we read command, data separately and process them. By adding an offset parameter to RX FIFO peak accessor, command and data can be read together, simplifying things. So introduce this. Acked-by: Arun Kumar Neelakantam <aneela@codeaurora.org> Signed-off-by: Sricharan R <sricharan@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/rpmsg/qcom_glink_rpm.c')
-rw-r--r--drivers/rpmsg/qcom_glink_rpm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/rpmsg/qcom_glink_rpm.c b/drivers/rpmsg/qcom_glink_rpm.c
index 5a86e089a977..69b25d157d0f 100644
--- a/drivers/rpmsg/qcom_glink_rpm.c
+++ b/drivers/rpmsg/qcom_glink_rpm.c
@@ -77,13 +77,16 @@ static size_t glink_rpm_rx_avail(struct qcom_glink_pipe *glink_pipe)
}
static void glink_rpm_rx_peak(struct qcom_glink_pipe *glink_pipe,
- void *data, size_t count)
+ void *data, unsigned int offset, size_t count)
{
struct glink_rpm_pipe *pipe = to_rpm_pipe(glink_pipe);
unsigned int tail;
size_t len;
tail = readl(pipe->tail);
+ tail += offset;
+ if (tail >= pipe->native.length)
+ tail -= pipe->native.length;
len = min_t(size_t, count, pipe->native.length - tail);
if (len) {