Skip to contentSkip to conversation

V4L patches for OMAP 3 camera and ISP drivers

PATCH New Sakari Ailus 1 participant 5 messages Feb 27, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

cover V4L patches for OMAP 3 camera and ISP drivers

Hello,

Here's a small set of V4L int device patches to support the OMAP 3 camera. These patches are on top of linux-omap but can be applied to v4l-dvb, too.

I'll post the corresponding OMAP 3 camera and ISP driver patches in near future.

Regards,

Signature · 2 lines
Sakari Ailus
[email protected]
#2 lore raw

PATCH 2/4 V4L: Int if: Dummy slave

In reply to Sakari Ailus

From: Sakari Ailus <[email protected]>

This patch implements a dummy slave that has no functionality. Helps managing slaves in the OMAP 3 camera driver; no need to check for NULL pointers.

---
 drivers/media/video/v4l2-int-device.c |   19 +++++++++++++++++++
 include/media/v4l2-int-device.h       |    2 ++
 2 files changed, 21 insertions(+), 0 deletions(-)
drivers/media/video/v4l2-int-device.c +19 -0
index eb8dc84..483ee2e 100644
@@ -67,6 +67,25 @@ static void __v4l2_int_device_try_attach_all(void)
 	}
 }
 
+static struct v4l2_int_slave dummy_slave = {
+	/* Dummy pointer to avoid underflow in find_ioctl. */
+	.ioctls = (void *)sizeof(struct v4l2_int_ioctl_desc),
+	.num_ioctls = 0,
+};
+
+static struct v4l2_int_device dummy = {
+	.type = v4l2_int_type_slave,
+	.u = {
+		.slave = &dummy_slave,
+	},
+};
+
+struct v4l2_int_device *v4l2_int_device_dummy()
+{
+	return &dummy;
+}
+EXPORT_SYMBOL_GPL(v4l2_int_device_dummy);
+
 void v4l2_int_device_try_attach_all(void)
 {
 	mutex_lock(&mutex);
include/media/v4l2-int-device.h +2 -0
index fbf5855..5d254c4 100644
@@ -84,6 +84,8 @@ struct v4l2_int_device {
 	void *priv;
 };
 
+struct v4l2_int_device *v4l2_int_device_dummy(void);
+
 void v4l2_int_device_try_attach_all(void);
 
 int v4l2_int_device_register(struct v4l2_int_device *d);
Signature · 1 line
1.5.6.5
#3 lore raw

PATCH 3/4 V4L: int device: add support for VIDIOC_QUERYMENU

From: Sakari Ailus <[email protected]>

---
 include/media/v4l2-int-device.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
include/media/v4l2-int-device.h +2 -0
index 5d254c4..81f4863 100644
@@ -178,6 +178,7 @@ enum v4l2_int_ioctl_num {
 	vidioc_int_s_fmt_cap_num,
 	vidioc_int_try_fmt_cap_num,
 	vidioc_int_queryctrl_num,
+	vidioc_int_querymenu_num,
 	vidioc_int_g_ctrl_num,
 	vidioc_int_s_ctrl_num,
 	vidioc_int_cropcap_num,
@@ -282,6 +283,7 @@ V4L2_INT_WRAPPER_1(g_fmt_cap, struct v4l2_format, *);
 V4L2_INT_WRAPPER_1(s_fmt_cap, struct v4l2_format, *);
 V4L2_INT_WRAPPER_1(try_fmt_cap, struct v4l2_format, *);
 V4L2_INT_WRAPPER_1(queryctrl, struct v4l2_queryctrl, *);
+V4L2_INT_WRAPPER_1(querymenu, struct v4l2_querymenu, *);
 V4L2_INT_WRAPPER_1(g_ctrl, struct v4l2_control, *);
 V4L2_INT_WRAPPER_1(s_ctrl, struct v4l2_control, *);
 V4L2_INT_WRAPPER_1(cropcap, struct v4l2_cropcap, *);
Signature · 1 line
1.5.6.5
#4 lore raw

PATCH 4/4 V4L: Int if: Add vidioc_int_querycap

From: Sakari Ailus <[email protected]>

---
 include/media/v4l2-int-device.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
include/media/v4l2-int-device.h +3 -1
index 81f4863..2830ae1 100644
@@ -173,7 +173,8 @@ enum v4l2_int_ioctl_num {
 	 * "Proper" V4L ioctls, as in struct video_device.
 	 *
 	 */
-	vidioc_int_enum_fmt_cap_num = 1,
+	vidioc_int_querycap_num = 1,
+	vidioc_int_enum_fmt_cap_num,
 	vidioc_int_g_fmt_cap_num,
 	vidioc_int_s_fmt_cap_num,
 	vidioc_int_try_fmt_cap_num,
@@ -278,6 +279,7 @@ enum v4l2_int_ioctl_num {
 		return desc;						\
 	}
 
+V4L2_INT_WRAPPER_1(querycap, struct v4l2_capability, *);
 V4L2_INT_WRAPPER_1(enum_fmt_cap, struct v4l2_fmtdesc, *);
 V4L2_INT_WRAPPER_1(g_fmt_cap, struct v4l2_format, *);
 V4L2_INT_WRAPPER_1(s_fmt_cap, struct v4l2_format, *);
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 1/4 V4L: Int if: v4l2_int_device_try_attach_all requires mutex

In reply to Sakari Ailus

From: Sakari Ailus <[email protected]>

---
 drivers/media/video/v4l2-int-device.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
drivers/media/video/v4l2-int-device.c +10 -2
index a935bae..eb8dc84 100644
@@ -32,7 +32,7 @@
 static DEFINE_MUTEX(mutex);
 static LIST_HEAD(int_list);
 
-void v4l2_int_device_try_attach_all(void)
+static void __v4l2_int_device_try_attach_all(void)
 {
 	struct v4l2_int_device *m, *s;
 
@@ -66,6 +66,14 @@ void v4l2_int_device_try_attach_all(void)
 		}
 	}
 }
+
+void v4l2_int_device_try_attach_all(void)
+{
+	mutex_lock(&mutex);
+	__v4l2_int_device_try_attach_all();
+	mutex_unlock(&mutex);
+}
+
 EXPORT_SYMBOL_GPL(v4l2_int_device_try_attach_all);
 
 static int ioctl_sort_cmp(const void *a, const void *b)
@@ -89,7 +97,7 @@ int v4l2_int_device_register(struct v4l2_int_device *d)
 		     &ioctl_sort_cmp, NULL);
 	mutex_lock(&mutex);
 	list_add(&d->head, &int_list);
-	v4l2_int_device_try_attach_all();
+	__v4l2_int_device_try_attach_all();
 	mutex_unlock(&mutex);
 
 	return 0;
Signature · 1 line
1.5.6.5