media: v4l2-subdev: add subdev-wide state struct
[linux-2.6-microblaze.git] / drivers / media / i2c / ov13858.c
index 9598c0b..7fc70af 100644 (file)
@@ -1150,7 +1150,7 @@ static int ov13858_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
 {
        struct ov13858 *ov13858 = to_ov13858(sd);
        struct v4l2_mbus_framefmt *try_fmt = v4l2_subdev_get_try_format(sd,
-                                                                       fh->pad,
+                                                                       fh->state,
                                                                        0);
 
        mutex_lock(&ov13858->mutex);
@@ -1275,7 +1275,7 @@ static const struct v4l2_ctrl_ops ov13858_ctrl_ops = {
 };
 
 static int ov13858_enum_mbus_code(struct v4l2_subdev *sd,
-                                 struct v4l2_subdev_pad_config *cfg,
+                                 struct v4l2_subdev_state *sd_state,
                                  struct v4l2_subdev_mbus_code_enum *code)
 {
        /* Only one bayer order(GRBG) is supported */
@@ -1288,7 +1288,7 @@ static int ov13858_enum_mbus_code(struct v4l2_subdev *sd,
 }
 
 static int ov13858_enum_frame_size(struct v4l2_subdev *sd,
-                                  struct v4l2_subdev_pad_config *cfg,
+                                  struct v4l2_subdev_state *sd_state,
                                   struct v4l2_subdev_frame_size_enum *fse)
 {
        if (fse->index >= ARRAY_SIZE(supported_modes))
@@ -1315,14 +1315,14 @@ static void ov13858_update_pad_format(const struct ov13858_mode *mode,
 }
 
 static int ov13858_do_get_pad_format(struct ov13858 *ov13858,
-                                    struct v4l2_subdev_pad_config *cfg,
+                                    struct v4l2_subdev_state *sd_state,
                                     struct v4l2_subdev_format *fmt)
 {
        struct v4l2_mbus_framefmt *framefmt;
        struct v4l2_subdev *sd = &ov13858->sd;
 
        if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
-               framefmt = v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
+               framefmt = v4l2_subdev_get_try_format(sd, sd_state, fmt->pad);
                fmt->format = *framefmt;
        } else {
                ov13858_update_pad_format(ov13858->cur_mode, fmt);
@@ -1332,14 +1332,14 @@ static int ov13858_do_get_pad_format(struct ov13858 *ov13858,
 }
 
 static int ov13858_get_pad_format(struct v4l2_subdev *sd,
-                                 struct v4l2_subdev_pad_config *cfg,
+                                 struct v4l2_subdev_state *sd_state,
                                  struct v4l2_subdev_format *fmt)
 {
        struct ov13858 *ov13858 = to_ov13858(sd);
        int ret;
 
        mutex_lock(&ov13858->mutex);
-       ret = ov13858_do_get_pad_format(ov13858, cfg, fmt);
+       ret = ov13858_do_get_pad_format(ov13858, sd_state, fmt);
        mutex_unlock(&ov13858->mutex);
 
        return ret;
@@ -1347,7 +1347,7 @@ static int ov13858_get_pad_format(struct v4l2_subdev *sd,
 
 static int
 ov13858_set_pad_format(struct v4l2_subdev *sd,
-                      struct v4l2_subdev_pad_config *cfg,
+                      struct v4l2_subdev_state *sd_state,
                       struct v4l2_subdev_format *fmt)
 {
        struct ov13858 *ov13858 = to_ov13858(sd);
@@ -1371,7 +1371,7 @@ ov13858_set_pad_format(struct v4l2_subdev *sd,
                                      fmt->format.width, fmt->format.height);
        ov13858_update_pad_format(mode, fmt);
        if (fmt->which == V4L2_SUBDEV_FORMAT_TRY) {
-               framefmt = v4l2_subdev_get_try_format(sd, cfg, fmt->pad);
+               framefmt = v4l2_subdev_get_try_format(sd, sd_state, fmt->pad);
                *framefmt = fmt->format;
        } else {
                ov13858->cur_mode = mode;