aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/v4l2-subdev.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/media/v4l2-subdev.h')
-rw-r--r--include/media/v4l2-subdev.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index b0316a7cf08..daf1e57d9b2 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -106,10 +106,7 @@ struct v4l2_subdev_io_pin_config {
106 u8 strength; /* Pin drive strength */ 106 u8 strength; /* Pin drive strength */
107}; 107};
108 108
109/* s_config: if set, then it is always called by the v4l2_i2c_new_subdev* 109/*
110 functions after the v4l2_subdev was registered. It is used to pass
111 platform data to the subdev which can be used during initialization.
112
113 s_io_pin_config: configure one or more chip I/O pins for chips that 110 s_io_pin_config: configure one or more chip I/O pins for chips that
114 multiplex different internal signal pads out to IO pins. This function 111 multiplex different internal signal pads out to IO pins. This function
115 takes a pointer to an array of 'n' pin configuration entries, one for 112 takes a pointer to an array of 'n' pin configuration entries, one for
@@ -141,7 +138,6 @@ struct v4l2_subdev_io_pin_config {
141struct v4l2_subdev_core_ops { 138struct v4l2_subdev_core_ops {
142 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); 139 int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip);
143 int (*log_status)(struct v4l2_subdev *sd); 140 int (*log_status)(struct v4l2_subdev *sd);
144 int (*s_config)(struct v4l2_subdev *sd, int irq, void *platform_data);
145 int (*s_io_pin_config)(struct v4l2_subdev *sd, size_t n, 141 int (*s_io_pin_config)(struct v4l2_subdev *sd, size_t n,
146 struct v4l2_subdev_io_pin_config *pincfg); 142 struct v4l2_subdev_io_pin_config *pincfg);
147 int (*init)(struct v4l2_subdev *sd, u32 val); 143 int (*init)(struct v4l2_subdev *sd, u32 val);
@@ -415,6 +411,21 @@ struct v4l2_subdev_ops {
415 const struct v4l2_subdev_sensor_ops *sensor; 411 const struct v4l2_subdev_sensor_ops *sensor;
416}; 412};
417 413
414/*
415 * Internal ops. Never call this from drivers, only the v4l2 framework can call
416 * these ops.
417 *
418 * registered: called when this subdev is registered. When called the v4l2_dev
419 * field is set to the correct v4l2_device.
420 *
421 * unregistered: called when this subdev is unregistered. When called the
422 * v4l2_dev field is still set to the correct v4l2_device.
423 */
424struct v4l2_subdev_internal_ops {
425 int (*registered)(struct v4l2_subdev *sd);
426 void (*unregistered)(struct v4l2_subdev *sd);
427};
428
418#define V4L2_SUBDEV_NAME_SIZE 32 429#define V4L2_SUBDEV_NAME_SIZE 32
419 430
420/* Set this flag if this subdev is a i2c device. */ 431/* Set this flag if this subdev is a i2c device. */
@@ -431,6 +442,8 @@ struct v4l2_subdev {
431 u32 flags; 442 u32 flags;
432 struct v4l2_device *v4l2_dev; 443 struct v4l2_device *v4l2_dev;
433 const struct v4l2_subdev_ops *ops; 444 const struct v4l2_subdev_ops *ops;
445 /* Never call these internal ops from within a driver! */
446 const struct v4l2_subdev_internal_ops *internal_ops;
434 /* The control handler of this subdev. May be NULL. */ 447 /* The control handler of this subdev. May be NULL. */
435 struct v4l2_ctrl_handler *ctrl_handler; 448 struct v4l2_ctrl_handler *ctrl_handler;
436 /* name must be unique */ 449 /* name must be unique */