diff options
Diffstat (limited to 'include/media/v4l2-common.h')
-rw-r--r-- | include/media/v4l2-common.h | 54 |
1 files changed, 17 insertions, 37 deletions
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 98b32645e5a7..a298ec49ddc4 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
@@ -80,30 +80,15 @@ | |||
80 | 80 | ||
81 | /* ------------------------------------------------------------------------- */ | 81 | /* ------------------------------------------------------------------------- */ |
82 | 82 | ||
83 | /* Priority helper functions */ | ||
84 | |||
85 | struct v4l2_prio_state { | ||
86 | atomic_t prios[4]; | ||
87 | }; | ||
88 | void v4l2_prio_init(struct v4l2_prio_state *global); | ||
89 | int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local, | ||
90 | enum v4l2_priority new); | ||
91 | void v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local); | ||
92 | void v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority local); | ||
93 | enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global); | ||
94 | int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority local); | ||
95 | |||
96 | /* ------------------------------------------------------------------------- */ | ||
97 | |||
98 | /* Control helper functions */ | 83 | /* Control helper functions */ |
99 | 84 | ||
100 | int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl, | 85 | int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl, |
101 | const char **menu_items); | 86 | const char * const *menu_items); |
102 | const char *v4l2_ctrl_get_name(u32 id); | 87 | const char *v4l2_ctrl_get_name(u32 id); |
103 | const char **v4l2_ctrl_get_menu(u32 id); | 88 | const char * const *v4l2_ctrl_get_menu(u32 id); |
104 | int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def); | 89 | int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def); |
105 | int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, | 90 | int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, |
106 | struct v4l2_queryctrl *qctrl, const char **menu_items); | 91 | struct v4l2_queryctrl *qctrl, const char * const *menu_items); |
107 | #define V4L2_CTRL_MENU_IDS_END (0xffffffff) | 92 | #define V4L2_CTRL_MENU_IDS_END (0xffffffff) |
108 | int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 *ids); | 93 | int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 *ids); |
109 | 94 | ||
@@ -137,31 +122,16 @@ struct v4l2_subdev_ops; | |||
137 | 122 | ||
138 | 123 | ||
139 | /* Load an i2c module and return an initialized v4l2_subdev struct. | 124 | /* Load an i2c module and return an initialized v4l2_subdev struct. |
140 | Only call request_module if module_name != NULL. | ||
141 | The client_type argument is the name of the chip that's on the adapter. */ | 125 | The client_type argument is the name of the chip that's on the adapter. */ |
142 | struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev, | 126 | struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev, |
143 | struct i2c_adapter *adapter, | 127 | struct i2c_adapter *adapter, const char *client_type, |
144 | const char *module_name, const char *client_type, | ||
145 | int irq, void *platform_data, | ||
146 | u8 addr, const unsigned short *probe_addrs); | 128 | u8 addr, const unsigned short *probe_addrs); |
147 | 129 | ||
148 | /* Load an i2c module and return an initialized v4l2_subdev struct. | ||
149 | Only call request_module if module_name != NULL. | ||
150 | The client_type argument is the name of the chip that's on the adapter. */ | ||
151 | static inline struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev, | ||
152 | struct i2c_adapter *adapter, | ||
153 | const char *module_name, const char *client_type, | ||
154 | u8 addr, const unsigned short *probe_addrs) | ||
155 | { | ||
156 | return v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter, module_name, | ||
157 | client_type, 0, NULL, addr, probe_addrs); | ||
158 | } | ||
159 | |||
160 | struct i2c_board_info; | 130 | struct i2c_board_info; |
161 | 131 | ||
162 | struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev, | 132 | struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev, |
163 | struct i2c_adapter *adapter, const char *module_name, | 133 | struct i2c_adapter *adapter, struct i2c_board_info *info, |
164 | struct i2c_board_info *info, const unsigned short *probe_addrs); | 134 | const unsigned short *probe_addrs); |
165 | 135 | ||
166 | /* Initialize an v4l2_subdev with data from an i2c_client struct */ | 136 | /* Initialize an v4l2_subdev with data from an i2c_client struct */ |
167 | void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client, | 137 | void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client, |
@@ -232,4 +202,14 @@ void v4l_bound_align_image(unsigned int *w, unsigned int wmin, | |||
232 | unsigned int hmax, unsigned int halign, | 202 | unsigned int hmax, unsigned int halign, |
233 | unsigned int salign); | 203 | unsigned int salign); |
234 | int v4l_fill_dv_preset_info(u32 preset, struct v4l2_dv_enum_preset *info); | 204 | int v4l_fill_dv_preset_info(u32 preset, struct v4l2_dv_enum_preset *info); |
205 | |||
206 | struct v4l2_discrete_probe { | ||
207 | const struct v4l2_frmsize_discrete *sizes; | ||
208 | int num_sizes; | ||
209 | }; | ||
210 | |||
211 | const struct v4l2_frmsize_discrete *v4l2_find_nearest_format( | ||
212 | const struct v4l2_discrete_probe *probe, | ||
213 | s32 width, s32 height); | ||
214 | |||
235 | #endif /* V4L2_COMMON_H_ */ | 215 | #endif /* V4L2_COMMON_H_ */ |