From: laurent.pinchart@ideasonboard.com
To: linux-media@vger.kernel.org
Cc: sakari.ailus@maxwell.research.nokia.com, hverkuil@xs4all.nl,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Subject: [RFC/PATCH 13/14] uvcvideo: Register a v4l2_device
Date: Tue, 20 Oct 2009 03:12:23 +0200 [thread overview]
Message-ID: <20091020011215.937017164@ideasonboard.com> (raw)
In-Reply-To: 20091020011210.623421213@ideasonboard.com
[-- Attachment #1: uvc-v4l2-device.diff --]
[-- Type: text/plain, Size: 2291 bytes --]
As a first step to the media controller integration register a
v4l2_device for each UVC control interface and make the video_device a
child of the v4l2_device.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Index: v4l-dvb-mc/linux/drivers/media/video/uvc/uvc_driver.c
===================================================================
--- v4l-dvb-mc.orig/linux/drivers/media/video/uvc/uvc_driver.c
+++ v4l-dvb-mc/linux/drivers/media/video/uvc/uvc_driver.c
@@ -1544,6 +1544,9 @@ static void uvc_delete(struct uvc_device
uvc_status_cleanup(dev);
uvc_ctrl_cleanup_device(dev);
+ if (dev->vdev.name[0])
+ v4l2_device_unregister(&dev->vdev);
+
list_for_each_safe(p, n, &dev->chains) {
struct uvc_video_chain *chain;
chain = list_entry(p, struct uvc_video_chain, list);
@@ -1641,7 +1644,7 @@ static int uvc_register_video(struct uvc
* unregistered before the reference is released, so we don't need to
* get another one.
*/
- vdev->parent = &dev->intf->dev;
+ vdev->entity.parent = &dev->vdev;
vdev->minor = -1;
vdev->fops = &uvc_fops;
vdev->release = uvc_release;
@@ -1772,6 +1775,10 @@ static int uvc_probe(struct usb_interfac
"linux-uvc-devel mailing list.\n");
}
+ /* Register the V4L2 device. */
+ if (v4l2_device_register(&intf->dev, &dev->vdev) < 0)
+ goto error;
+
/* Initialize controls. */
if (uvc_ctrl_init_device(dev) < 0)
goto error;
@@ -1780,7 +1787,7 @@ static int uvc_probe(struct usb_interfac
if (uvc_scan_device(dev) < 0)
goto error;
- /* Register video devices. */
+ /* Register video device nodes. */
if (uvc_register_chains(dev) < 0)
goto error;
Index: v4l-dvb-mc/linux/drivers/media/video/uvc/uvcvideo.h
===================================================================
--- v4l-dvb-mc.orig/linux/drivers/media/video/uvc/uvcvideo.h
+++ v4l-dvb-mc/linux/drivers/media/video/uvc/uvcvideo.h
@@ -68,6 +68,7 @@ struct uvc_xu_control {
#include <linux/poll.h>
#include <linux/usb/video.h>
+#include <media/v4l2-device.h>
#include "compat.h"
/* --------------------------------------------------------------------------
@@ -476,6 +477,7 @@ struct uvc_device {
atomic_t users;
/* Video control interface */
+ struct v4l2_device vdev;
__u16 uvc_version;
__u32 clock_frequency;
next prev parent reply other threads:[~2009-10-20 8:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-20 1:12 [RFC/PATCH 00/14] Media controller update based on Hans' v4l-dvb-mc tree laurent.pinchart
2009-10-20 1:12 ` [RFC/PATCH 01/14] v4l-mc: Rename pins to pads laurent.pinchart
2009-10-20 1:12 ` [RFC/PATCH 02/14] v4l-mc: Merge input and output pads laurent.pinchart
2009-10-20 1:12 ` [RFC/PATCH 03/14] v4l-mc: Replace the active pads bitmask by a link flag laurent.pinchart
2009-10-20 1:12 ` [RFC/PATCH 04/14] v4l-subdev: Add pads operations laurent.pinchart
2009-10-20 1:12 ` [RFC/PATCH 05/14] v4l-mc: Clean up link API laurent.pinchart
2009-10-20 1:12 ` [RFC/PATCH 06/14] v4l-mc: Remove subdev v4l2_dev field laurent.pinchart
2009-10-20 1:12 ` [RFC/PATCH 07/14] v4l-mc: Remove devnode " laurent.pinchart
2009-10-20 1:12 ` [RFC/PATCH 08/14] uvcvideo: Rely on videodev to reference-count the device laurent.pinchart
2009-10-20 1:12 ` [RFC/PATCH 09/14] uvcvideo: Merge iterms, oterms and extensions linked lists laurent.pinchart
2009-10-20 1:12 ` [RFC/PATCH 10/14] uvcvideo: Fix extension units parsing laurent.pinchart
2009-10-20 1:12 ` [RFC/PATCH 11/14] uvcvideo: Refactor chain scan laurent.pinchart
2009-10-20 1:12 ` [RFC/PATCH 12/14] uvcvideo: Factorize common field in uvc_entity structure laurent.pinchart
2009-10-20 1:12 ` laurent.pinchart [this message]
2009-10-20 1:12 ` [RFC/PATCH 14/14] uvcvideo: Register subdevices for each entity laurent.pinchart
2009-10-20 22:15 ` [RFC/PATCH 00/14] Media controller update based on Hans' v4l-dvb-mc tree Hans Verkuil
2009-10-20 22:32 ` Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091020011215.937017164@ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@maxwell.research.nokia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.