diff options
Diffstat (limited to 'include/media/v4l2-subdev.h')
-rw-r--r-- | include/media/v4l2-subdev.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 17856081c809..5dcb36785529 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -79,7 +79,11 @@ struct v4l2_decode_vbi_line { | |||
79 | not yet implemented) since ops provide proper type-checking. | 79 | not yet implemented) since ops provide proper type-checking. |
80 | */ | 80 | */ |
81 | 81 | ||
82 | /* init: initialize the sensor registors to some sort of reasonable default | 82 | /* s_config: if set, then it is always called by the v4l2_i2c_new_subdev* |
83 | functions after the v4l2_subdev was registered. It is used to pass | ||
84 | platform data to the subdev which can be used during initialization. | ||
85 | |||
86 | init: initialize the sensor registors to some sort of reasonable default | ||
83 | values. Do not use for new drivers and should be removed in existing | 87 | values. Do not use for new drivers and should be removed in existing |
84 | drivers. | 88 | drivers. |
85 | 89 | ||
@@ -96,6 +100,7 @@ struct v4l2_decode_vbi_line { | |||
96 | struct v4l2_subdev_core_ops { | 100 | struct v4l2_subdev_core_ops { |
97 | int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); | 101 | int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); |
98 | int (*log_status)(struct v4l2_subdev *sd); | 102 | int (*log_status)(struct v4l2_subdev *sd); |
103 | int (*s_config)(struct v4l2_subdev *sd, int irq, void *platform_data); | ||
99 | int (*init)(struct v4l2_subdev *sd, u32 val); | 104 | int (*init)(struct v4l2_subdev *sd, u32 val); |
100 | int (*load_fw)(struct v4l2_subdev *sd); | 105 | int (*load_fw)(struct v4l2_subdev *sd); |
101 | int (*reset)(struct v4l2_subdev *sd, u32 val); | 106 | int (*reset)(struct v4l2_subdev *sd, u32 val); |
@@ -230,12 +235,16 @@ struct v4l2_subdev_ops { | |||
230 | 235 | ||
231 | #define V4L2_SUBDEV_NAME_SIZE 32 | 236 | #define V4L2_SUBDEV_NAME_SIZE 32 |
232 | 237 | ||
238 | /* Set this flag if this subdev is a i2c device. */ | ||
239 | #define V4L2_SUBDEV_FL_IS_I2C (1U << 0) | ||
240 | |||
233 | /* Each instance of a subdev driver should create this struct, either | 241 | /* Each instance of a subdev driver should create this struct, either |
234 | stand-alone or embedded in a larger struct. | 242 | stand-alone or embedded in a larger struct. |
235 | */ | 243 | */ |
236 | struct v4l2_subdev { | 244 | struct v4l2_subdev { |
237 | struct list_head list; | 245 | struct list_head list; |
238 | struct module *owner; | 246 | struct module *owner; |
247 | u32 flags; | ||
239 | struct v4l2_device *v4l2_dev; | 248 | struct v4l2_device *v4l2_dev; |
240 | const struct v4l2_subdev_ops *ops; | 249 | const struct v4l2_subdev_ops *ops; |
241 | /* name must be unique */ | 250 | /* name must be unique */ |
@@ -264,6 +273,7 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd, | |||
264 | BUG_ON(!ops || !ops->core); | 273 | BUG_ON(!ops || !ops->core); |
265 | sd->ops = ops; | 274 | sd->ops = ops; |
266 | sd->v4l2_dev = NULL; | 275 | sd->v4l2_dev = NULL; |
276 | sd->flags = 0; | ||
267 | sd->name[0] = '\0'; | 277 | sd->name[0] = '\0'; |
268 | sd->grp_id = 0; | 278 | sd->grp_id = 0; |
269 | sd->priv = NULL; | 279 | sd->priv = NULL; |