diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2010-12-31 08:22:52 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-21 19:31:49 -0400 |
commit | a75b9be1c2fb52dee765d35f29031dd788d522eb (patch) | |
tree | a4f4616c01d3fe7628640accc54cd356cbf9f609 /drivers/media/video/cx18/cx18-streams.c | |
parent | 34a078da8e20ca40a09bfa635ff2c4e2c4b648b1 (diff) |
[media] cx18: Use the control framework
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-streams.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-streams.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/media/video/cx18/cx18-streams.c b/drivers/media/video/cx18/cx18-streams.c index 94f5d7967c5c..2d248560770e 100644 --- a/drivers/media/video/cx18/cx18-streams.c +++ b/drivers/media/video/cx18/cx18-streams.c | |||
@@ -572,7 +572,7 @@ static void cx18_stream_configure_mdls(struct cx18_stream *s) | |||
572 | * Set the MDL size to the exact size needed for one frame. | 572 | * Set the MDL size to the exact size needed for one frame. |
573 | * Use enough buffers per MDL to cover the MDL size | 573 | * Use enough buffers per MDL to cover the MDL size |
574 | */ | 574 | */ |
575 | s->mdl_size = 720 * s->cx->params.height * 3 / 2; | 575 | s->mdl_size = 720 * s->cx->cxhdl.height * 3 / 2; |
576 | s->bufs_per_mdl = s->mdl_size / s->buf_size; | 576 | s->bufs_per_mdl = s->mdl_size / s->buf_size; |
577 | if (s->mdl_size % s->buf_size) | 577 | if (s->mdl_size % s->buf_size) |
578 | s->bufs_per_mdl++; | 578 | s->bufs_per_mdl++; |
@@ -607,7 +607,6 @@ int cx18_start_v4l2_encode_stream(struct cx18_stream *s) | |||
607 | u32 data[MAX_MB_ARGUMENTS]; | 607 | u32 data[MAX_MB_ARGUMENTS]; |
608 | struct cx18 *cx = s->cx; | 608 | struct cx18 *cx = s->cx; |
609 | int captype = 0; | 609 | int captype = 0; |
610 | struct cx18_api_func_private priv; | ||
611 | struct cx18_stream *s_idx; | 610 | struct cx18_stream *s_idx; |
612 | 611 | ||
613 | if (!cx18_stream_enabled(s)) | 612 | if (!cx18_stream_enabled(s)) |
@@ -620,7 +619,7 @@ int cx18_start_v4l2_encode_stream(struct cx18_stream *s) | |||
620 | captype = CAPTURE_CHANNEL_TYPE_MPEG; | 619 | captype = CAPTURE_CHANNEL_TYPE_MPEG; |
621 | cx->mpg_data_received = cx->vbi_data_inserted = 0; | 620 | cx->mpg_data_received = cx->vbi_data_inserted = 0; |
622 | cx->dualwatch_jiffies = jiffies; | 621 | cx->dualwatch_jiffies = jiffies; |
623 | cx->dualwatch_stereo_mode = cx->params.audio_properties & 0x300; | 622 | cx->dualwatch_stereo_mode = v4l2_ctrl_g_ctrl(cx->cxhdl.audio_mode); |
624 | cx->search_pack_header = 0; | 623 | cx->search_pack_header = 0; |
625 | break; | 624 | break; |
626 | 625 | ||
@@ -710,21 +709,21 @@ int cx18_start_v4l2_encode_stream(struct cx18_stream *s) | |||
710 | s->handle, cx18_stream_enabled(s_idx) ? 7 : 0); | 709 | s->handle, cx18_stream_enabled(s_idx) ? 7 : 0); |
711 | 710 | ||
712 | /* Call out to the common CX2341x API setup for user controls */ | 711 | /* Call out to the common CX2341x API setup for user controls */ |
713 | priv.cx = cx; | 712 | cx->cxhdl.priv = s; |
714 | priv.s = s; | 713 | cx2341x_handler_setup(&cx->cxhdl); |
715 | cx2341x_update(&priv, cx18_api_func, NULL, &cx->params); | ||
716 | 714 | ||
717 | /* | 715 | /* |
718 | * When starting a capture and we're set for radio, | 716 | * When starting a capture and we're set for radio, |
719 | * ensure the video is muted, despite the user control. | 717 | * ensure the video is muted, despite the user control. |
720 | */ | 718 | */ |
721 | if (!cx->params.video_mute && | 719 | if (!cx->cxhdl.video_mute && |
722 | test_bit(CX18_F_I_RADIO_USER, &cx->i_flags)) | 720 | test_bit(CX18_F_I_RADIO_USER, &cx->i_flags)) |
723 | cx18_vapi(cx, CX18_CPU_SET_VIDEO_MUTE, 2, s->handle, | 721 | cx18_vapi(cx, CX18_CPU_SET_VIDEO_MUTE, 2, s->handle, |
724 | (cx->params.video_mute_yuv << 8) | 1); | 722 | (v4l2_ctrl_g_ctrl(cx->cxhdl.video_mute_yuv) << 8) | 1); |
725 | } | 723 | } |
726 | 724 | ||
727 | if (atomic_read(&cx->tot_capturing) == 0) { | 725 | if (atomic_read(&cx->tot_capturing) == 0) { |
726 | cx2341x_handler_set_busy(&cx->cxhdl, 1); | ||
728 | clear_bit(CX18_F_I_EOS, &cx->i_flags); | 727 | clear_bit(CX18_F_I_EOS, &cx->i_flags); |
729 | cx18_write_reg(cx, 7, CX18_DSP0_INTERRUPT_MASK); | 728 | cx18_write_reg(cx, 7, CX18_DSP0_INTERRUPT_MASK); |
730 | } | 729 | } |
@@ -826,6 +825,7 @@ int cx18_stop_v4l2_encode_stream(struct cx18_stream *s, int gop_end) | |||
826 | if (atomic_read(&cx->tot_capturing) > 0) | 825 | if (atomic_read(&cx->tot_capturing) > 0) |
827 | return 0; | 826 | return 0; |
828 | 827 | ||
828 | cx2341x_handler_set_busy(&cx->cxhdl, 0); | ||
829 | cx18_write_reg(cx, 5, CX18_DSP0_INTERRUPT_MASK); | 829 | cx18_write_reg(cx, 5, CX18_DSP0_INTERRUPT_MASK); |
830 | wake_up(&s->waitq); | 830 | wake_up(&s->waitq); |
831 | 831 | ||