Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rpmsg: qcom_smd: Implement endpoint "poll"

Add support for polling the status of the write buffer so that user
space can use rpmsg character devices in non-blocking mode.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

+16
+16
drivers/rpmsg/qcom_smd.c
··· 919 919 return __qcom_smd_send(qsept->qsch, data, len, false); 920 920 } 921 921 922 + static unsigned int qcom_smd_poll(struct rpmsg_endpoint *ept, 923 + struct file *filp, poll_table *wait) 924 + { 925 + struct qcom_smd_endpoint *qsept = to_smd_endpoint(ept); 926 + struct qcom_smd_channel *channel = qsept->qsch; 927 + unsigned int mask = 0; 928 + 929 + poll_wait(filp, &channel->fblockread_event, wait); 930 + 931 + if (qcom_smd_get_tx_avail(channel) > 20) 932 + mask |= POLLOUT | POLLWRNORM; 933 + 934 + return mask; 935 + } 936 + 922 937 /* 923 938 * Finds the device_node for the smd child interested in this channel. 924 939 */ ··· 966 951 .destroy_ept = qcom_smd_destroy_ept, 967 952 .send = qcom_smd_send, 968 953 .trysend = qcom_smd_trysend, 954 + .poll = qcom_smd_poll, 969 955 }; 970 956 971 957 /*