Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a83c16e authored by Andrzej Pietrasiewicz's avatar Andrzej Pietrasiewicz Committed by Felipe Balbi
Browse files

usb: gadget: uvc: separately compile some components of f_uvc



Compile uvc_queue, uvc_v4l2, uvc_video separately so that later they can
be all combined in a separately compiled f_uvc.

Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Tested-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
[Make uvc_v4l2_ioctl_ops non-static]
[Rename __UVC__V4L2__H__ and __UVC__VIDEO__H__]
[Update MAINTAINERS]
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 7ea95b11
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -9669,7 +9669,7 @@ USB WEBCAM GADGET
M:	Laurent Pinchart <laurent.pinchart@ideasonboard.com>
L:	linux-usb@vger.kernel.org
S:	Maintained
F:	drivers/usb/gadget/function/*uvc*.c
F:	drivers/usb/gadget/function/*uvc*
F:	drivers/usb/gadget/legacy/webcam.c

USB WIRELESS RNDIS DRIVER (rndis_wlan)
+2 −0
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@
#include <media/v4l2-event.h>

#include "uvc.h"
#include "uvc_v4l2.h"
#include "uvc_video.h"

unsigned int uvc_gadget_trace_param;
static unsigned int streaming_interval;
+8 −0
Original line number Diff line number Diff line
@@ -16,6 +16,14 @@
#include <linux/usb/composite.h>
#include <linux/usb/video.h>

#include "uvc.h"

void uvc_function_setup_continue(struct uvc_device *uvc);

void uvc_function_connect(struct uvc_device *uvc);

void uvc_function_disconnect(struct uvc_device *uvc);

int uvc_bind_config(struct usb_configuration *c,
		    const struct uvc_descriptor_header * const *fs_control,
		    const struct uvc_descriptor_header * const *hs_control,
+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ struct uvc_event
#ifdef __KERNEL__

#include <linux/usb.h>	/* For usb_endpoint_* */
#include <linux/usb/composite.h>
#include <linux/usb/gadget.h>
#include <linux/videodev2.h>
#include <linux/version.h>
+17 −22
Original line number Diff line number Diff line
@@ -126,8 +126,7 @@ static struct vb2_ops uvc_queue_qops = {
	.wait_finish = uvc_wait_finish,
};

static int uvcg_queue_init(struct uvc_video_queue *queue,
			   enum v4l2_buf_type type)
int uvcg_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type)
{
	int ret;

@@ -154,7 +153,7 @@ static int uvcg_queue_init(struct uvc_video_queue *queue,
/*
 * Free the video buffers.
 */
static void uvcg_free_buffers(struct uvc_video_queue *queue)
void uvcg_free_buffers(struct uvc_video_queue *queue)
{
	mutex_lock(&queue->mutex);
	vb2_queue_release(&queue->queue);
@@ -164,7 +163,7 @@ static void uvcg_free_buffers(struct uvc_video_queue *queue)
/*
 * Allocate the video buffers.
 */
static int uvcg_alloc_buffers(struct uvc_video_queue *queue,
int uvcg_alloc_buffers(struct uvc_video_queue *queue,
			      struct v4l2_requestbuffers *rb)
{
	int ret;
@@ -176,8 +175,7 @@ static int uvcg_alloc_buffers(struct uvc_video_queue *queue,
	return ret ? ret : rb->count;
}

static int uvcg_query_buffer(struct uvc_video_queue *queue,
			     struct v4l2_buffer *buf)
int uvcg_query_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf)
{
	int ret;

@@ -188,8 +186,7 @@ static int uvcg_query_buffer(struct uvc_video_queue *queue,
	return ret;
}

static int uvcg_queue_buffer(struct uvc_video_queue *queue,
			     struct v4l2_buffer *buf)
int uvcg_queue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf)
{
	unsigned long flags;
	int ret;
@@ -213,8 +210,8 @@ done:
 * Dequeue a video buffer. If nonblocking is false, block until a buffer is
 * available.
 */
static int uvcg_dequeue_buffer(struct uvc_video_queue *queue,
			       struct v4l2_buffer *buf, int nonblocking)
int uvcg_dequeue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf,
			int nonblocking)
{
	int ret;

@@ -231,8 +228,8 @@ static int uvcg_dequeue_buffer(struct uvc_video_queue *queue,
 * This function implements video queue polling and is intended to be used by
 * the device poll handler.
 */
static unsigned int uvcg_queue_poll(struct uvc_video_queue *queue,
				    struct file *file, poll_table *wait)
unsigned int uvcg_queue_poll(struct uvc_video_queue *queue, struct file *file,
			     poll_table *wait)
{
	unsigned int ret;

@@ -243,8 +240,7 @@ static unsigned int uvcg_queue_poll(struct uvc_video_queue *queue,
	return ret;
}

static int uvcg_queue_mmap(struct uvc_video_queue *queue,
			   struct vm_area_struct *vma)
int uvcg_queue_mmap(struct uvc_video_queue *queue, struct vm_area_struct *vma)
{
	int ret;

@@ -261,8 +257,7 @@ static int uvcg_queue_mmap(struct uvc_video_queue *queue,
 *
 * NO-MMU arch need this function to make mmap() work correctly.
 */
static unsigned long uvcg_queue_get_unmapped_area(
				struct uvc_video_queue *queue,
unsigned long uvcg_queue_get_unmapped_area(struct uvc_video_queue *queue,
					   unsigned long pgoff)
{
	unsigned long ret;
@@ -286,7 +281,7 @@ static unsigned long uvcg_queue_get_unmapped_area(
 * This function acquires the irq spinlock and can be called from interrupt
 * context.
 */
static void uvcg_queue_cancel(struct uvc_video_queue *queue, int disconnect)
void uvcg_queue_cancel(struct uvc_video_queue *queue, int disconnect)
{
	struct uvc_buffer *buf;
	unsigned long flags;
@@ -327,7 +322,7 @@ static void uvcg_queue_cancel(struct uvc_video_queue *queue, int disconnect)
 * This function can't be called from interrupt context. Use
 * uvcg_queue_cancel() instead.
 */
static int uvcg_queue_enable(struct uvc_video_queue *queue, int enable)
int uvcg_queue_enable(struct uvc_video_queue *queue, int enable)
{
	unsigned long flags;
	int ret = 0;
@@ -364,7 +359,7 @@ done:
}

/* called with &queue_irqlock held.. */
static struct uvc_buffer *uvcg_queue_next_buffer(struct uvc_video_queue *queue,
struct uvc_buffer *uvcg_queue_next_buffer(struct uvc_video_queue *queue,
					  struct uvc_buffer *buf)
{
	struct uvc_buffer *nextbuf;
@@ -393,7 +388,7 @@ static struct uvc_buffer *uvcg_queue_next_buffer(struct uvc_video_queue *queue,
	return nextbuf;
}

static struct uvc_buffer *uvcg_queue_head(struct uvc_video_queue *queue)
struct uvc_buffer *uvcg_queue_head(struct uvc_video_queue *queue)
{
	struct uvc_buffer *buf = NULL;

Loading