diff options
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-dvb.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-dvb.c | 41 |
1 files changed, 40 insertions, 1 deletions
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 | ||
48 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); | 48 | MODULE_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 | ||
116 | static 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 | |||
116 | static int mt352_pinnacle_pll_set(struct dvb_frontend* fe, | 134 | static 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 | ||
163 | static 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 | |||
145 | static struct mt352_config pinnacle_300i = { | 172 | static 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 | |||
181 | static 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: |