aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-video.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx88/cx88-video.c')
-rw-r--r--drivers/media/video/cx88/cx88-video.c67
1 files changed, 49 insertions, 18 deletions
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index dcda5291b990..2225d4b94140 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -327,6 +327,51 @@ static struct cx88_ctrl cx8800_ctls[] = {
327}; 327};
328static const int CX8800_CTLS = ARRAY_SIZE(cx8800_ctls); 328static const int CX8800_CTLS = ARRAY_SIZE(cx8800_ctls);
329 329
330const u32 cx88_user_ctrls[] = {
331 V4L2_CID_USER_CLASS,
332 V4L2_CID_BRIGHTNESS,
333 V4L2_CID_CONTRAST,
334 V4L2_CID_SATURATION,
335 V4L2_CID_HUE,
336 V4L2_CID_AUDIO_VOLUME,
337 V4L2_CID_AUDIO_BALANCE,
338 V4L2_CID_AUDIO_MUTE,
339 0
340};
341EXPORT_SYMBOL(cx88_user_ctrls);
342
343static const u32 *ctrl_classes[] = {
344 cx88_user_ctrls,
345 NULL
346};
347
348int cx8800_ctrl_query(struct v4l2_queryctrl *qctrl)
349{
350 int i;
351
352 if (qctrl->id < V4L2_CID_BASE ||
353 qctrl->id >= V4L2_CID_LASTP1)
354 return -EINVAL;
355 for (i = 0; i < CX8800_CTLS; i++)
356 if (cx8800_ctls[i].v.id == qctrl->id)
357 break;
358 if (i == CX8800_CTLS) {
359 *qctrl = no_ctl;
360 return 0;
361 }
362 *qctrl = cx8800_ctls[i].v;
363 return 0;
364}
365EXPORT_SYMBOL(cx8800_ctrl_query);
366
367static int cx88_queryctrl(struct v4l2_queryctrl *qctrl)
368{
369 qctrl->id = v4l2_ctrl_next(ctrl_classes, qctrl->id);
370 if (qctrl->id == 0)
371 return -EINVAL;
372 return cx8800_ctrl_query(qctrl);
373}
374
330/* ------------------------------------------------------------------- */ 375/* ------------------------------------------------------------------- */
331/* resource management */ 376/* resource management */
332 377
@@ -1362,20 +1407,8 @@ int cx88_do_ioctl(struct inode *inode, struct file *file, int radio,
1362 case VIDIOC_QUERYCTRL: 1407 case VIDIOC_QUERYCTRL:
1363 { 1408 {
1364 struct v4l2_queryctrl *c = arg; 1409 struct v4l2_queryctrl *c = arg;
1365 int i;
1366 1410
1367 if (c->id < V4L2_CID_BASE || 1411 return cx88_queryctrl(c);
1368 c->id >= V4L2_CID_LASTP1)
1369 return -EINVAL;
1370 for (i = 0; i < CX8800_CTLS; i++)
1371 if (cx8800_ctls[i].v.id == c->id)
1372 break;
1373 if (i == CX8800_CTLS) {
1374 *c = no_ctl;
1375 return 0;
1376 }
1377 *c = cx8800_ctls[i].v;
1378 return 0;
1379 } 1412 }
1380 case VIDIOC_G_CTRL: 1413 case VIDIOC_G_CTRL:
1381 return get_control(core,arg); 1414 return get_control(core,arg);
@@ -1847,9 +1880,9 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
1847 pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev); 1880 pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev);
1848 pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat); 1881 pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER, &dev->pci_lat);
1849 printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, " 1882 printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, "
1850 "latency: %d, mmio: 0x%lx\n", core->name, 1883 "latency: %d, mmio: 0x%llx\n", core->name,
1851 pci_name(pci_dev), dev->pci_rev, pci_dev->irq, 1884 pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
1852 dev->pci_lat,pci_resource_start(pci_dev,0)); 1885 dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
1853 1886
1854 pci_set_master(pci_dev); 1887 pci_set_master(pci_dev);
1855 if (!pci_dma_supported(pci_dev,0xffffffff)) { 1888 if (!pci_dma_supported(pci_dev,0xffffffff)) {
@@ -1882,7 +1915,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
1882 1915
1883 /* get irq */ 1916 /* get irq */
1884 err = request_irq(pci_dev->irq, cx8800_irq, 1917 err = request_irq(pci_dev->irq, cx8800_irq,
1885 SA_SHIRQ | SA_INTERRUPT, core->name, dev); 1918 IRQF_SHARED | IRQF_DISABLED, core->name, dev);
1886 if (err < 0) { 1919 if (err < 0) {
1887 printk(KERN_ERR "%s: can't get IRQ %d\n", 1920 printk(KERN_ERR "%s: can't get IRQ %d\n",
1888 core->name,pci_dev->irq); 1921 core->name,pci_dev->irq);
@@ -1893,8 +1926,6 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
1893 /* load and configure helper modules */ 1926 /* load and configure helper modules */
1894 if (TUNER_ABSENT != core->tuner_type) 1927 if (TUNER_ABSENT != core->tuner_type)
1895 request_module("tuner"); 1928 request_module("tuner");
1896 if (core->tda9887_conf)
1897 request_module("tda9887");
1898 1929
1899 /* register v4l devices */ 1930 /* register v4l devices */
1900 dev->video_dev = cx88_vdev_init(core,dev->pci, 1931 dev->video_dev = cx88_vdev_init(core,dev->pci,