summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/uvc_v4l2.c
diff options
context:
space:
mode:
authorBhupesh Sharma <bhupesh.sharma@st.com>2013-03-28 10:41:53 +0100
committerFelipe Balbi <balbi@ti.com>2013-04-02 10:42:49 +0200
commit2f1d57069338b14fcf4765ae2c25fc377da45b1f (patch)
tree3b2cbfd148a6d5766ebd3b2b0decd6346b94e929 /drivers/usb/gadget/uvc_v4l2.c
parentusb: gadget/uvc: Port UVC webcam gadget to use videobuf2 framework (diff)
downloadlinux-2f1d57069338b14fcf4765ae2c25fc377da45b1f.tar.xz
linux-2f1d57069338b14fcf4765ae2c25fc377da45b1f.zip
usb: gadget/uvc: Add support for 'get_unmapped_area' for MMUless architectures
This patch adds the support for 'get_unmapped_area' in UVC gadget which is called when the 'mmap' system call is executed on MMUless architectures. Signed-off-by: Bhupesh Sharma <bhupesh.sharma@st.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers/usb/gadget/uvc_v4l2.c')
-rw-r--r--drivers/usb/gadget/uvc_v4l2.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/usb/gadget/uvc_v4l2.c b/drivers/usb/gadget/uvc_v4l2.c
index c058867ea4fb..ad48e81155e2 100644
--- a/drivers/usb/gadget/uvc_v4l2.c
+++ b/drivers/usb/gadget/uvc_v4l2.c
@@ -339,6 +339,18 @@ uvc_v4l2_poll(struct file *file, poll_table *wait)
return uvc_queue_poll(&uvc->video.queue, file, wait);
}
+#ifndef CONFIG_MMU
+static unsigned long uvc_v4l2_get_unmapped_area(struct file *file,
+ unsigned long addr, unsigned long len, unsigned long pgoff,
+ unsigned long flags)
+{
+ struct video_device *vdev = video_devdata(file);
+ struct uvc_device *uvc = video_get_drvdata(vdev);
+
+ return uvc_queue_get_unmapped_area(&uvc->video.queue, pgoff);
+}
+#endif
+
static struct v4l2_file_operations uvc_v4l2_fops = {
.owner = THIS_MODULE,
.open = uvc_v4l2_open,
@@ -346,5 +358,8 @@ static struct v4l2_file_operations uvc_v4l2_fops = {
.ioctl = uvc_v4l2_ioctl,
.mmap = uvc_v4l2_mmap,
.poll = uvc_v4l2_poll,
+#ifndef CONFIG_MMU
+ .get_unmapped_area = uvc_v4l2_get_unmapped_area,
+#endif
};