diff options
author | Steven Toth <stoth@hauppauge.com> | 2008-04-22 14:38:26 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:09:45 -0400 |
commit | 6676237398d0c2e61e5a3a27e0951f60d6ef6fe3 (patch) | |
tree | a28bd067f19c707b6658a1526a3984b16a0ea9e4 /drivers/media/video/cx23885/cx23885-dvb.c | |
parent | a38d6e37c0bc073bae5eff37c939978974ea9712 (diff) |
V4L/DVB (7673): cx23885: Add support for the Hauppauge HVR1400
DVB-T mode is now supported using the DiBcom dib7000p demodulator
and the Xceive xc3028L silicon tuner. Analog mode is not supported.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Reviewed-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-dvb.c')
-rw-r--r-- | drivers/media/video/cx23885/cx23885-dvb.c | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c index 1b9a85e43d44..870d6e197d65 100644 --- a/drivers/media/video/cx23885/cx23885-dvb.c +++ b/drivers/media/video/cx23885/cx23885-dvb.c | |||
@@ -40,6 +40,8 @@ | |||
40 | #include "dvb-pll.h" | 40 | #include "dvb-pll.h" |
41 | #include "tuner-xc2028.h" | 41 | #include "tuner-xc2028.h" |
42 | #include "tuner-simple.h" | 42 | #include "tuner-simple.h" |
43 | #include "dib7000p.h" | ||
44 | #include "dibx000_common.h" | ||
43 | 45 | ||
44 | static unsigned int debug; | 46 | static unsigned int debug; |
45 | 47 | ||
@@ -189,6 +191,92 @@ static struct tda18271_config hauppauge_hvr1200_tuner_config = { | |||
189 | .gate = TDA18271_GATE_ANALOG, | 191 | .gate = TDA18271_GATE_ANALOG, |
190 | }; | 192 | }; |
191 | 193 | ||
194 | struct dibx000_agc_config xc3028_agc_config = { | ||
195 | BAND_VHF | BAND_UHF, /* band_caps */ | ||
196 | |||
197 | /* P_agc_use_sd_mod1=0, P_agc_use_sd_mod2=0, P_agc_freq_pwm_div=0, | ||
198 | * P_agc_inv_pwm1=0, P_agc_inv_pwm2=0, | ||
199 | * P_agc_inh_dc_rv_est=0, P_agc_time_est=3, P_agc_freeze=0, | ||
200 | * P_agc_nb_est=2, P_agc_write=0 | ||
201 | */ | ||
202 | (0 << 15) | (0 << 14) | (0 << 11) | (0 << 10) | (0 << 9) | (0 << 8) | | ||
203 | (3 << 5) | (0 << 4) | (2 << 1) | (0 << 0), /* setup */ | ||
204 | |||
205 | 712, /* inv_gain */ | ||
206 | 21, /* time_stabiliz */ | ||
207 | |||
208 | 0, /* alpha_level */ | ||
209 | 118, /* thlock */ | ||
210 | |||
211 | 0, /* wbd_inv */ | ||
212 | 2867, /* wbd_ref */ | ||
213 | 0, /* wbd_sel */ | ||
214 | 2, /* wbd_alpha */ | ||
215 | |||
216 | 0, /* agc1_max */ | ||
217 | 0, /* agc1_min */ | ||
218 | 39718, /* agc2_max */ | ||
219 | 9930, /* agc2_min */ | ||
220 | 0, /* agc1_pt1 */ | ||
221 | 0, /* agc1_pt2 */ | ||
222 | 0, /* agc1_pt3 */ | ||
223 | 0, /* agc1_slope1 */ | ||
224 | 0, /* agc1_slope2 */ | ||
225 | 0, /* agc2_pt1 */ | ||
226 | 128, /* agc2_pt2 */ | ||
227 | 29, /* agc2_slope1 */ | ||
228 | 29, /* agc2_slope2 */ | ||
229 | |||
230 | 17, /* alpha_mant */ | ||
231 | 27, /* alpha_exp */ | ||
232 | 23, /* beta_mant */ | ||
233 | 51, /* beta_exp */ | ||
234 | |||
235 | 1, /* perform_agc_softsplit */ | ||
236 | }; | ||
237 | |||
238 | /* PLL Configuration for COFDM BW_MHz = 8.000000 | ||
239 | * With external clock = 30.000000 */ | ||
240 | struct dibx000_bandwidth_config xc3028_bw_config = { | ||
241 | 60000, /* internal */ | ||
242 | 30000, /* sampling */ | ||
243 | 1, /* pll_cfg: prediv */ | ||
244 | 8, /* pll_cfg: ratio */ | ||
245 | 3, /* pll_cfg: range */ | ||
246 | 1, /* pll_cfg: reset */ | ||
247 | 0, /* pll_cfg: bypass */ | ||
248 | 0, /* misc: refdiv */ | ||
249 | 0, /* misc: bypclk_div */ | ||
250 | 1, /* misc: IO_CLK_en_core */ | ||
251 | 1, /* misc: ADClkSrc */ | ||
252 | 0, /* misc: modulo */ | ||
253 | (3 << 14) | (1 << 12) | (524 << 0), /* sad_cfg: refsel, sel, freq_15k */ | ||
254 | (1 << 25) | 5816102, /* ifreq = 5.200000 MHz */ | ||
255 | 20452225, /* timf */ | ||
256 | 30000000 /* xtal_hz */ | ||
257 | }; | ||
258 | |||
259 | static struct dib7000p_config hauppauge_hvr1400_dib7000_config = { | ||
260 | .output_mpeg2_in_188_bytes = 1, | ||
261 | .hostbus_diversity = 1, | ||
262 | .tuner_is_baseband = 0, | ||
263 | .update_lna = NULL, | ||
264 | |||
265 | .agc_config_count = 1, | ||
266 | .agc = &xc3028_agc_config, | ||
267 | .bw = &xc3028_bw_config, | ||
268 | |||
269 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, | ||
270 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, | ||
271 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, | ||
272 | |||
273 | .pwm_freq_div = 0, | ||
274 | .agc_control = NULL, | ||
275 | .spur_protect = 0, | ||
276 | |||
277 | .output_mode = OUTMODE_MPEG2_SERIAL, | ||
278 | }; | ||
279 | |||
192 | static int cx23885_hvr1500_xc3028_callback(void *ptr, int command, int arg) | 280 | static int cx23885_hvr1500_xc3028_callback(void *ptr, int command, int arg) |
193 | { | 281 | { |
194 | struct cx23885_tsport *port = ptr; | 282 | struct cx23885_tsport *port = ptr; |
@@ -343,6 +431,31 @@ static int dvb_register(struct cx23885_tsport *port) | |||
343 | &hauppauge_hvr1200_tuner_config); | 431 | &hauppauge_hvr1200_tuner_config); |
344 | } | 432 | } |
345 | break; | 433 | break; |
434 | case CX23885_BOARD_HAUPPAUGE_HVR1400: | ||
435 | i2c_bus = &dev->i2c_bus[0]; | ||
436 | port->dvb.frontend = dvb_attach(dib7000p_attach, | ||
437 | &i2c_bus->i2c_adap, | ||
438 | 0x12, &hauppauge_hvr1400_dib7000_config); | ||
439 | if (port->dvb.frontend != NULL) { | ||
440 | struct dvb_frontend *fe; | ||
441 | struct xc2028_config cfg = { | ||
442 | .i2c_adap = &dev->i2c_bus[1].i2c_adap, | ||
443 | .i2c_addr = 0x64, | ||
444 | .callback = cx23885_hvr1500_xc3028_callback, | ||
445 | }; | ||
446 | static struct xc2028_ctrl ctl = { | ||
447 | .fname = "xc3028L-v36.fw", | ||
448 | .max_len = 64, | ||
449 | .demod = 5000, | ||
450 | .d2633 = 1 | ||
451 | }; | ||
452 | |||
453 | fe = dvb_attach(xc2028_attach, | ||
454 | port->dvb.frontend, &cfg); | ||
455 | if (fe != NULL && fe->ops.tuner_ops.set_config != NULL) | ||
456 | fe->ops.tuner_ops.set_config(fe, &ctl); | ||
457 | } | ||
458 | break; | ||
346 | default: | 459 | default: |
347 | printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n", | 460 | printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n", |
348 | dev->name); | 461 | dev->name); |