diff options
author | Andy Walls <awalls@md.metrocast.net> | 2010-07-18 17:51:10 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-08 22:42:54 -0400 |
commit | 66752f8396f97360cafb226aa1fe230f66785c5a (patch) | |
tree | c00862b068ae1f21897538e8451bfdd97751a45d | |
parent | e9e5cf472751a16ebe80c9a47b512605e3511880 (diff) |
V4L/DVB: v4l2_subdev: Add s_io_pin_config to v4l2_subdev_core_ops
Add a method to v4l2_sudev_core_ops to allow bridge drivers to
manage what signal pads/functions are routed out to multiplexed IO pins on a
pin by pin basis. The interface also allows specifying initial output settings
for pins and disabling an IO pin altogether.
Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | include/media/v4l2-subdev.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 02c6f4d11ed3..9195ad490ee2 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -90,10 +90,31 @@ struct v4l2_decode_vbi_line { | |||
90 | not yet implemented) since ops provide proper type-checking. | 90 | not yet implemented) since ops provide proper type-checking. |
91 | */ | 91 | */ |
92 | 92 | ||
93 | /* Subdevice external IO pin configuration */ | ||
94 | #define V4L2_SUBDEV_IO_PIN_DISABLE (1 << 0) /* ENABLE assumed */ | ||
95 | #define V4L2_SUBDEV_IO_PIN_OUTPUT (1 << 1) | ||
96 | #define V4L2_SUBDEV_IO_PIN_INPUT (1 << 2) | ||
97 | #define V4L2_SUBDEV_IO_PIN_SET_VALUE (1 << 3) /* Set output value */ | ||
98 | #define V4L2_SUBDEV_IO_PIN_ACTIVE_LOW (1 << 4) /* ACTIVE HIGH assumed */ | ||
99 | |||
100 | struct v4l2_subdev_io_pin_config { | ||
101 | u32 flags; /* V4L2_SUBDEV_IO_PIN_* flags for this pin's config */ | ||
102 | u8 pin; /* Chip external IO pin to configure */ | ||
103 | u8 function; /* Internal signal pad/function to route to IO pin */ | ||
104 | u8 value; /* Initial value for pin - e.g. GPIO output value */ | ||
105 | u8 strength; /* Pin drive strength */ | ||
106 | }; | ||
107 | |||
93 | /* s_config: if set, then it is always called by the v4l2_i2c_new_subdev* | 108 | /* s_config: if set, then it is always called by the v4l2_i2c_new_subdev* |
94 | functions after the v4l2_subdev was registered. It is used to pass | 109 | functions after the v4l2_subdev was registered. It is used to pass |
95 | platform data to the subdev which can be used during initialization. | 110 | platform data to the subdev which can be used during initialization. |
96 | 111 | ||
112 | s_io_pin_config: configure one or more chip I/O pins for chips that | ||
113 | multiplex different internal signal pads out to IO pins. This function | ||
114 | takes a pointer to an array of 'n' pin configuration entries, one for | ||
115 | each pin being configured. This function could be called at times | ||
116 | other than just subdevice initialization. | ||
117 | |||
97 | init: initialize the sensor registors to some sort of reasonable default | 118 | init: initialize the sensor registors to some sort of reasonable default |
98 | values. Do not use for new drivers and should be removed in existing | 119 | values. Do not use for new drivers and should be removed in existing |
99 | drivers. | 120 | drivers. |
@@ -115,6 +136,8 @@ struct v4l2_subdev_core_ops { | |||
115 | int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); | 136 | int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); |
116 | int (*log_status)(struct v4l2_subdev *sd); | 137 | int (*log_status)(struct v4l2_subdev *sd); |
117 | int (*s_config)(struct v4l2_subdev *sd, int irq, void *platform_data); | 138 | int (*s_config)(struct v4l2_subdev *sd, int irq, void *platform_data); |
139 | int (*s_io_pin_config)(struct v4l2_subdev *sd, size_t n, | ||
140 | struct v4l2_subdev_io_pin_config *pincfg); | ||
118 | int (*init)(struct v4l2_subdev *sd, u32 val); | 141 | int (*init)(struct v4l2_subdev *sd, u32 val); |
119 | int (*load_fw)(struct v4l2_subdev *sd); | 142 | int (*load_fw)(struct v4l2_subdev *sd); |
120 | int (*reset)(struct v4l2_subdev *sd, u32 val); | 143 | int (*reset)(struct v4l2_subdev *sd, u32 val); |