aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2010-05-08 15:37:53 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-06-01 00:21:20 -0400
commit9e36eabc8a6fb87d9b97057e0d0f5195c475fbdc (patch)
tree5d462a79b941104da6c4b1b7b217016d37641eca /drivers/media
parente17ad1de031f2d5cade70eb0469a53f17d90d7c2 (diff)
V4L/DVB: cx18: remove old g/s_fmt from the cx18_av subdev
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>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/cx18/cx18-av-core.c25
-rw-r--r--drivers/media/video/cx18/cx18-controls.c11
-rw-r--r--drivers/media/video/cx18/cx18-ioctl.c8
3 files changed, 10 insertions, 34 deletions
diff --git a/drivers/media/video/cx18/cx18-av-core.c b/drivers/media/video/cx18/cx18-av-core.c
index 39f484621a45..54371f6d6b5f 100644
--- a/drivers/media/video/cx18/cx18-av-core.c
+++ b/drivers/media/video/cx18/cx18-av-core.c
@@ -1021,13 +1021,6 @@ static int cx18_av_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc)
1021 return -EINVAL; 1021 return -EINVAL;
1022} 1022}
1023 1023
1024static int cx18_av_g_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
1025{
1026 if (fmt->type != V4L2_BUF_TYPE_SLICED_VBI_CAPTURE)
1027 return -EINVAL;
1028 return cx18_av_g_sliced_fmt(sd, &fmt->fmt.sliced);
1029}
1030
1031static int cx18_av_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *fmt) 1024static int cx18_av_s_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *fmt)
1032{ 1025{
1033 struct cx18_av_state *state = to_cx18_av_state(sd); 1026 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
1099 return 0; 1092 return 0;
1100} 1093}
1101 1094
1102static int cx18_av_s_fmt(struct v4l2_subdev *sd, struct v4l2_format *fmt)
1103{
1104 struct v4l2_mbus_framefmt mbus_fmt;
1105
1106 switch (fmt->type) {
1107 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
1108 mbus_fmt.width = fmt->fmt.pix.width;
1109 mbus_fmt.height = fmt->fmt.pix.height;
1110 mbus_fmt.code = V4L2_MBUS_FMT_FIXED;
1111 return cx18_av_s_mbus_fmt(sd, &mbus_fmt);
1112
1113 default:
1114 return -EINVAL;
1115 }
1116}
1117
1118static int cx18_av_s_stream(struct v4l2_subdev *sd, int enable) 1095static int cx18_av_s_stream(struct v4l2_subdev *sd, int enable)
1119{ 1096{
1120 struct cx18 *cx = v4l2_get_subdevdata(sd); 1097 struct cx18 *cx = v4l2_get_subdevdata(sd);
@@ -1409,8 +1386,6 @@ static const struct v4l2_subdev_audio_ops cx18_av_audio_ops = {
1409static const struct v4l2_subdev_video_ops cx18_av_video_ops = { 1386static const struct v4l2_subdev_video_ops cx18_av_video_ops = {
1410 .s_routing = cx18_av_s_video_routing, 1387 .s_routing = cx18_av_s_video_routing,
1411 .s_stream = cx18_av_s_stream, 1388 .s_stream = cx18_av_s_stream,
1412 .g_fmt = cx18_av_g_fmt,
1413 .s_fmt = cx18_av_s_fmt,
1414 .s_mbus_fmt = cx18_av_s_mbus_fmt, 1389 .s_mbus_fmt = cx18_av_s_mbus_fmt,
1415}; 1390};
1416 1391
diff --git a/drivers/media/video/cx18/cx18-controls.c b/drivers/media/video/cx18/cx18-controls.c
index 4b4b46544d5a..67043c7b452b 100644
--- a/drivers/media/video/cx18/cx18-controls.c
+++ b/drivers/media/video/cx18/cx18-controls.c
@@ -297,14 +297,13 @@ int cx18_s_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c)
297 if (p.video_encoding != cx->params.video_encoding) { 297 if (p.video_encoding != cx->params.video_encoding) {
298 int is_mpeg1 = p.video_encoding == 298 int is_mpeg1 = p.video_encoding ==
299 V4L2_MPEG_VIDEO_ENCODING_MPEG_1; 299 V4L2_MPEG_VIDEO_ENCODING_MPEG_1;
300 struct v4l2_format fmt; 300 struct v4l2_mbus_framefmt fmt;
301 301
302 /* fix videodecoder resolution */ 302 /* fix videodecoder resolution */
303 fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 303 fmt.width = cx->params.width / (is_mpeg1 ? 2 : 1);
304 fmt.fmt.pix.width = cx->params.width 304 fmt.height = cx->params.height;
305 / (is_mpeg1 ? 2 : 1); 305 fmt.code = V4L2_MBUS_FMT_FIXED;
306 fmt.fmt.pix.height = cx->params.height; 306 v4l2_subdev_call(cx->sd_av, video, s_mbus_fmt, &fmt);
307 v4l2_subdev_call(cx->sd_av, video, s_fmt, &fmt);
308 } 307 }
309 priv.cx = cx; 308 priv.cx = cx;
310 priv.s = &cx->streams[id->type]; 309 priv.s = &cx->streams[id->type];
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c
index 2530fc54daaf..b5b221c8a725 100644
--- a/drivers/media/video/cx18/cx18-ioctl.c
+++ b/drivers/media/video/cx18/cx18-ioctl.c
@@ -274,6 +274,7 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh,
274{ 274{
275 struct cx18_open_id *id = fh; 275 struct cx18_open_id *id = fh;
276 struct cx18 *cx = id->cx; 276 struct cx18 *cx = id->cx;
277 struct v4l2_mbus_framefmt mbus_fmt;
277 int ret; 278 int ret;
278 int w, h; 279 int w, h;
279 280
@@ -293,9 +294,10 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh,
293 if (atomic_read(&cx->ana_capturing) > 0) 294 if (atomic_read(&cx->ana_capturing) > 0)
294 return -EBUSY; 295 return -EBUSY;
295 296
296 cx->params.width = w; 297 mbus_fmt.width = cx->params.width = w;
297 cx->params.height = h; 298 mbus_fmt.height = cx->params.height = h;
298 v4l2_subdev_call(cx->sd_av, video, s_fmt, fmt); 299 mbus_fmt.code = V4L2_MBUS_FMT_FIXED;
300 v4l2_subdev_call(cx->sd_av, video, s_mbus_fmt, &mbus_fmt);
299 return cx18_g_fmt_vid_cap(file, fh, fmt); 301 return cx18_g_fmt_vid_cap(file, fh, fmt);
300} 302}
301 303