V4L/DVB (12253): v4l: common vpss module for video drivers
[safe/jmp/linux-2.6] / include / media / v4l2-common.h
index 01302f1..33a1842 100644 (file)
@@ -153,6 +153,22 @@ struct v4l2_subdev *v4l2_i2c_new_probed_subdev(struct v4l2_device *v4l2_dev,
 struct v4l2_subdev *v4l2_i2c_new_probed_subdev_addr(struct v4l2_device *v4l2_dev,
                struct i2c_adapter *adapter,
                const char *module_name, const char *client_type, u8 addr);
+
+/* Load an i2c module and return an initialized v4l2_subdev struct.
+   Only call request_module if module_name != NULL.
+   The client_type argument is the name of the chip that's on the adapter. */
+struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev,
+               struct i2c_adapter *adapter,
+               const char *module_name, const char *client_type,
+               int irq, void *platform_data,
+               u8 addr, const unsigned short *probe_addrs);
+
+struct i2c_board_info;
+
+struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
+               struct i2c_adapter *adapter, const char *module_name,
+               struct i2c_board_info *info, const unsigned short *probe_addrs);
+
 /* Initialize an v4l2_subdev with data from an i2c_client struct */
 void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client,
                const struct v4l2_subdev_ops *ops);
@@ -174,10 +190,10 @@ const unsigned short *v4l2_i2c_tuner_addrs(enum v4l2_i2c_tuner_type type);
 
 /* ------------------------------------------------------------------------- */
 
-/* Note: these remaining ioctls should be removed as well, but they are still
-   used in tuner-simple.c (TUNER_SET_CONFIG) and cx18/ivtv (RESET and
-   S_AUDIO_ROUTING). To remove these ioctls some more cleanup is needed in
-   those modules. */
+/* Note: these remaining ioctls/structs should be removed as well, but they are
+   still used in tuner-simple.c (TUNER_SET_CONFIG), cx18/ivtv (RESET) and
+   v4l2-int-device.h (v4l2_routing). To remove these ioctls some more cleanup
+   is needed in those modules. */
 
 /* s_config */
 struct v4l2_priv_tun_config {
@@ -186,13 +202,21 @@ struct v4l2_priv_tun_config {
 };
 #define TUNER_SET_CONFIG           _IOW('d', 92, struct v4l2_priv_tun_config)
 
-/* s_routing: routing definition, device dependent. It specifies which inputs
-   (if any) should be routed to which outputs (if any). */
+#define VIDIOC_INT_RESET               _IOW ('d', 102, u32)
+
 struct v4l2_routing {
        u32 input;
        u32 output;
 };
-#define        VIDIOC_INT_S_AUDIO_ROUTING      _IOW ('d', 109, struct v4l2_routing)
-#define VIDIOC_INT_RESET               _IOW ('d', 102, u32)
+
+/* ------------------------------------------------------------------------- */
+
+/* Miscellaneous helper functions */
+
+void v4l_bound_align_image(unsigned int *w, unsigned int wmin,
+                          unsigned int wmax, unsigned int walign,
+                          unsigned int *h, unsigned int hmin,
+                          unsigned int hmax, unsigned int halign,
+                          unsigned int salign);
 
 #endif /* V4L2_COMMON_H_ */