These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / media / i2c / cx25840 / cx25840-core.c
index bd49644..fe6eb78 100644 (file)
@@ -971,7 +971,7 @@ static void input_change(struct i2c_client *client)
                   not used by any public broadcast network, force
                   6.5 MHz carrier to be interpreted as System DK,
                   this avoids DK audio detection instability */
-              cx25840_write(client, 0x80b, 0x00);
+               cx25840_write(client, 0x80b, 0x00);
        } else if (std & V4L2_STD_SECAM) {
                /* Autodetect audio standard and audio system */
                cx25840_write(client, 0x808, 0xff);
@@ -1366,14 +1366,17 @@ static int cx25840_s_ctrl(struct v4l2_ctrl *ctrl)
 
 /* ----------------------------------------------------------------------- */
 
-static int cx25840_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *fmt)
+static int cx25840_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 cx25840_state *state = to_state(sd);
        struct i2c_client *client = v4l2_get_subdevdata(sd);
        int HSC, VSC, Vsrc, Hsrc, filter, Vlines;
        int is_50Hz = !(state->std & V4L2_STD_525_60);
 
-       if (fmt->code != MEDIA_BUS_FMT_FIXED)
+       if (format->pad || fmt->code != MEDIA_BUS_FMT_FIXED)
                return -EINVAL;
 
        fmt->field = V4L2_FIELD_INTERLACED;
@@ -1403,6 +1406,8 @@ static int cx25840_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt
                                fmt->width, fmt->height);
                return -ERANGE;
        }
+       if (format->which == V4L2_SUBDEV_FORMAT_TRY)
+               return 0;
 
        HSC = (Hsrc * (1 << 20)) / fmt->width - (1 << 20);
        VSC = (1 << 16) - (Vsrc * (1 << 9) / Vlines - (1 << 9));
@@ -5068,7 +5073,6 @@ static const struct v4l2_subdev_video_ops cx25840_video_ops = {
        .s_std = cx25840_s_std,
        .g_std = cx25840_g_std,
        .s_routing = cx25840_s_video_routing,
-       .s_mbus_fmt = cx25840_s_mbus_fmt,
        .s_stream = cx25840_s_stream,
        .g_input_status = cx25840_g_input_status,
 };
@@ -5080,12 +5084,17 @@ static const struct v4l2_subdev_vbi_ops cx25840_vbi_ops = {
        .g_sliced_fmt = cx25840_g_sliced_fmt,
 };
 
+static const struct v4l2_subdev_pad_ops cx25840_pad_ops = {
+       .set_fmt = cx25840_set_fmt,
+};
+
 static const struct v4l2_subdev_ops cx25840_ops = {
        .core = &cx25840_core_ops,
        .tuner = &cx25840_tuner_ops,
        .audio = &cx25840_audio_ops,
        .video = &cx25840_video_ops,
        .vbi = &cx25840_vbi_ops,
+       .pad = &cx25840_pad_ops,
        .ir = &cx25840_ir_ops,
 };
 
@@ -5339,7 +5348,6 @@ MODULE_DEVICE_TABLE(i2c, cx25840_id);
 
 static struct i2c_driver cx25840_driver = {
        .driver = {
-               .owner  = THIS_MODULE,
                .name   = "cx25840",
        },
        .probe          = cx25840_probe,