diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2010-06-27 06:07:26 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-08 23:43:06 -0300 |
commit | f7b80e6919df812b4bed99a927325312a904111b (patch) | |
tree | 6828bb6bfeea81a8345b148dbca8b2fdcadec7eb /drivers/media/video/ivtv/ivtv-driver.c | |
parent | 2fd781448acd6cbc3ca9d2f48b0e16f67a77bf51 (diff) |
V4L/DVB: ivtv: convert to the new 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/ivtv/ivtv-driver.c')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-driver.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c index 53ea31aab155..e421d15b0f5c 100644 --- a/drivers/media/video/ivtv/ivtv-driver.c +++ b/drivers/media/video/ivtv/ivtv-driver.c @@ -53,6 +53,7 @@ #include "ivtv-cards.h" #include "ivtv-vbi.h" #include "ivtv-routing.h" +#include "ivtv-controls.h" #include "ivtv-gpio.h" #include <media/tveeprom.h> @@ -734,9 +735,8 @@ static int __devinit ivtv_init_struct1(struct ivtv *itv) itv->open_id = 1; /* Initial settings */ - cx2341x_fill_defaults(&itv->params); - itv->params.port = CX2341X_PORT_MEMORY; - itv->params.capabilities = CX2341X_CAP_HAS_SLICED_VBI; + itv->cxhdl.port = CX2341X_PORT_MEMORY; + itv->cxhdl.capabilities = CX2341X_CAP_HAS_SLICED_VBI; init_waitqueue_head(&itv->eos_waitq); init_waitqueue_head(&itv->event_waitq); init_waitqueue_head(&itv->vsync_waitq); @@ -1006,6 +1006,13 @@ static int __devinit ivtv_probe(struct pci_dev *pdev, retval = -ENOMEM; goto err; } + retval = cx2341x_handler_init(&itv->cxhdl, 50); + if (retval) + goto err; + itv->v4l2_dev.ctrl_handler = &itv->cxhdl.hdl; + itv->cxhdl.ops = &ivtv_cxhdl_ops; + itv->cxhdl.priv = itv; + itv->cxhdl.func = ivtv_api_func; IVTV_DEBUG_INFO("base addr: 0x%08x\n", itv->base_addr); @@ -1127,7 +1134,7 @@ static int __devinit ivtv_probe(struct pci_dev *pdev, itv->yuv_info.v4l2_src_w = itv->yuv_info.osd_full_w; itv->yuv_info.v4l2_src_h = itv->yuv_info.osd_full_h; - itv->params.video_gop_size = itv->is_60hz ? 15 : 12; + cx2341x_handler_set_50hz(&itv->cxhdl, itv->is_50hz); itv->stream_buf_size[IVTV_ENC_STREAM_TYPE_MPG] = 0x08000; itv->stream_buf_size[IVTV_ENC_STREAM_TYPE_PCM] = 0x01200; @@ -1322,6 +1329,8 @@ int ivtv_init_on_first_open(struct ivtv *itv) /* For cards with video out, this call needs interrupts enabled */ ivtv_s_std(NULL, &fh, &itv->tuner_std); + /* Setup initial controls */ + cx2341x_handler_setup(&itv->cxhdl); return 0; } @@ -1386,7 +1395,6 @@ static void ivtv_remove(struct pci_dev *pdev) printk(KERN_INFO "ivtv: Removed %s\n", itv->card_name); v4l2_device_unregister(&itv->v4l2_dev); - v4l2_ctrl_handler_free(&itv->hdl_gpio); kfree(itv); } |