]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commitdiff
V4L/DVB: cx18: remove old g/s_fmt from the cx18_av subdev
authorHans Verkuil <hverkuil@xs4all.nl>
Sat, 8 May 2010 19:37:53 +0000 (16:37 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 1 Jun 2010 04:21:20 +0000 (01:21 -0300)
cx18 has now switched over completely to the new mediabus subdev ops.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/cx18/cx18-av-core.c
drivers/media/video/cx18/cx18-controls.c
drivers/media/video/cx18/cx18-ioctl.c

index 39f484621a4501f5fb536a60805a1f03352519c9..54371f6d6b5f425f2d2098af3a3216c99442c29d 100644 (file)
@@ -1021,13 +1021,6 @@ static int cx18_av_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
        return -EINVAL;
 }
 
-static int cx18_av_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
-{
-       if (fmt->type != V4L2_BUF_TYPE_SLICED_VBI_CAPTURE)
-               return -EINVAL;
-       return cx18_av_g_sliced_fmt(sd, &fmt->fmt.sliced);
-}
-
 static int cx18_av_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *fmt)
 {
        struct cx18_av_state *state = to_cx18_av_state(sd);
@@ -1099,22 +1092,6 @@ static int cx18_av_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt
        return 0;
 }
 
-static int cx18_av_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
-{
-       struct v4l2_mbus_framefmt mbus_fmt;
-
-       switch (fmt->type) {
-       case V4L2_BUF_TYPE_VIDEO_CAPTURE:
-               mbus_fmt.width = fmt->fmt.pix.width;
-               mbus_fmt.height = fmt->fmt.pix.height;
-               mbus_fmt.code = V4L2_MBUS_FMT_FIXED;
-               return cx18_av_s_mbus_fmt(sd, &mbus_fmt);
-
-       default:
-               return -EINVAL;
-       }
-}
-
 static int cx18_av_s_stream(struct v4l2_subdev *sd, int enable)
 {
        struct cx18 *cx = v4l2_get_subdevdata(sd);
@@ -1409,8 +1386,6 @@ static const struct v4l2_subdev_audio_ops cx18_av_audio_ops = {
 static const struct v4l2_subdev_video_ops cx18_av_video_ops = {
        .s_routing = cx18_av_s_video_routing,
        .s_stream = cx18_av_s_stream,
-       .g_fmt = cx18_av_g_fmt,
-       .s_fmt = cx18_av_s_fmt,
        .s_mbus_fmt = cx18_av_s_mbus_fmt,
 };
 
index 4b4b46544d5a2443c754c0cd9ca4e9966710e5f2..67043c7b452b6f1f0c7a5ec74ebdcc6fa4c55da6 100644 (file)
@@ -297,14 +297,13 @@ int cx18_s_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c)
                if (p.video_encoding != cx->params.video_encoding) {
                        int is_mpeg1 = p.video_encoding ==
                                                V4L2_MPEG_VIDEO_ENCODING_MPEG_1;
-                       struct v4l2_format fmt;
+                       struct v4l2_mbus_framefmt fmt;
 
                        /* fix videodecoder resolution */
-                       fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-                       fmt.fmt.pix.width = cx->params.width
-                                               / (is_mpeg1 ? 2 : 1);
-                       fmt.fmt.pix.height = cx->params.height;
-                       v4l2_subdev_call(cx->sd_av, video, s_fmt, &fmt);
+                       fmt.width = cx->params.width / (is_mpeg1 ? 2 : 1);
+                       fmt.height = cx->params.height;
+                       fmt.code = V4L2_MBUS_FMT_FIXED;
+                       v4l2_subdev_call(cx->sd_av, video, s_mbus_fmt, &fmt);
                }
                priv.cx = cx;
                priv.s = &cx->streams[id->type];
index 2530fc54daaf6bd711b387a86f850ecf6ef47a99..b5b221c8a72520848b7d1326f3699ec7623aa528 100644 (file)
@@ -274,6 +274,7 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh,
 {
        struct cx18_open_id *id = fh;
        struct cx18 *cx = id->cx;
+       struct v4l2_mbus_framefmt mbus_fmt;
        int ret;
        int w, h;
 
@@ -293,9 +294,10 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh,
        if (atomic_read(&cx->ana_capturing) > 0)
                return -EBUSY;
 
-       cx->params.width = w;
-       cx->params.height = h;
-       v4l2_subdev_call(cx->sd_av, video, s_fmt, fmt);
+       mbus_fmt.width = cx->params.width = w;
+       mbus_fmt.height = cx->params.height = h;
+       mbus_fmt.code = V4L2_MBUS_FMT_FIXED;
+       v4l2_subdev_call(cx->sd_av, video, s_mbus_fmt, &mbus_fmt);
        return cx18_g_fmt_vid_cap(file, fh, fmt);
 }