aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134
diff options
context:
space:
mode:
authorJose Alberto Reguero <jareguero@telefonica.net>2006-02-07 03:25:14 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-02-07 03:25:14 -0500
commita78d0bfabda67dd40a5a97ba4c24265e1820e7ea (patch)
tree9b35e9afdbbbd15cdc5cbe742da2743f6e97f317 /drivers/media/video/saa7134
parent17801f5fa2e31b60f26aadd7ba41395dd1b1093e (diff)
V4L/DVB (3267): Add support for the Avermedia 777 DVB-T card
Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net> Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7134')
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c24
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c41
-rw-r--r--drivers/media/video/saa7134/saa7134.h1
3 files changed, 65 insertions, 1 deletions
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index 5a35d3b6550d..3f964ed7eb56 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -2619,6 +2619,24 @@ struct saa7134_board saa7134_boards[] = {
2619 .gpio = 0x000000, /* GPIO21=Low for FM radio antenna */ 2619 .gpio = 0x000000, /* GPIO21=Low for FM radio antenna */
2620 }, 2620 },
2621 }, 2621 },
2622 [SAA7134_BOARD_AVERMEDIA_777] = {
2623 .name = "AverTV DVB-T 777",
2624 .audio_clock = 0x00187de7,
2625 .tuner_type = TUNER_ABSENT,
2626 .radio_type = UNSET,
2627 .tuner_addr = ADDR_UNSET,
2628 .radio_addr = ADDR_UNSET,
2629 .mpeg = SAA7134_MPEG_DVB,
2630 .inputs = {{
2631 .name = name_comp1,
2632 .vmux = 0,
2633 .amux = LINE1,
2634 },{
2635 .name = name_svideo,
2636 .vmux = 8,
2637 .amux = LINE1,
2638 }},
2639 },
2622}; 2640};
2623 2641
2624const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); 2642const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards);
@@ -3090,6 +3108,12 @@ struct pci_device_id saa7134_pci_tbl[] = {
3090 .subdevice = 0x0319, 3108 .subdevice = 0x0319,
3091 .driver_data = SAA7134_BOARD_FLYDVB_TRIO, 3109 .driver_data = SAA7134_BOARD_FLYDVB_TRIO,
3092 },{ 3110 },{
3111 .vendor = PCI_VENDOR_ID_PHILIPS,
3112 .device = PCI_DEVICE_ID_PHILIPS_SAA7134, /* SAA 7131E */
3113 .subvendor = 0x1461,
3114 .subdevice = 0x2c05,
3115 .driver_data = SAA7134_BOARD_AVERMEDIA_777,
3116 },{
3093 /* --- boards without eeprom + subsystem ID --- */ 3117 /* --- boards without eeprom + subsystem ID --- */
3094 .vendor = PCI_VENDOR_ID_PHILIPS, 3118 .vendor = PCI_VENDOR_ID_PHILIPS,
3095 .device = PCI_DEVICE_ID_PHILIPS_SAA7134, 3119 .device = PCI_DEVICE_ID_PHILIPS_SAA7134,
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 1a536e865277..45b52575e16b 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -32,6 +32,7 @@
32#include "saa7134-reg.h" 32#include "saa7134-reg.h"
33#include "saa7134.h" 33#include "saa7134.h"
34#include <media/v4l2-common.h> 34#include <media/v4l2-common.h>
35#include "dvb-pll.h"
35 36
36#ifdef HAVE_MT352 37#ifdef HAVE_MT352
37# include "mt352.h" 38# include "mt352.h"
@@ -42,7 +43,6 @@
42#endif 43#endif
43#ifdef HAVE_NXT200X 44#ifdef HAVE_NXT200X
44# include "nxt200x.h" 45# include "nxt200x.h"
45# include "dvb-pll.h"
46#endif 46#endif
47 47
48MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); 48MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
@@ -113,6 +113,24 @@ static int mt352_pinnacle_init(struct dvb_frontend* fe)
113 return 0; 113 return 0;
114} 114}
115 115
116static int mt352_aver777_init(struct dvb_frontend* fe)
117{
118 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x2d };
119 static u8 reset [] = { RESET, 0x80 };
120 static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
121 static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0xa0 };
122 static u8 capt_range_cfg[] = { CAPT_RANGE, 0x33 };
123
124 mt352_write(fe, clock_config, sizeof(clock_config));
125 udelay(200);
126 mt352_write(fe, reset, sizeof(reset));
127 mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
128 mt352_write(fe, agc_cfg, sizeof(agc_cfg));
129 mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
130
131 return 0;
132}
133
116static int mt352_pinnacle_pll_set(struct dvb_frontend* fe, 134static int mt352_pinnacle_pll_set(struct dvb_frontend* fe,
117 struct dvb_frontend_parameters* params, 135 struct dvb_frontend_parameters* params,
118 u8* pllbuf) 136 u8* pllbuf)
@@ -142,6 +160,15 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe,
142 return 0; 160 return 0;
143} 161}
144 162
163static int mt352_aver777_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params, u8* pllbuf)
164{
165 pllbuf[0] = 0xc2;
166 dvb_pll_configure(&dvb_pll_philips_td1316, pllbuf+1,
167 params->frequency,
168 params->u.ofdm.bandwidth);
169 return 0;
170}
171
145static struct mt352_config pinnacle_300i = { 172static struct mt352_config pinnacle_300i = {
146 .demod_address = 0x3c >> 1, 173 .demod_address = 0x3c >> 1,
147 .adc_clock = 20333, 174 .adc_clock = 20333,
@@ -150,6 +177,12 @@ static struct mt352_config pinnacle_300i = {
150 .demod_init = mt352_pinnacle_init, 177 .demod_init = mt352_pinnacle_init,
151 .pll_set = mt352_pinnacle_pll_set, 178 .pll_set = mt352_pinnacle_pll_set,
152}; 179};
180
181static struct mt352_config avermedia_777 = {
182 .demod_address = 0xf,
183 .demod_init = mt352_aver777_init,
184 .pll_set = mt352_aver777_pll_set,
185};
153#endif 186#endif
154 187
155/* ------------------------------------------------------------------ */ 188/* ------------------------------------------------------------------ */
@@ -847,6 +880,12 @@ static int dvb_init(struct saa7134_dev *dev)
847 dev->dvb.frontend = mt352_attach(&pinnacle_300i, 880 dev->dvb.frontend = mt352_attach(&pinnacle_300i,
848 &dev->i2c_adap); 881 &dev->i2c_adap);
849 break; 882 break;
883
884 case SAA7134_BOARD_AVERMEDIA_777:
885 printk("%s: avertv 777 dvb setup\n",dev->name);
886 dev->dvb.frontend = mt352_attach(&avermedia_777,
887 &dev->i2c_adap);
888 break;
850#endif 889#endif
851#ifdef HAVE_TDA1004X 890#ifdef HAVE_TDA1004X
852 case SAA7134_BOARD_MD7134: 891 case SAA7134_BOARD_MD7134:
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
index 3261d8bebdd1..3b8f466c7e17 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -210,6 +210,7 @@ struct saa7134_format {
210#define SAA7134_BOARD_MSI_TVATANYWHERE_PLUS 82 210#define SAA7134_BOARD_MSI_TVATANYWHERE_PLUS 82
211#define SAA7134_BOARD_CINERGY250PCI 83 211#define SAA7134_BOARD_CINERGY250PCI 83
212#define SAA7134_BOARD_FLYDVB_TRIO 84 212#define SAA7134_BOARD_FLYDVB_TRIO 84
213#define SAA7134_BOARD_AVERMEDIA_777 85
213 214
214#define SAA7134_MAXBOARDS 8 215#define SAA7134_MAXBOARDS 8
215#define SAA7134_INPUT_MAX 8 216#define SAA7134_INPUT_MAX 8