]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/media/v4l2-subdev.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[karo-tx-linux.git] / include / media / v4l2-subdev.h
index 17856081c80942d6ec9f4e0e7a0d362d2c4277df..5dcb36785529152e266909526ff17f673c11cd18 100644 (file)
@@ -79,7 +79,11 @@ struct v4l2_decode_vbi_line {
    not yet implemented) since ops provide proper type-checking.
  */
 
-/* init: initialize the sensor registors to some sort of reasonable default
+/* s_config: if set, then it is always called by the v4l2_i2c_new_subdev*
+       functions after the v4l2_subdev was registered. It is used to pass
+       platform data to the subdev which can be used during initialization.
+
+   init: initialize the sensor registors to some sort of reasonable default
        values. Do not use for new drivers and should be removed in existing
        drivers.
 
@@ -96,6 +100,7 @@ struct v4l2_decode_vbi_line {
 struct v4l2_subdev_core_ops {
        int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
        int (*log_status)(struct v4l2_subdev *sd);
+       int (*s_config)(struct v4l2_subdev *sd, int irq, void *platform_data);
        int (*init)(struct v4l2_subdev *sd, u32 val);
        int (*load_fw)(struct v4l2_subdev *sd);
        int (*reset)(struct v4l2_subdev *sd, u32 val);
@@ -230,12 +235,16 @@ struct v4l2_subdev_ops {
 
 #define V4L2_SUBDEV_NAME_SIZE 32
 
+/* Set this flag if this subdev is a i2c device. */
+#define V4L2_SUBDEV_FL_IS_I2C (1U << 0)
+
 /* Each instance of a subdev driver should create this struct, either
    stand-alone or embedded in a larger struct.
  */
 struct v4l2_subdev {
        struct list_head list;
        struct module *owner;
+       u32 flags;
        struct v4l2_device *v4l2_dev;
        const struct v4l2_subdev_ops *ops;
        /* name must be unique */
@@ -264,6 +273,7 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd,
        BUG_ON(!ops || !ops->core);
        sd->ops = ops;
        sd->v4l2_dev = NULL;
+       sd->flags = 0;
        sd->name[0] = '\0';
        sd->grp_id = 0;
        sd->priv = NULL;