]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - include/media/v4l2-subdev.h
[media] v4l: Make v4l2_subdev inherit from media_entity
[mirror_ubuntu-bionic-kernel.git] / include / media / v4l2-subdev.h
index 0f9937be53d23c27c8161c8484861046d560b6f1..6f51ce4d7ee7570a2612b6f063f0eaf304341767 100644 (file)
@@ -21,6 +21,7 @@
 #ifndef _V4L2_SUBDEV_H
 #define _V4L2_SUBDEV_H
 
+#include <media/media-entity.h>
 #include <media/v4l2-common.h>
 #include <media/v4l2-dev.h>
 #include <media/v4l2-mediabus.h>
@@ -450,6 +451,9 @@ struct v4l2_subdev_internal_ops {
    stand-alone or embedded in a larger struct.
  */
 struct v4l2_subdev {
+#if defined(CONFIG_MEDIA_CONTROLLER)
+       struct media_entity entity;
+#endif
        struct list_head list;
        struct module *owner;
        u32 flags;
@@ -472,6 +476,8 @@ struct v4l2_subdev {
        unsigned int nevents;
 };
 
+#define media_entity_to_v4l2_subdev(ent) \
+       container_of(ent, struct v4l2_subdev, entity)
 #define vdev_to_v4l2_subdev(vdev) \
        container_of(vdev, struct v4l2_subdev, devnode)