public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] V4L patches for OMAP 3 camera and ISP drivers
@ 2009-02-27 16:29 Sakari Ailus
  2009-02-27 16:31 ` [PATCH 1/4] V4L: Int if: v4l2_int_device_try_attach_all requires mutex Sakari Ailus
  0 siblings, 1 reply; 5+ messages in thread
From: Sakari Ailus @ 2009-02-27 16:29 UTC (permalink / raw)
  To: linux-media@vger.kernel.org
  Cc: Aguirre Rodriguez, Sergio Alberto, v4l, Tuukka.O Toivonen,
	David Cohen, Koskipää Antti Jussi Petteri

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,

-- 
Sakari Ailus
sakari.ailus@maxwell.research.nokia.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/4] V4L: Int if: v4l2_int_device_try_attach_all requires mutex
  2009-02-27 16:29 [PATCH 0/4] V4L patches for OMAP 3 camera and ISP drivers Sakari Ailus
@ 2009-02-27 16:31 ` Sakari Ailus
  2009-02-27 16:31   ` [PATCH 2/4] V4L: Int if: Dummy slave Sakari Ailus
  0 siblings, 1 reply; 5+ messages in thread
From: Sakari Ailus @ 2009-02-27 16:31 UTC (permalink / raw)
  To: linux-media
  Cc: video4linux-list, tuukka.o.toivonen, saaguirre, antti.koskipaa,
	david.cohen, Sakari Ailus

From: Sakari Ailus <sakari.ailus@nokia.com>

Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
---
 drivers/media/video/v4l2-int-device.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/v4l2-int-device.c b/drivers/media/video/v4l2-int-device.c
index a935bae..eb8dc84 100644
--- a/drivers/media/video/v4l2-int-device.c
+++ b/drivers/media/video/v4l2-int-device.c
@@ -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;
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] V4L: Int if: Dummy slave
  2009-02-27 16:31 ` [PATCH 1/4] V4L: Int if: v4l2_int_device_try_attach_all requires mutex Sakari Ailus
@ 2009-02-27 16:31   ` Sakari Ailus
  2009-02-27 16:31     ` [PATCH 3/4] V4L: int device: add support for VIDIOC_QUERYMENU Sakari Ailus
  0 siblings, 1 reply; 5+ messages in thread
From: Sakari Ailus @ 2009-02-27 16:31 UTC (permalink / raw)
  To: linux-media
  Cc: video4linux-list, tuukka.o.toivonen, saaguirre, antti.koskipaa,
	david.cohen, Sakari Ailus

From: Sakari Ailus <sakari.ailus@nokia.com>

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.

Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
---
 drivers/media/video/v4l2-int-device.c |   19 +++++++++++++++++++
 include/media/v4l2-int-device.h       |    2 ++
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/v4l2-int-device.c b/drivers/media/video/v4l2-int-device.c
index eb8dc84..483ee2e 100644
--- a/drivers/media/video/v4l2-int-device.c
+++ b/drivers/media/video/v4l2-int-device.c
@@ -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);
diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h
index fbf5855..5d254c4 100644
--- a/include/media/v4l2-int-device.h
+++ b/include/media/v4l2-int-device.h
@@ -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);
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] V4L: int device: add support for VIDIOC_QUERYMENU
  2009-02-27 16:31   ` [PATCH 2/4] V4L: Int if: Dummy slave Sakari Ailus
@ 2009-02-27 16:31     ` Sakari Ailus
  2009-02-27 16:31       ` [PATCH 4/4] V4L: Int if: Add vidioc_int_querycap Sakari Ailus
  0 siblings, 1 reply; 5+ messages in thread
From: Sakari Ailus @ 2009-02-27 16:31 UTC (permalink / raw)
  To: linux-media
  Cc: video4linux-list, tuukka.o.toivonen, saaguirre, antti.koskipaa,
	david.cohen, Sakari Ailus

From: Sakari Ailus <sakari.ailus@nokia.com>

Signed-off-by: Tuukka Toivonen <tuukka.o.toivonen@nokia.com>
---
 include/media/v4l2-int-device.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h
index 5d254c4..81f4863 100644
--- a/include/media/v4l2-int-device.h
+++ b/include/media/v4l2-int-device.h
@@ -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, *);
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] V4L: Int if: Add vidioc_int_querycap
  2009-02-27 16:31     ` [PATCH 3/4] V4L: int device: add support for VIDIOC_QUERYMENU Sakari Ailus
@ 2009-02-27 16:31       ` Sakari Ailus
  0 siblings, 0 replies; 5+ messages in thread
From: Sakari Ailus @ 2009-02-27 16:31 UTC (permalink / raw)
  To: linux-media
  Cc: video4linux-list, tuukka.o.toivonen, saaguirre, antti.koskipaa,
	david.cohen, Sakari Ailus

From: Sakari Ailus <sakari.ailus@nokia.com>

Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
---
 include/media/v4l2-int-device.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h
index 81f4863..2830ae1 100644
--- a/include/media/v4l2-int-device.h
+++ b/include/media/v4l2-int-device.h
@@ -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, *);
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-02-27 16:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-27 16:29 [PATCH 0/4] V4L patches for OMAP 3 camera and ISP drivers Sakari Ailus
2009-02-27 16:31 ` [PATCH 1/4] V4L: Int if: v4l2_int_device_try_attach_all requires mutex Sakari Ailus
2009-02-27 16:31   ` [PATCH 2/4] V4L: Int if: Dummy slave Sakari Ailus
2009-02-27 16:31     ` [PATCH 3/4] V4L: int device: add support for VIDIOC_QUERYMENU Sakari Ailus
2009-02-27 16:31       ` [PATCH 4/4] V4L: Int if: Add vidioc_int_querycap Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox