aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-streams.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-11-29 17:38:23 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 06:38:44 -0500
commit67ec09fdf5e05d4670b617256c696348b5df080b (patch)
treefdf5f16f9b20280f83ce10e435d557bcb371934f /drivers/media/video/ivtv/ivtv-streams.c
parentca085fb900265b525e3f9fb95fb6d7fd27a302ea (diff)
V4L/DVB (9835): ivtv/ivtvfb: convert to v4l2_device/v4l2_subdev.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-streams.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-streams.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c
index 9b7aa79eb267..76279ed30da2 100644
--- a/drivers/media/video/ivtv/ivtv-streams.c
+++ b/drivers/media/video/ivtv/ivtv-streams.c
@@ -172,7 +172,7 @@ static int ivtv_prep_dev(struct ivtv *itv, int type)
172{ 172{
173 struct ivtv_stream *s = &itv->streams[type]; 173 struct ivtv_stream *s = &itv->streams[type];
174 int num_offset = ivtv_stream_info[type].num_offset; 174 int num_offset = ivtv_stream_info[type].num_offset;
175 int num = itv->num + ivtv_first_minor + num_offset; 175 int num = itv->instance + ivtv_first_minor + num_offset;
176 176
177 /* These four fields are always initialized. If v4l2dev == NULL, then 177 /* These four fields are always initialized. If v4l2dev == NULL, then
178 this stream is not in use. In that case no other fields but these 178 this stream is not in use. In that case no other fields but these
@@ -205,8 +205,8 @@ static int ivtv_prep_dev(struct ivtv *itv, int type)
205 return -ENOMEM; 205 return -ENOMEM;
206 } 206 }
207 207
208 snprintf(s->v4l2dev->name, sizeof(s->v4l2dev->name), "ivtv%d %s", 208 snprintf(s->v4l2dev->name, sizeof(s->v4l2dev->name), "%s %s",
209 itv->num, s->name); 209 itv->device.name, s->name);
210 210
211 s->v4l2dev->num = num; 211 s->v4l2dev->num = num;
212 s->v4l2dev->parent = &itv->dev->dev; 212 s->v4l2dev->parent = &itv->dev->dev;
@@ -260,6 +260,7 @@ static int ivtv_reg_dev(struct ivtv *itv, int type)
260 if (s_mpg->v4l2dev) 260 if (s_mpg->v4l2dev)
261 num = s_mpg->v4l2dev->num + ivtv_stream_info[type].num_offset; 261 num = s_mpg->v4l2dev->num + ivtv_stream_info[type].num_offset;
262 } 262 }
263 video_set_drvdata(s->v4l2dev, s);
263 264
264 /* Register device. First try the desired minor, then any free one. */ 265 /* Register device. First try the desired minor, then any free one. */
265 if (video_register_device(s->v4l2dev, vfl_type, num)) { 266 if (video_register_device(s->v4l2dev, vfl_type, num)) {
@@ -343,7 +344,7 @@ static void ivtv_vbi_setup(struct ivtv *itv)
343 ivtv_vapi(itv, CX2341X_ENC_SET_VBI_LINE, 5, 0xffff , 0, 0, 0, 0); 344 ivtv_vapi(itv, CX2341X_ENC_SET_VBI_LINE, 5, 0xffff , 0, 0, 0, 0);
344 345
345 /* setup VBI registers */ 346 /* setup VBI registers */
346 itv->video_dec_func(itv, VIDIOC_S_FMT, &itv->vbi.in); 347 v4l2_subdev_call(itv->sd_video, video, s_fmt, &itv->vbi.in);
347 348
348 /* determine number of lines and total number of VBI bytes. 349 /* determine number of lines and total number of VBI bytes.
349 A raw line takes 1443 bytes: 2 * 720 + 4 byte frame header - 1 350 A raw line takes 1443 bytes: 2 * 720 + 4 byte frame header - 1
@@ -577,10 +578,10 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s)
577 clear_bit(IVTV_F_I_EOS, &itv->i_flags); 578 clear_bit(IVTV_F_I_EOS, &itv->i_flags);
578 579
579 /* Initialize Digitizer for Capture */ 580 /* Initialize Digitizer for Capture */
580 itv->video_dec_func(itv, VIDIOC_STREAMOFF, NULL); 581 v4l2_subdev_call(itv->sd_video, video, s_stream, 0);
581 ivtv_msleep_timeout(300, 1); 582 ivtv_msleep_timeout(300, 1);
582 ivtv_vapi(itv, CX2341X_ENC_INITIALIZE_INPUT, 0); 583 ivtv_vapi(itv, CX2341X_ENC_INITIALIZE_INPUT, 0);
583 itv->video_dec_func(itv, VIDIOC_STREAMON, NULL); 584 v4l2_subdev_call(itv->sd_video, video, s_stream, 1);
584 } 585 }
585 586
586 /* begin_capture */ 587 /* begin_capture */