summaryrefslogtreecommitdiffstats
path: root/include/media/v4l2-subdev.h
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2013-01-08 11:06:31 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-21 21:30:00 +0200
commite9e310491bdbc8c0f33ea0e2ce65eff345a01f71 (patch)
treec1ada792f3d31542ff8038d140de3232035d41a6 /include/media/v4l2-subdev.h
parent[media] V4L2: add a device pointer to struct v4l2_subdev (diff)
downloadlinux-e9e310491bdbc8c0f33ea0e2ce65eff345a01f71.tar.xz
linux-e9e310491bdbc8c0f33ea0e2ce65eff345a01f71.zip
[media] V4L2: support asynchronous subdevice registration
Currently bridge device drivers register devices for all subdevices synchronously, typically, during their probing. E.g. if an I2C CMOS sensor is attached to a video bridge device, the bridge driver will create an I2C device and wait for the respective I2C driver to probe. This makes linking of devices straight forward, but this approach cannot be used with intrinsically asynchronous and unordered device registration systems like the Flattened Device Tree. To support such systems this patch adds an asynchronous subdevice registration framework to V4L2. To use it respective (e.g. I2C) subdevice drivers must register themselves with the framework. A bridge driver on the other hand must register notification callbacks, that will be called upon various related events. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media/v4l2-subdev.h')
-rw-r--r--include/media/v4l2-subdev.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 5fbb266405f9..3250cc5e7925 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -24,6 +24,7 @@
#include <linux/types.h>
#include <linux/v4l2-subdev.h>
#include <media/media-entity.h>
+#include <media/v4l2-async.h>
#include <media/v4l2-common.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-fh.h>
@@ -585,8 +586,15 @@ struct v4l2_subdev {
struct video_device *devnode;
/* pointer to the physical device, if any */
struct device *dev;
+ struct v4l2_async_subdev_list asdl;
};
+static inline struct v4l2_subdev *v4l2_async_to_subdev(
+ struct v4l2_async_subdev_list *asdl)
+{
+ return container_of(asdl, struct v4l2_subdev, asdl);
+}
+
#define media_entity_to_v4l2_subdev(ent) \
container_of(ent, struct v4l2_subdev, entity)
#define vdev_to_v4l2_subdev(vdev) \