aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-04-29 22:38:01 -0400
committerPaul Mackerras <paulus@samba.org>2007-04-29 22:38:01 -0400
commit49e1900d4cc2e7bcecb681fe60f0990bec2dcce8 (patch)
tree253801ebf57e0a23856a2c7be129c2c178f62fdf /drivers/media/video/cx88
parent34f6d749c0a328817d5e36274e53121c1db734dc (diff)
parentb9099ff63c75216d6ca10bce5a1abcd9293c27e6 (diff)
Merge branch 'linux-2.6' into for-2.6.22
Diffstat (limited to 'drivers/media/video/cx88')
-rw-r--r--drivers/media/video/cx88/Kconfig1
-rw-r--r--drivers/media/video/cx88/cx88-alsa.c9
-rw-r--r--drivers/media/video/cx88/cx88-cards.c37
-rw-r--r--drivers/media/video/cx88/cx88-core.c8
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c31
-rw-r--r--drivers/media/video/cx88/cx88-i2c.c3
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c29
-rw-r--r--drivers/media/video/cx88/cx88-video.c5
-rw-r--r--drivers/media/video/cx88/cx88.h4
9 files changed, 79 insertions, 48 deletions
diff --git a/drivers/media/video/cx88/Kconfig b/drivers/media/video/cx88/Kconfig
index b2a66ba625f9..0f9d96963618 100644
--- a/drivers/media/video/cx88/Kconfig
+++ b/drivers/media/video/cx88/Kconfig
@@ -53,7 +53,6 @@ config VIDEO_CX88_DVB
53 select DVB_OR51132 if !DVB_FE_CUSTOMISE 53 select DVB_OR51132 if !DVB_FE_CUSTOMISE
54 select DVB_CX22702 if !DVB_FE_CUSTOMISE 54 select DVB_CX22702 if !DVB_FE_CUSTOMISE
55 select DVB_LGDT330X if !DVB_FE_CUSTOMISE 55 select DVB_LGDT330X if !DVB_FE_CUSTOMISE
56 select DVB_TUNER_LGH06XF if !DVB_FE_CUSTOMISE
57 select DVB_NXT200X if !DVB_FE_CUSTOMISE 56 select DVB_NXT200X if !DVB_FE_CUSTOMISE
58 select DVB_CX24123 if !DVB_FE_CUSTOMISE 57 select DVB_CX24123 if !DVB_FE_CUSTOMISE
59 select DVB_ISL6421 if !DVB_FE_CUSTOMISE 58 select DVB_ISL6421 if !DVB_FE_CUSTOMISE
diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c
index e4355fdc3b6d..3956c257556c 100644
--- a/drivers/media/video/cx88/cx88-alsa.c
+++ b/drivers/media/video/cx88/cx88-alsa.c
@@ -232,7 +232,8 @@ static void cx8801_aud_irq(snd_cx88_card_t *chip)
232 cx_write(MO_AUD_INTSTAT, status); 232 cx_write(MO_AUD_INTSTAT, status);
233 if (debug > 1 || (status & mask & ~0xff)) 233 if (debug > 1 || (status & mask & ~0xff))
234 cx88_print_irqbits(core->name, "irq aud", 234 cx88_print_irqbits(core->name, "irq aud",
235 cx88_aud_irqs, status, mask); 235 cx88_aud_irqs, ARRAY_SIZE(cx88_aud_irqs),
236 status, mask);
236 /* risc op code error */ 237 /* risc op code error */
237 if (status & (1 << 16)) { 238 if (status & (1 << 16)) {
238 printk(KERN_WARNING "%s/0: audio risc op code error\n",core->name); 239 printk(KERN_WARNING "%s/0: audio risc op code error\n",core->name);
@@ -413,11 +414,9 @@ static int snd_cx88_hw_params(struct snd_pcm_substream * substream,
413 414
414 dprintk(1,"Setting buffer\n"); 415 dprintk(1,"Setting buffer\n");
415 416
416 buf = kmalloc(sizeof(*buf),GFP_KERNEL); 417 buf = kzalloc(sizeof(*buf),GFP_KERNEL);
417 if (NULL == buf) 418 if (NULL == buf)
418 return -ENOMEM; 419 return -ENOMEM;
419 memset(buf,0,sizeof(*buf));
420
421 420
422 buf->vb.memory = V4L2_MEMORY_MMAP; 421 buf->vb.memory = V4L2_MEMORY_MMAP;
423 buf->vb.width = chip->period_size; 422 buf->vb.width = chip->period_size;
@@ -682,7 +681,7 @@ static int __devinit snd_cx88_create(struct snd_card *card,
682 return err; 681 return err;
683 } 682 }
684 683
685 if (!pci_dma_supported(pci,0xffffffff)) { 684 if (!pci_dma_supported(pci,DMA_32BIT_MASK)) {
686 dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name); 685 dprintk(0, "%s/1: Oops: no 32bit PCI DMA ???\n",core->name);
687 err = -EIO; 686 err = -EIO;
688 cx88_core_put(core,pci); 687 cx88_core_put(core,pci);
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index 65e9d8096b74..e61102dc8ad7 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -885,6 +885,12 @@ struct cx88_board cx88_boards[] = {
885 .input = {{ 885 .input = {{
886 .type = CX88_VMUX_DVB, 886 .type = CX88_VMUX_DVB,
887 .vmux = 0, 887 .vmux = 0,
888 },{
889 .type = CX88_VMUX_COMPOSITE1,
890 .vmux = 1,
891 },{
892 .type = CX88_VMUX_SVIDEO,
893 .vmux = 2,
888 }}, 894 }},
889 .mpeg = CX88_MPEG_DVB, 895 .mpeg = CX88_MPEG_DVB,
890 }, 896 },
@@ -1537,10 +1543,10 @@ struct cx88_subid cx88_subids[] = {
1537 },{ 1543 },{
1538 .subvendor = 0x17de, 1544 .subvendor = 0x17de,
1539 .subdevice = 0x0840, 1545 .subdevice = 0x0840,
1540 .card = CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT, 1546 .card = CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT,
1541 },{ 1547 },{
1542 .subvendor = 0x1421, 1548 .subvendor = 0x1421,
1543 .subdevice = 0x0305, 1549 .subdevice = 0x0305,
1544 .card = CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT, 1550 .card = CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT,
1545 },{ 1551 },{
1546 .subvendor = 0x18ac, 1552 .subvendor = 0x18ac,
@@ -1631,6 +1637,10 @@ struct cx88_subid cx88_subids[] = {
1631 .subvendor = 0x0070, 1637 .subvendor = 0x0070,
1632 .subdevice = 0x1402, 1638 .subdevice = 0x1402,
1633 .card = CX88_BOARD_HAUPPAUGE_HVR3000, 1639 .card = CX88_BOARD_HAUPPAUGE_HVR3000,
1640 },{
1641 .subvendor = 0x1421,
1642 .subdevice = 0x0341, /* ADS Tech InstantTV DVB-S */
1643 .card = CX88_BOARD_KWORLD_DVBS_100,
1634 }, 1644 },
1635}; 1645};
1636const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids); 1646const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
@@ -1786,7 +1796,7 @@ static void dvico_fusionhdtv_hybrid_init(struct cx88_core *core)
1786 { 0x03, 0x0C }, 1796 { 0x03, 0x0C },
1787 }; 1797 };
1788 1798
1789 for (i = 0; i < 13; i++) { 1799 for (i = 0; i < ARRAY_SIZE(init_bufs); i++) {
1790 msg.buf = init_bufs[i]; 1800 msg.buf = init_bufs[i];
1791 msg.len = (i != 12 ? 5 : 2); 1801 msg.len = (i != 12 ? 5 : 2);
1792 err = i2c_transfer(&core->i2c_adap, &msg, 1); 1802 err = i2c_transfer(&core->i2c_adap, &msg, 1);
@@ -1913,12 +1923,21 @@ void cx88_card_setup(struct cx88_core *core)
1913 if (0 == core->i2c_rc) { 1923 if (0 == core->i2c_rc) {
1914 /* enable tuner */ 1924 /* enable tuner */
1915 int i; 1925 int i;
1916 static const u8 buffer [] = { 0x10,0x12,0x13,0x04,0x16,0x00,0x14,0x04,0x017,0x00 }; 1926 static const u8 buffer [][2] = {
1927 {0x10,0x12},
1928 {0x13,0x04},
1929 {0x16,0x00},
1930 {0x14,0x04},
1931 {0x17,0x00}
1932 };
1917 core->i2c_client.addr = 0x0a; 1933 core->i2c_client.addr = 0x0a;
1918 1934
1919 for (i = 0; i < 5; i++) 1935 for (i = 0; i < ARRAY_SIZE(buffer); i++)
1920 if (2 != i2c_master_send(&core->i2c_client,&buffer[i*2],2)) 1936 if (2 != i2c_master_send(&core->i2c_client,
1921 printk(KERN_WARNING "%s: Unable to enable tuner(%i).\n", 1937 buffer[i],2))
1938 printk(KERN_WARNING
1939 "%s: Unable to enable "
1940 "tuner(%i).\n",
1922 core->name, i); 1941 core->name, i);
1923 } 1942 }
1924 break; 1943 break;
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c
index d86813be56de..f31ec96924b9 100644
--- a/drivers/media/video/cx88/cx88-core.c
+++ b/drivers/media/video/cx88/cx88-core.c
@@ -489,12 +489,12 @@ static char *cx88_pci_irqs[32] = {
489}; 489};
490 490
491void cx88_print_irqbits(char *name, char *tag, char **strings, 491void cx88_print_irqbits(char *name, char *tag, char **strings,
492 u32 bits, u32 mask) 492 int len, u32 bits, u32 mask)
493{ 493{
494 unsigned int i; 494 unsigned int i;
495 495
496 printk(KERN_DEBUG "%s: %s [0x%x]", name, tag, bits); 496 printk(KERN_DEBUG "%s: %s [0x%x]", name, tag, bits);
497 for (i = 0; i < 32; i++) { 497 for (i = 0; i < len; i++) {
498 if (!(bits & (1 << i))) 498 if (!(bits & (1 << i)))
499 continue; 499 continue;
500 if (strings[i]) 500 if (strings[i])
@@ -520,8 +520,8 @@ int cx88_core_irq(struct cx88_core *core, u32 status)
520 } 520 }
521 if (!handled) 521 if (!handled)
522 cx88_print_irqbits(core->name, "irq pci", 522 cx88_print_irqbits(core->name, "irq pci",
523 cx88_pci_irqs, status, 523 cx88_pci_irqs, ARRAY_SIZE(cx88_pci_irqs),
524 core->pci_irqmask); 524 status, core->pci_irqmask);
525 return handled; 525 return handled;
526} 526}
527 527
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index 4f5560285770..dbfe4dc9cf8c 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -42,7 +42,6 @@
42#include "cx22702.h" 42#include "cx22702.h"
43#include "or51132.h" 43#include "or51132.h"
44#include "lgdt330x.h" 44#include "lgdt330x.h"
45#include "lgh06xf.h"
46#include "nxt200x.h" 45#include "nxt200x.h"
47#include "cx24123.h" 46#include "cx24123.h"
48#include "isl6421.h" 47#include "isl6421.h"
@@ -476,6 +475,8 @@ static int dvb_register(struct cx8802_dev *dev)
476 case CX88_BOARD_WINFAST_DTV2000H: 475 case CX88_BOARD_WINFAST_DTV2000H:
477 case CX88_BOARD_HAUPPAUGE_HVR1100: 476 case CX88_BOARD_HAUPPAUGE_HVR1100:
478 case CX88_BOARD_HAUPPAUGE_HVR1100LP: 477 case CX88_BOARD_HAUPPAUGE_HVR1100LP:
478 case CX88_BOARD_HAUPPAUGE_HVR1300:
479 case CX88_BOARD_HAUPPAUGE_HVR3000:
479 dev->dvb.frontend = dvb_attach(cx22702_attach, 480 dev->dvb.frontend = dvb_attach(cx22702_attach,
480 &hauppauge_hvr_config, 481 &hauppauge_hvr_config,
481 &dev->core->i2c_adap); 482 &dev->core->i2c_adap);
@@ -631,8 +632,9 @@ static int dvb_register(struct cx8802_dev *dev)
631 &fusionhdtv_5_gold, 632 &fusionhdtv_5_gold,
632 &dev->core->i2c_adap); 633 &dev->core->i2c_adap);
633 if (dev->dvb.frontend != NULL) { 634 if (dev->dvb.frontend != NULL) {
634 dvb_attach(lgh06xf_attach, dev->dvb.frontend, 635 dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
635 &dev->core->i2c_adap); 636 &dev->core->i2c_adap,
637 &dvb_pll_lg_tdvs_h06xf);
636 } 638 }
637 } 639 }
638 break; 640 break;
@@ -650,8 +652,9 @@ static int dvb_register(struct cx8802_dev *dev)
650 &pchdtv_hd5500, 652 &pchdtv_hd5500,
651 &dev->core->i2c_adap); 653 &dev->core->i2c_adap);
652 if (dev->dvb.frontend != NULL) { 654 if (dev->dvb.frontend != NULL) {
653 dvb_attach(lgh06xf_attach, dev->dvb.frontend, 655 dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
654 &dev->core->i2c_adap); 656 &dev->core->i2c_adap,
657 &dvb_pll_lg_tdvs_h06xf);
655 } 658 }
656 } 659 }
657 break; 660 break;
@@ -692,24 +695,6 @@ static int dvb_register(struct cx8802_dev *dev)
692 dev->dvb.frontend->ops.set_voltage = geniatech_dvbs_set_voltage; 695 dev->dvb.frontend->ops.set_voltage = geniatech_dvbs_set_voltage;
693 } 696 }
694 break; 697 break;
695 case CX88_BOARD_HAUPPAUGE_HVR1300:
696 dev->dvb.frontend = dvb_attach(cx22702_attach,
697 &hauppauge_hvr_config,
698 &dev->core->i2c_adap);
699 if (dev->dvb.frontend != NULL) {
700 dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
701 &dev->core->i2c_adap, &dvb_pll_fmd1216me);
702 }
703 break;
704 case CX88_BOARD_HAUPPAUGE_HVR3000:
705 dev->dvb.frontend = dvb_attach(cx22702_attach,
706 &hauppauge_hvr_config,
707 &dev->core->i2c_adap);
708 if (dev->dvb.frontend != NULL) {
709 dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61,
710 &dev->core->i2c_adap, &dvb_pll_fmd1216me);
711 }
712 break;
713 default: 698 default:
714 printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n", 699 printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n",
715 dev->core->name); 700 dev->core->name);
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index 9830d5c43921..7919a1f9da06 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -1,3 +1,4 @@
1
1/* 2/*
2 3
3 cx88-i2c.c -- all the i2c code is here 4 cx88-i2c.c -- all the i2c code is here
@@ -195,7 +196,7 @@ static void do_i2c_scan(char *name, struct i2c_client *c)
195 unsigned char buf; 196 unsigned char buf;
196 int i,rc; 197 int i,rc;
197 198
198 for (i = 0; i < 128; i++) { 199 for (i = 0; i < ARRAY_SIZE(i2c_devs); i++) {
199 c->addr = i; 200 c->addr = i;
200 rc = i2c_master_recv(c,&buf,0); 201 rc = i2c_master_recv(c,&buf,0);
201 if (rc < 0) 202 if (rc < 0)
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c
index 1fe1a833c7c7..b2eb32e01aee 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -49,6 +49,27 @@ MODULE_PARM_DESC(debug,"enable debug messages [mpeg]");
49#define mpeg_dbg(level,fmt, arg...) if (debug >= level) \ 49#define mpeg_dbg(level,fmt, arg...) if (debug >= level) \
50 printk(KERN_DEBUG "%s/2-mpeg: " fmt, core->name, ## arg) 50 printk(KERN_DEBUG "%s/2-mpeg: " fmt, core->name, ## arg)
51 51
52#if defined(CONFIG_MODULES) && defined(MODULE)
53static void request_module_async(struct work_struct *work)
54{
55 struct cx8802_dev *dev=container_of(work, struct cx8802_dev, request_module_wk);
56
57 if (cx88_boards[dev->core->board].mpeg & CX88_MPEG_DVB)
58 request_module("cx88-dvb");
59 if (cx88_boards[dev->core->board].mpeg & CX88_MPEG_BLACKBIRD)
60 request_module("cx88-blackbird");
61}
62
63static void request_modules(struct cx8802_dev *dev)
64{
65 INIT_WORK(&dev->request_module_wk, request_module_async);
66 schedule_work(&dev->request_module_wk);
67}
68#else
69#define request_modules(dev)
70#endif /* CONFIG_MODULES */
71
72
52static LIST_HEAD(cx8802_devlist); 73static LIST_HEAD(cx8802_devlist);
53/* ------------------------------------------------------------------ */ 74/* ------------------------------------------------------------------ */
54 75
@@ -345,7 +366,8 @@ static void cx8802_mpeg_irq(struct cx8802_dev *dev)
345 366
346 if (debug || (status & mask & ~0xff)) 367 if (debug || (status & mask & ~0xff))
347 cx88_print_irqbits(core->name, "irq mpeg ", 368 cx88_print_irqbits(core->name, "irq mpeg ",
348 cx88_mpeg_irqs, status, mask); 369 cx88_mpeg_irqs, ARRAY_SIZE(cx88_mpeg_irqs),
370 status, mask);
349 371
350 /* risc op code error */ 372 /* risc op code error */
351 if (status & (1 << 16)) { 373 if (status & (1 << 16)) {
@@ -427,7 +449,7 @@ int cx8802_init_common(struct cx8802_dev *dev)
427 if (pci_enable_device(dev->pci)) 449 if (pci_enable_device(dev->pci))
428 return -EIO; 450 return -EIO;
429 pci_set_master(dev->pci); 451 pci_set_master(dev->pci);
430 if (!pci_dma_supported(dev->pci,0xffffffff)) { 452 if (!pci_dma_supported(dev->pci,DMA_32BIT_MASK)) {
431 printk("%s/2: Oops: no 32bit PCI DMA ???\n",dev->core->name); 453 printk("%s/2: Oops: no 32bit PCI DMA ???\n",dev->core->name);
432 return -EIO; 454 return -EIO;
433 } 455 }
@@ -778,6 +800,9 @@ static int __devinit cx8802_probe(struct pci_dev *pci_dev,
778 800
779 /* Maintain a reference so cx88-video can query the 8802 device. */ 801 /* Maintain a reference so cx88-video can query the 8802 device. */
780 core->dvbdev = dev; 802 core->dvbdev = dev;
803
804 /* now autoload cx88-dvb or cx88-blackbird */
805 request_modules(dev);
781 return 0; 806 return 0;
782 807
783 fail_free: 808 fail_free:
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index bdfe2af70124..fbce1d50578b 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -1555,7 +1555,8 @@ static void cx8800_vid_irq(struct cx8800_dev *dev)
1555 cx_write(MO_VID_INTSTAT, status); 1555 cx_write(MO_VID_INTSTAT, status);
1556 if (irq_debug || (status & mask & ~0xff)) 1556 if (irq_debug || (status & mask & ~0xff))
1557 cx88_print_irqbits(core->name, "irq vid", 1557 cx88_print_irqbits(core->name, "irq vid",
1558 cx88_vid_irqs, status, mask); 1558 cx88_vid_irqs, ARRAY_SIZE(cx88_vid_irqs),
1559 status, mask);
1559 1560
1560 /* risc op code error */ 1561 /* risc op code error */
1561 if (status & (1 << 16)) { 1562 if (status & (1 << 16)) {
@@ -1778,7 +1779,7 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
1778 dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0)); 1779 dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
1779 1780
1780 pci_set_master(pci_dev); 1781 pci_set_master(pci_dev);
1781 if (!pci_dma_supported(pci_dev,0xffffffff)) { 1782 if (!pci_dma_supported(pci_dev,DMA_32BIT_MASK)) {
1782 printk("%s/0: Oops: no 32bit PCI DMA ???\n",core->name); 1783 printk("%s/0: Oops: no 32bit PCI DMA ???\n",core->name);
1783 err = -EIO; 1784 err = -EIO;
1784 goto fail_core; 1785 goto fail_core;
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index a4f7befda5b0..738d4f20c580 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -481,6 +481,8 @@ struct cx8802_dev {
481 481
482 /* List of attached drivers */ 482 /* List of attached drivers */
483 struct cx8802_driver drvlist; 483 struct cx8802_driver drvlist;
484 struct work_struct request_module_wk;
485
484}; 486};
485 487
486/* ----------------------------------------------------------- */ 488/* ----------------------------------------------------------- */
@@ -510,7 +512,7 @@ struct cx8802_dev {
510/* cx88-core.c */ 512/* cx88-core.c */
511 513
512extern void cx88_print_irqbits(char *name, char *tag, char **strings, 514extern void cx88_print_irqbits(char *name, char *tag, char **strings,
513 u32 bits, u32 mask); 515 int len, u32 bits, u32 mask);
514 516
515extern int cx88_core_irq(struct cx88_core *core, u32 status); 517extern int cx88_core_irq(struct cx88_core *core, u32 status);
516extern void cx88_wakeup(struct cx88_core *core, 518extern void cx88_wakeup(struct cx88_core *core,