These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / media / usb / go7007 / s2250-board.c
index bb84668..1466db1 100644 (file)
@@ -405,12 +405,20 @@ static int s2250_s_ctrl(struct v4l2_ctrl *ctrl)
        return 0;
 }
 
-static int s2250_s_mbus_fmt(struct v4l2_subdev *sd,
-                       struct v4l2_mbus_framefmt *fmt)
+static int s2250_set_fmt(struct v4l2_subdev *sd,
+               struct v4l2_subdev_pad_config *cfg,
+               struct v4l2_subdev_format *format)
 {
+       struct v4l2_mbus_framefmt *fmt = &format->format;
        struct s2250 *state = to_state(sd);
        struct i2c_client *client = v4l2_get_subdevdata(sd);
 
+       if (format->pad)
+               return -EINVAL;
+
+       if (format->which == V4L2_SUBDEV_FORMAT_TRY)
+               return 0;
+
        if (fmt->height < 640) {
                write_reg_fp(client, 0x12b, state->reg12b_val | 0x400);
                write_reg_fp(client, 0x140, 0x060);
@@ -479,13 +487,17 @@ static const struct v4l2_subdev_audio_ops s2250_audio_ops = {
 static const struct v4l2_subdev_video_ops s2250_video_ops = {
        .s_std = s2250_s_std,
        .s_routing = s2250_s_video_routing,
-       .s_mbus_fmt = s2250_s_mbus_fmt,
+};
+
+static const struct v4l2_subdev_pad_ops s2250_pad_ops = {
+       .set_fmt = s2250_set_fmt,
 };
 
 static const struct v4l2_subdev_ops s2250_ops = {
        .core = &s2250_core_ops,
        .audio = &s2250_audio_ops,
        .video = &s2250_video_ops,
+       .pad = &s2250_pad_ops,
 };
 
 /* --------------------------------------------------------------------------*/
@@ -617,7 +629,6 @@ MODULE_DEVICE_TABLE(i2c, s2250_id);
 
 static struct i2c_driver s2250_driver = {
        .driver = {
-               .owner  = THIS_MODULE,
                .name   = "s2250",
        },
        .probe          = s2250_probe,