Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364788
b: refs/heads/master
c: 2f1d570
h: refs/heads/master
v: v3
  • Loading branch information
Bhupesh Sharma authored and Felipe Balbi committed Apr 2, 2013
1 parent 1e888d6 commit 7173d23
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d692522577c051058efbe9e3c8aef68a4c36e4f7
refs/heads/master: 2f1d57069338b14fcf4765ae2c25fc377da45b1f
18 changes: 18 additions & 0 deletions trunk/drivers/usb/gadget/uvc_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,24 @@ static int uvc_queue_mmap(struct uvc_video_queue *queue,
return ret;
}

#ifndef CONFIG_MMU
/*
* Get unmapped area.
*
* NO-MMU arch need this function to make mmap() work correctly.
*/
static unsigned long uvc_queue_get_unmapped_area(struct uvc_video_queue *queue,
unsigned long pgoff)
{
unsigned long ret;

mutex_lock(&queue->mutex);
ret = vb2_get_unmapped_area(&queue->queue, 0, 0, pgoff, 0);
mutex_unlock(&queue->mutex);
return ret;
}
#endif

/*
* Cancel the video buffers queue.
*
Expand Down
15 changes: 15 additions & 0 deletions trunk/drivers/usb/gadget/uvc_v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,27 @@ 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,
.release = uvc_v4l2_release,
.ioctl = uvc_v4l2_ioctl,
.mmap = uvc_v4l2_mmap,
.poll = uvc_v4l2_poll,
#ifndef CONFIG_MMU
.get_unmapped_area = uvc_v4l2_get_unmapped_area,
#endif
};

0 comments on commit 7173d23

Please sign in to comment.