aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx88')
-rw-r--r--drivers/media/video/cx88/cx88-cards.c63
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c36
-rw-r--r--drivers/media/video/cx88/cx88-i2c.c17
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c7
-rw-r--r--drivers/media/video/cx88/cx88.h2
5 files changed, 116 insertions, 9 deletions
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index d484e5ce579c..3ba31572c657 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -1375,6 +1375,32 @@ static const struct cx88_board cx88_boards[] = {
1375 .gpio0 = 0x07fa, 1375 .gpio0 = 0x07fa,
1376 }}, 1376 }},
1377 }, 1377 },
1378 [CX88_BOARD_PINNACLE_PCTV_HD_800i] = {
1379 .name = "Pinnacle PCTV HD 800i",
1380 .tuner_type = TUNER_XC5000,
1381 .radio_type = UNSET,
1382 .tuner_addr = ADDR_UNSET,
1383 .radio_addr = ADDR_UNSET,
1384 .input = {{
1385 .type = CX88_VMUX_TELEVISION,
1386 .vmux = 0,
1387 .gpio0 = 0x04fb,
1388 .gpio1 = 0x10ff,
1389 },{
1390 .type = CX88_VMUX_COMPOSITE1,
1391 .vmux = 1,
1392 .gpio0 = 0x04fb,
1393 .gpio1 = 0x10ef,
1394 .audioroute = 1,
1395 },{
1396 .type = CX88_VMUX_SVIDEO,
1397 .vmux = 2,
1398 .gpio0 = 0x04fb,
1399 .gpio1 = 0x10ef,
1400 .audioroute = 1,
1401 }},
1402 .mpeg = CX88_MPEG_DVB,
1403 },
1378}; 1404};
1379 1405
1380/* ------------------------------------------------------------------ */ 1406/* ------------------------------------------------------------------ */
@@ -1684,6 +1710,10 @@ static const struct cx88_subid cx88_subids[] = {
1684 .subvendor = 0x1421, 1710 .subvendor = 0x1421,
1685 .subdevice = 0x0390, 1711 .subdevice = 0x0390,
1686 .card = CX88_BOARD_ADSTECH_PTV_390, 1712 .card = CX88_BOARD_ADSTECH_PTV_390,
1713 },{
1714 .subvendor = 0x11bd,
1715 .subdevice = 0x0051,
1716 .card = CX88_BOARD_PINNACLE_PCTV_HD_800i,
1687 }, 1717 },
1688}; 1718};
1689 1719
@@ -1851,6 +1881,39 @@ static void dvico_fusionhdtv_hybrid_init(struct cx88_core *core)
1851} 1881}
1852 1882
1853/* ----------------------------------------------------------------------- */ 1883/* ----------------------------------------------------------------------- */
1884/* Tuner callback function. Currently only needed for the Pinnacle *
1885 * PCTV HD 800i with an xc5000 sillicon tuner. This is used for both *
1886 * analog tuner attach (tuner-core.c) and dvb tuner attach (cx88-dvb.c) */
1887
1888int cx88_tuner_callback(void *i2c_algo, int command, int arg)
1889{
1890 struct i2c_algo_bit_data *algo = i2c_algo;
1891 struct cx88_core *core = algo->data;
1892
1893 switch(core->boardnr) {
1894 case CX88_BOARD_PINNACLE_PCTV_HD_800i:
1895 if(command == 0) { /* This is the reset command from xc5000 */
1896 /* Reset XC5000 tuner via GPIO pin #2 */
1897 cx_set(MO_GP0_IO, 0x00000400);
1898 cx_clear(MO_GP0_IO, 0x00000004);
1899 mdelay(200);
1900 cx_set(MO_GP0_IO, 0x00000004);
1901 printk(KERN_ERR "xc5000: in reset for xc5000\n");
1902 mdelay(200);
1903 return 0;
1904 }
1905 else {
1906 printk(KERN_ERR
1907 "xc5000: unknown tuner callback command.\n");
1908 return -EINVAL;
1909 }
1910 break;
1911 }
1912 return 0; /* Should never be here */
1913}
1914EXPORT_SYMBOL(cx88_tuner_callback);
1915
1916/* ----------------------------------------------------------------------- */
1854 1917
1855static void cx88_card_list(struct cx88_core *core, struct pci_dev *pci) 1918static void cx88_card_list(struct cx88_core *core, struct pci_dev *pci)
1856{ 1919{
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index fce19caf9d04..0246f97a9987 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -40,6 +40,8 @@
40#include "cx22702.h" 40#include "cx22702.h"
41#include "or51132.h" 41#include "or51132.h"
42#include "lgdt330x.h" 42#include "lgdt330x.h"
43#include "s5h1409.h"
44#include "xc5000.h"
43#include "nxt200x.h" 45#include "nxt200x.h"
44#include "cx24123.h" 46#include "cx24123.h"
45#include "isl6421.h" 47#include "isl6421.h"
@@ -371,6 +373,22 @@ static struct cx24123_config kworld_dvbs_100_config = {
371 .lnb_polarity = 1, 373 .lnb_polarity = 1,
372}; 374};
373 375
376static struct s5h1409_config pinnacle_pctv_hd_800i_config = {
377 .demod_address = 0x32 >> 1,
378 .output_mode = S5H1409_PARALLEL_OUTPUT,
379 .gpio = S5H1409_GPIO_ON,
380 .qam_if = 44000,
381 .inversion = S5H1409_INVERSION_OFF,
382 .status_mode = S5H1409_DEMODLOCKING,
383};
384
385static struct xc5000_config pinnacle_pctv_hd_800i_tuner_config = {
386 .i2c_address = 0x64,
387 .if_khz = 5380,
388 /* cannot set .video_dev here, do it right before attach */
389 .tuner_callback = cx88_tuner_callback,
390};
391
374static int dvb_register(struct cx8802_dev *dev) 392static int dvb_register(struct cx8802_dev *dev)
375{ 393{
376 /* init struct videobuf_dvb */ 394 /* init struct videobuf_dvb */
@@ -625,6 +643,24 @@ static int dvb_register(struct cx8802_dev *dev)
625 dev->dvb.frontend->ops.set_voltage = geniatech_dvbs_set_voltage; 643 dev->dvb.frontend->ops.set_voltage = geniatech_dvbs_set_voltage;
626 } 644 }
627 break; 645 break;
646 case CX88_BOARD_PINNACLE_PCTV_HD_800i:
647 /* Parallel mpeg data port and punctured clock mode */
648 dev->ts_gen_cntrl = 0x04;
649
650 dev->dvb.frontend = dvb_attach(s5h1409_attach,
651 &pinnacle_pctv_hd_800i_config,
652 &dev->core->i2c_adap);
653 if (dev->dvb.frontend != NULL) {
654 /* tuner_config.video_dev must point to
655 * i2c_adap.algo_data
656 */
657 pinnacle_pctv_hd_800i_tuner_config.video_dev =
658 dev->core->i2c_adap.algo_data;
659 dvb_attach(xc5000_attach, dev->dvb.frontend,
660 &dev->core->i2c_adap,
661 &pinnacle_pctv_hd_800i_tuner_config);
662 }
663 break;
628 default: 664 default:
629 printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n", 665 printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n",
630 dev->core->name); 666 dev->core->name);
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index 937497c86247..566b26af523e 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -109,20 +109,20 @@ static int attach_inform(struct i2c_client *client)
109 109
110 if (core->board.radio_type != UNSET) { 110 if (core->board.radio_type != UNSET) {
111 if ((core->board.radio_addr==ADDR_UNSET)||(core->board.radio_addr==client->addr)) { 111 if ((core->board.radio_addr==ADDR_UNSET)||(core->board.radio_addr==client->addr)) {
112 tun_setup.mode_mask = T_RADIO; 112 tun_setup.mode_mask = T_RADIO;
113 tun_setup.type = core->board.radio_type; 113 tun_setup.type = core->board.radio_type;
114 tun_setup.addr = core->board.radio_addr; 114 tun_setup.addr = core->board.radio_addr;
115 115 tun_setup.tuner_callback = cx88_tuner_callback;
116 client->driver->command (client, TUNER_SET_TYPE_ADDR, &tun_setup); 116 client->driver->command (client, TUNER_SET_TYPE_ADDR, &tun_setup);
117 } 117 }
118 } 118 }
119 if (core->board.tuner_type != UNSET) { 119 if (core->board.tuner_type != UNSET) {
120 if ((core->board.tuner_addr==ADDR_UNSET)||(core->board.tuner_addr==client->addr)) { 120 if ((core->board.tuner_addr==ADDR_UNSET)||(core->board.tuner_addr==client->addr)) {
121 121
122 tun_setup.mode_mask = T_ANALOG_TV; 122 tun_setup.mode_mask = T_ANALOG_TV;
123 tun_setup.type = core->board.tuner_type; 123 tun_setup.type = core->board.tuner_type;
124 tun_setup.addr = core->board.tuner_addr; 124 tun_setup.addr = core->board.tuner_addr;
125 125 tun_setup.tuner_callback = cx88_tuner_callback;
126 client->driver->command (client,TUNER_SET_TYPE_ADDR, &tun_setup); 126 client->driver->command (client,TUNER_SET_TYPE_ADDR, &tun_setup);
127 } 127 }
128 } 128 }
@@ -182,6 +182,7 @@ static char *i2c_devs[128] = {
182 [ 0xa0 >> 1 ] = "eeprom", 182 [ 0xa0 >> 1 ] = "eeprom",
183 [ 0xc0 >> 1 ] = "tuner (analog)", 183 [ 0xc0 >> 1 ] = "tuner (analog)",
184 [ 0xc2 >> 1 ] = "tuner (analog/dvb)", 184 [ 0xc2 >> 1 ] = "tuner (analog/dvb)",
185 [ 0xc8 >> 1 ] = "xc5000",
185}; 186};
186 187
187static void do_i2c_scan(char *name, struct i2c_client *c) 188static void do_i2c_scan(char *name, struct i2c_client *c)
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c
index 339a88a64f54..a21b50357a89 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -102,7 +102,7 @@ static int cx8802_start_dma(struct cx8802_dev *dev,
102 cx_write(TS_GEN_CNTRL, 0x0040 | dev->ts_gen_cntrl); 102 cx_write(TS_GEN_CNTRL, 0x0040 | dev->ts_gen_cntrl);
103 udelay(100); 103 udelay(100);
104 cx_write(MO_PINMUX_IO, 0x00); 104 cx_write(MO_PINMUX_IO, 0x00);
105 cx_write(TS_HW_SOP_CNTRL,0x47<<16|188<<4|0x01); 105 cx_write(TS_HW_SOP_CNTRL, 0x47<<16|188<<4|0x01);
106 switch (core->boardnr) { 106 switch (core->boardnr) {
107 case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q: 107 case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q:
108 case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T: 108 case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T:
@@ -117,6 +117,11 @@ static int cx8802_start_dma(struct cx8802_dev *dev,
117 break; 117 break;
118 case CX88_BOARD_HAUPPAUGE_HVR1300: 118 case CX88_BOARD_HAUPPAUGE_HVR1300:
119 break; 119 break;
120 case CX88_BOARD_PINNACLE_PCTV_HD_800i:
121 /* Enable MPEG parallel port */
122 cx_write(MO_PINMUX_IO, 0x80);
123 udelay(100);
124 break;
120 default: 125 default:
121 cx_write(TS_SOP_STAT, 0x00); 126 cx_write(TS_SOP_STAT, 0x00);
122 break; 127 break;
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index 0cd2946a2789..4e823f2a539a 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -210,6 +210,7 @@ extern struct sram_channel cx88_sram_channels[];
210#define CX88_BOARD_TE_DTV_250_OEM_SWANN 55 210#define CX88_BOARD_TE_DTV_250_OEM_SWANN 55
211#define CX88_BOARD_HAUPPAUGE_HVR1300 56 211#define CX88_BOARD_HAUPPAUGE_HVR1300 56
212#define CX88_BOARD_ADSTECH_PTV_390 57 212#define CX88_BOARD_ADSTECH_PTV_390 57
213#define CX88_BOARD_PINNACLE_PCTV_HD_800i 58
213 214
214enum cx88_itype { 215enum cx88_itype {
215 CX88_VMUX_COMPOSITE1 = 1, 216 CX88_VMUX_COMPOSITE1 = 1,
@@ -589,6 +590,7 @@ extern void cx88_call_i2c_clients(struct cx88_core *core,
589/* ----------------------------------------------------------- */ 590/* ----------------------------------------------------------- */
590/* cx88-cards.c */ 591/* cx88-cards.c */
591 592
593extern int cx88_tuner_callback(void *dev, int command, int arg);
592extern int cx88_get_resources(const struct cx88_core *core, 594extern int cx88_get_resources(const struct cx88_core *core,
593 struct pci_dev *pci); 595 struct pci_dev *pci);
594extern struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr); 596extern struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr);