diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2009-12-09 06:40:05 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-22 03:53:18 -0400 |
commit | 95db3a60e0652a52df145aacade1a88c5acef659 (patch) | |
tree | 7b8a14a964684ecd49667125e5429360e41c11d5 /include/media | |
parent | e02188c90f6ef61f0844c42508fe603c5d4fa42b (diff) |
[media] v4l: Add a media_device pointer to the v4l2_device structure
The pointer will later be used to register/unregister media entities
when registering/unregistering a v4l2_subdev or a video_device.
With the introduction of media devices, device drivers need to store a
pointer to a driver-specific structure in the device's drvdata.
v4l2_device can't claim ownership of the drvdata anymore.
To maintain compatibility with drivers that rely on v4l2_device storing
a pointer to itself in the device's drvdata, v4l2_device_register() will
keep doing so if the drvdata is NULL.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/v4l2-device.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/media/v4l2-device.h b/include/media/v4l2-device.h index 78b11e5a6db7..0c2bd3075038 100644 --- a/include/media/v4l2-device.h +++ b/include/media/v4l2-device.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #ifndef _V4L2_DEVICE_H | 21 | #ifndef _V4L2_DEVICE_H |
22 | #define _V4L2_DEVICE_H | 22 | #define _V4L2_DEVICE_H |
23 | 23 | ||
24 | #include <media/media-device.h> | ||
24 | #include <media/v4l2-subdev.h> | 25 | #include <media/v4l2-subdev.h> |
25 | 26 | ||
26 | /* Each instance of a V4L2 device should create the v4l2_device struct, | 27 | /* Each instance of a V4L2 device should create the v4l2_device struct, |
@@ -39,6 +40,9 @@ struct v4l2_device { | |||
39 | Note: dev might be NULL if there is no parent device | 40 | Note: dev might be NULL if there is no parent device |
40 | as is the case with e.g. ISA devices. */ | 41 | as is the case with e.g. ISA devices. */ |
41 | struct device *dev; | 42 | struct device *dev; |
43 | #if defined(CONFIG_MEDIA_CONTROLLER) | ||
44 | struct media_device *mdev; | ||
45 | #endif | ||
42 | /* used to keep track of the registered subdevs */ | 46 | /* used to keep track of the registered subdevs */ |
43 | struct list_head subdevs; | 47 | struct list_head subdevs; |
44 | /* lock this struct; can be used by the driver as well if this | 48 | /* lock this struct; can be used by the driver as well if this |