V4L/DVB (11743): Analog Devices ADV7343 video encoder driver
[pandora-kernel.git] / include / media / v4l2-subdev.h
index 38b89cf..a503e1c 100644 (file)
@@ -37,12 +37,6 @@ struct v4l2_decode_vbi_line {
        u32 type;               /* VBI service type (V4L2_SLICED_*). 0 if no service found */
 };
 
-/* s_crystal_freq */
-struct v4l2_crystal_freq {
-       u32 freq;       /* frequency in Hz of the crystal */
-       u32 flags;      /* device specific flags */
-};
-
 /* Sub-devices are devices that are connected somehow to the main bridge
    device. These devices are usually audio/video muxers/encoders/decoders or
    sensors and webcam controllers.
@@ -113,6 +107,7 @@ struct v4l2_subdev_core_ops {
        int (*s_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls);
        int (*try_ext_ctrls)(struct v4l2_subdev *sd, struct v4l2_ext_controls *ctrls);
        int (*querymenu)(struct v4l2_subdev *sd, struct v4l2_querymenu *qm);
+       int (*s_std)(struct v4l2_subdev *sd, v4l2_std_id norm);
        long (*ioctl)(struct v4l2_subdev *sd, unsigned int cmd, void *arg);
 #ifdef CONFIG_VIDEO_ADV_DEBUG
        int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg);
@@ -137,7 +132,6 @@ struct v4l2_subdev_tuner_ops {
        int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
        int (*g_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
        int (*s_tuner)(struct v4l2_subdev *sd, struct v4l2_tuner *vt);
-       int (*s_std)(struct v4l2_subdev *sd, v4l2_std_id norm);
        int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type);
        int (*s_config)(struct v4l2_subdev *sd, const struct v4l2_priv_tun_config *config);
        int (*s_standby)(struct v4l2_subdev *sd);
@@ -154,7 +148,8 @@ struct v4l2_subdev_tuner_ops {
        board designs. Usual values for the frequency are 1024000 and 2048000.
        If the frequency is not supported, then -EINVAL is returned.
 
-   s_routing: used to define the input and/or output pins of an audio chip.
+   s_routing: used to define the input and/or output pins of an audio chip,
+       and any additional configuration data.
        Never attempt to use user-level input IDs (e.g. Composite, S-Video,
        Tuner) at this level. An i2c device shouldn't know about whether an
        input pin is connected to a Composite connector, become on another
@@ -165,7 +160,7 @@ struct v4l2_subdev_tuner_ops {
 struct v4l2_subdev_audio_ops {
        int (*s_clock_freq)(struct v4l2_subdev *sd, u32 freq);
        int (*s_i2s_clock_freq)(struct v4l2_subdev *sd, u32 freq);
-       int (*s_routing)(struct v4l2_subdev *sd, const struct v4l2_routing *route);
+       int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config);
 };
 
 /*
@@ -194,8 +189,8 @@ struct v4l2_subdev_audio_ops {
    s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by
        video input devices.
 
-   s_crystal_freq: sets the frequency of the crystal used to generate the
-       clocks. An extra flags field allows device specific configuration
+  s_crystal_freq: sets the frequency of the crystal used to generate the
+       clocks in Hz. An extra flags field allows device specific configuration
        regarding clock frequency dividers, etc. If not used, then set flags
        to 0. If the frequency is not supported, then -EINVAL is returned.
 
@@ -206,8 +201,8 @@ struct v4l2_subdev_audio_ops {
        devices.
  */
 struct v4l2_subdev_video_ops {
-       int (*s_routing)(struct v4l2_subdev *sd, const struct v4l2_routing *route);
-       int (*s_crystal_freq)(struct v4l2_subdev *sd, struct v4l2_crystal_freq *freq);
+       int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config);
+       int (*s_crystal_freq)(struct v4l2_subdev *sd, u32 freq, u32 flags);
        int (*decode_vbi_line)(struct v4l2_subdev *sd, struct v4l2_decode_vbi_line *vbi_line);
        int (*s_vbi_data)(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_data *vbi_data);
        int (*g_vbi_data)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_data *vbi_data);
@@ -235,12 +230,16 @@ struct v4l2_subdev_ops {
 
 #define V4L2_SUBDEV_NAME_SIZE 32
 
+/* Set this flag if this subdev is a i2c device. */
+#define V4L2_SUBDEV_FL_IS_I2C (1U << 0)
+
 /* Each instance of a subdev driver should create this struct, either
    stand-alone or embedded in a larger struct.
  */
 struct v4l2_subdev {
        struct list_head list;
        struct module *owner;
+       u32 flags;
        struct v4l2_device *v4l2_dev;
        const struct v4l2_subdev_ops *ops;
        /* name must be unique */
@@ -269,6 +268,7 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd,
        BUG_ON(!ops || !ops->core);
        sd->ops = ops;
        sd->v4l2_dev = NULL;
+       sd->flags = 0;
        sd->name[0] = '\0';
        sd->grp_id = 0;
        sd->priv = NULL;