diff options
Diffstat (limited to 'drivers/media/video/cx88/cx88-video.c')
-rw-r--r-- | drivers/media/video/cx88/cx88-video.c | 63 |
1 files changed, 54 insertions, 9 deletions
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 227179620d13..eea23f95edb7 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -63,11 +63,11 @@ MODULE_PARM_DESC(video_nr,"video device numbers"); | |||
63 | MODULE_PARM_DESC(vbi_nr,"vbi device numbers"); | 63 | MODULE_PARM_DESC(vbi_nr,"vbi device numbers"); |
64 | MODULE_PARM_DESC(radio_nr,"radio device numbers"); | 64 | MODULE_PARM_DESC(radio_nr,"radio device numbers"); |
65 | 65 | ||
66 | static unsigned int video_debug = 0; | 66 | static unsigned int video_debug; |
67 | module_param(video_debug,int,0644); | 67 | module_param(video_debug,int,0644); |
68 | MODULE_PARM_DESC(video_debug,"enable debug messages [video]"); | 68 | MODULE_PARM_DESC(video_debug,"enable debug messages [video]"); |
69 | 69 | ||
70 | static unsigned int irq_debug = 0; | 70 | static unsigned int irq_debug; |
71 | module_param(irq_debug,int,0644); | 71 | module_param(irq_debug,int,0644); |
72 | MODULE_PARM_DESC(irq_debug,"enable debug messages [IRQ handler]"); | 72 | MODULE_PARM_DESC(irq_debug,"enable debug messages [IRQ handler]"); |
73 | 73 | ||
@@ -228,6 +228,30 @@ static struct cx88_ctrl cx8800_ctls[] = { | |||
228 | .mask = 0x00ff, | 228 | .mask = 0x00ff, |
229 | .shift = 0, | 229 | .shift = 0, |
230 | },{ | 230 | },{ |
231 | .v = { | ||
232 | .id = V4L2_CID_CHROMA_AGC, | ||
233 | .name = "Chroma AGC", | ||
234 | .minimum = 0, | ||
235 | .maximum = 1, | ||
236 | .default_value = 0x1, | ||
237 | .type = V4L2_CTRL_TYPE_BOOLEAN, | ||
238 | }, | ||
239 | .reg = MO_INPUT_FORMAT, | ||
240 | .mask = 1 << 10, | ||
241 | .shift = 10, | ||
242 | }, { | ||
243 | .v = { | ||
244 | .id = V4L2_CID_COLOR_KILLER, | ||
245 | .name = "Color killer", | ||
246 | .minimum = 0, | ||
247 | .maximum = 1, | ||
248 | .default_value = 0x1, | ||
249 | .type = V4L2_CTRL_TYPE_BOOLEAN, | ||
250 | }, | ||
251 | .reg = MO_INPUT_FORMAT, | ||
252 | .mask = 1 << 9, | ||
253 | .shift = 9, | ||
254 | }, { | ||
231 | /* --- audio --- */ | 255 | /* --- audio --- */ |
232 | .v = { | 256 | .v = { |
233 | .id = V4L2_CID_AUDIO_MUTE, | 257 | .id = V4L2_CID_AUDIO_MUTE, |
@@ -282,6 +306,8 @@ const u32 cx88_user_ctrls[] = { | |||
282 | V4L2_CID_AUDIO_VOLUME, | 306 | V4L2_CID_AUDIO_VOLUME, |
283 | V4L2_CID_AUDIO_BALANCE, | 307 | V4L2_CID_AUDIO_BALANCE, |
284 | V4L2_CID_AUDIO_MUTE, | 308 | V4L2_CID_AUDIO_MUTE, |
309 | V4L2_CID_CHROMA_AGC, | ||
310 | V4L2_CID_COLOR_KILLER, | ||
285 | 0 | 311 | 0 |
286 | }; | 312 | }; |
287 | EXPORT_SYMBOL(cx88_user_ctrls); | 313 | EXPORT_SYMBOL(cx88_user_ctrls); |
@@ -291,7 +317,7 @@ static const u32 *ctrl_classes[] = { | |||
291 | NULL | 317 | NULL |
292 | }; | 318 | }; |
293 | 319 | ||
294 | int cx8800_ctrl_query(struct v4l2_queryctrl *qctrl) | 320 | int cx8800_ctrl_query(struct cx88_core *core, struct v4l2_queryctrl *qctrl) |
295 | { | 321 | { |
296 | int i; | 322 | int i; |
297 | 323 | ||
@@ -306,6 +332,11 @@ int cx8800_ctrl_query(struct v4l2_queryctrl *qctrl) | |||
306 | return 0; | 332 | return 0; |
307 | } | 333 | } |
308 | *qctrl = cx8800_ctls[i].v; | 334 | *qctrl = cx8800_ctls[i].v; |
335 | /* Report chroma AGC as inactive when SECAM is selected */ | ||
336 | if (cx8800_ctls[i].v.id == V4L2_CID_CHROMA_AGC && | ||
337 | core->tvnorm & V4L2_STD_SECAM) | ||
338 | qctrl->flags |= V4L2_CTRL_FLAG_INACTIVE; | ||
339 | |||
309 | return 0; | 340 | return 0; |
310 | } | 341 | } |
311 | EXPORT_SYMBOL(cx8800_ctrl_query); | 342 | EXPORT_SYMBOL(cx8800_ctrl_query); |
@@ -776,14 +807,14 @@ static int video_open(struct inode *inode, struct file *file) | |||
776 | fh->height = 240; | 807 | fh->height = 240; |
777 | fh->fmt = format_by_fourcc(V4L2_PIX_FMT_BGR24); | 808 | fh->fmt = format_by_fourcc(V4L2_PIX_FMT_BGR24); |
778 | 809 | ||
779 | videobuf_queue_pci_init(&fh->vidq, &cx8800_video_qops, | 810 | videobuf_queue_sg_init(&fh->vidq, &cx8800_video_qops, |
780 | dev->pci, &dev->slock, | 811 | &dev->pci->dev, &dev->slock, |
781 | V4L2_BUF_TYPE_VIDEO_CAPTURE, | 812 | V4L2_BUF_TYPE_VIDEO_CAPTURE, |
782 | V4L2_FIELD_INTERLACED, | 813 | V4L2_FIELD_INTERLACED, |
783 | sizeof(struct cx88_buffer), | 814 | sizeof(struct cx88_buffer), |
784 | fh); | 815 | fh); |
785 | videobuf_queue_pci_init(&fh->vbiq, &cx8800_vbi_qops, | 816 | videobuf_queue_sg_init(&fh->vbiq, &cx8800_vbi_qops, |
786 | dev->pci, &dev->slock, | 817 | &dev->pci->dev, &dev->slock, |
787 | V4L2_BUF_TYPE_VBI_CAPTURE, | 818 | V4L2_BUF_TYPE_VBI_CAPTURE, |
788 | V4L2_FIELD_SEQ_TB, | 819 | V4L2_FIELD_SEQ_TB, |
789 | sizeof(struct cx88_buffer), | 820 | sizeof(struct cx88_buffer), |
@@ -976,6 +1007,12 @@ int cx88_set_control(struct cx88_core *core, struct v4l2_control *ctl) | |||
976 | } | 1007 | } |
977 | mask=0xffff; | 1008 | mask=0xffff; |
978 | break; | 1009 | break; |
1010 | case V4L2_CID_CHROMA_AGC: | ||
1011 | /* Do not allow chroma AGC to be enabled for SECAM */ | ||
1012 | value = ((ctl->value - c->off) << c->shift) & c->mask; | ||
1013 | if (core->tvnorm & V4L2_STD_SECAM && value) | ||
1014 | return -EINVAL; | ||
1015 | break; | ||
979 | default: | 1016 | default: |
980 | value = ((ctl->value - c->off) << c->shift) & c->mask; | 1017 | value = ((ctl->value - c->off) << c->shift) & c->mask; |
981 | break; | 1018 | break; |
@@ -1268,10 +1305,12 @@ static int vidioc_s_input (struct file *file, void *priv, unsigned int i) | |||
1268 | static int vidioc_queryctrl (struct file *file, void *priv, | 1305 | static int vidioc_queryctrl (struct file *file, void *priv, |
1269 | struct v4l2_queryctrl *qctrl) | 1306 | struct v4l2_queryctrl *qctrl) |
1270 | { | 1307 | { |
1308 | struct cx88_core *core = ((struct cx8800_fh *)priv)->dev->core; | ||
1309 | |||
1271 | qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id); | 1310 | qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id); |
1272 | if (unlikely(qctrl->id == 0)) | 1311 | if (unlikely(qctrl->id == 0)) |
1273 | return -EINVAL; | 1312 | return -EINVAL; |
1274 | return cx8800_ctrl_query(qctrl); | 1313 | return cx8800_ctrl_query(core, qctrl); |
1275 | } | 1314 | } |
1276 | 1315 | ||
1277 | static int vidioc_g_ctrl (struct file *file, void *priv, | 1316 | static int vidioc_g_ctrl (struct file *file, void *priv, |
@@ -1832,8 +1871,11 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, | |||
1832 | 1871 | ||
1833 | switch (core->boardnr) { | 1872 | switch (core->boardnr) { |
1834 | case CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD: | 1873 | case CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD: |
1835 | request_module("ir-kbd-i2c"); | 1874 | case CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD: |
1836 | request_module("rtc-isl1208"); | 1875 | request_module("rtc-isl1208"); |
1876 | /* break intentionally omitted */ | ||
1877 | case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO: | ||
1878 | request_module("ir-kbd-i2c"); | ||
1837 | } | 1879 | } |
1838 | 1880 | ||
1839 | /* register v4l devices */ | 1881 | /* register v4l devices */ |
@@ -1917,6 +1959,9 @@ static void __devexit cx8800_finidev(struct pci_dev *pci_dev) | |||
1917 | core->kthread = NULL; | 1959 | core->kthread = NULL; |
1918 | } | 1960 | } |
1919 | 1961 | ||
1962 | if (core->ir) | ||
1963 | cx88_ir_stop(core, core->ir); | ||
1964 | |||
1920 | cx88_shutdown(core); /* FIXME */ | 1965 | cx88_shutdown(core); /* FIXME */ |
1921 | pci_disable_device(pci_dev); | 1966 | pci_disable_device(pci_dev); |
1922 | 1967 | ||