aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx18/cx18-driver.c')
-rw-r--r--drivers/media/video/cx18/cx18-driver.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c
index b1c3cbd92743..b988ec62af58 100644
--- a/drivers/media/video/cx18/cx18-driver.c
+++ b/drivers/media/video/cx18/cx18-driver.c
@@ -36,6 +36,7 @@
36#include "cx18-scb.h" 36#include "cx18-scb.h"
37#include "cx18-mailbox.h" 37#include "cx18-mailbox.h"
38#include "cx18-ioctl.h" 38#include "cx18-ioctl.h"
39#include "cx18-controls.h"
39#include "tuner-xc2028.h" 40#include "tuner-xc2028.h"
40 41
41#include <media/tveeprom.h> 42#include <media/tveeprom.h>
@@ -729,15 +730,21 @@ static int __devinit cx18_init_struct1(struct cx18 *cx)
729 cx->open_id = 1; 730 cx->open_id = 1;
730 731
731 /* Initial settings */ 732 /* Initial settings */
732 cx2341x_fill_defaults(&cx->params); 733 cx->cxhdl.port = CX2341X_PORT_MEMORY;
733 cx->temporal_strength = cx->params.video_temporal_filter; 734 cx->cxhdl.capabilities = CX2341X_CAP_HAS_TS | CX2341X_CAP_HAS_SLICED_VBI;
734 cx->spatial_strength = cx->params.video_spatial_filter; 735 cx->cxhdl.ops = &cx18_cxhdl_ops;
735 cx->filter_mode = cx->params.video_spatial_filter_mode | 736 cx->cxhdl.func = cx18_api_func;
736 (cx->params.video_temporal_filter_mode << 1) | 737 ret = cx2341x_handler_init(&cx->cxhdl, 50);
737 (cx->params.video_median_filter_type << 2); 738 if (ret)
738 cx->params.port = CX2341X_PORT_MEMORY; 739 return ret;
739 cx->params.capabilities = 740 cx->v4l2_dev.ctrl_handler = &cx->cxhdl.hdl;
740 CX2341X_CAP_HAS_TS | CX2341X_CAP_HAS_SLICED_VBI; 741
742 cx->temporal_strength = cx->cxhdl.video_temporal_filter->cur.val;
743 cx->spatial_strength = cx->cxhdl.video_spatial_filter->cur.val;
744 cx->filter_mode = cx->cxhdl.video_spatial_filter_mode->cur.val |
745 (cx->cxhdl.video_temporal_filter_mode->cur.val << 1) |
746 (cx->cxhdl.video_median_filter_type->cur.val << 2);
747
741 init_waitqueue_head(&cx->cap_w); 748 init_waitqueue_head(&cx->cap_w);
742 init_waitqueue_head(&cx->mb_apu_waitq); 749 init_waitqueue_head(&cx->mb_apu_waitq);
743 init_waitqueue_head(&cx->mb_cpu_waitq); 750 init_waitqueue_head(&cx->mb_cpu_waitq);
@@ -1049,7 +1056,7 @@ static int __devinit cx18_probe(struct pci_dev *pci_dev,
1049 else 1056 else
1050 cx->is_50hz = 1; 1057 cx->is_50hz = 1;
1051 1058
1052 cx->params.video_gop_size = cx->is_60hz ? 15 : 12; 1059 cx2341x_handler_set_50hz(&cx->cxhdl, !cx->is_60hz);
1053 1060
1054 if (cx->options.radio > 0) 1061 if (cx->options.radio > 0)
1055 cx->v4l2_cap |= V4L2_CAP_RADIO; 1062 cx->v4l2_cap |= V4L2_CAP_RADIO;
@@ -1095,7 +1102,6 @@ static int __devinit cx18_probe(struct pci_dev *pci_dev,
1095 1102
1096 /* Load cx18 submodules (cx18-alsa) */ 1103 /* Load cx18 submodules (cx18-alsa) */
1097 request_modules(cx); 1104 request_modules(cx);
1098
1099 return 0; 1105 return 0;
1100 1106
1101free_streams: 1107free_streams:
@@ -1278,6 +1284,8 @@ static void cx18_remove(struct pci_dev *pci_dev)
1278 for (i = 0; i < CX18_VBI_FRAMES; i++) 1284 for (i = 0; i < CX18_VBI_FRAMES; i++)
1279 kfree(cx->vbi.sliced_mpeg_data[i]); 1285 kfree(cx->vbi.sliced_mpeg_data[i]);
1280 1286
1287 v4l2_ctrl_handler_free(&cx->av_state.hdl);
1288
1281 CX18_INFO("Removed %s\n", cx->card_name); 1289 CX18_INFO("Removed %s\n", cx->card_name);
1282 1290
1283 v4l2_device_unregister(v4l2_dev); 1291 v4l2_device_unregister(v4l2_dev);