diff options
Diffstat (limited to 'drivers/media/video/cx88/cx88-dvb.c')
-rw-r--r-- | drivers/media/video/cx88/cx88-dvb.c | 330 |
1 files changed, 154 insertions, 176 deletions
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index afde3789d702..c87041dee21e 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c | |||
@@ -33,32 +33,18 @@ | |||
33 | #include "dvb-pll.h" | 33 | #include "dvb-pll.h" |
34 | #include <media/v4l2-common.h> | 34 | #include <media/v4l2-common.h> |
35 | 35 | ||
36 | #ifdef HAVE_MT352 | 36 | #include "mt352.h" |
37 | # include "mt352.h" | 37 | #include "mt352_priv.h" |
38 | # include "mt352_priv.h" | 38 | #ifdef HAVE_VP3054_I2C |
39 | # ifdef HAVE_VP3054_I2C | 39 | # include "cx88-vp3054-i2c.h" |
40 | # include "cx88-vp3054-i2c.h" | ||
41 | # endif | ||
42 | #endif | ||
43 | #ifdef HAVE_ZL10353 | ||
44 | # include "zl10353.h" | ||
45 | #endif | ||
46 | #ifdef HAVE_CX22702 | ||
47 | # include "cx22702.h" | ||
48 | #endif | ||
49 | #ifdef HAVE_OR51132 | ||
50 | # include "or51132.h" | ||
51 | #endif | ||
52 | #ifdef HAVE_LGDT330X | ||
53 | # include "lgdt330x.h" | ||
54 | # include "lg_h06xf.h" | ||
55 | #endif | ||
56 | #ifdef HAVE_NXT200X | ||
57 | # include "nxt200x.h" | ||
58 | #endif | ||
59 | #ifdef HAVE_CX24123 | ||
60 | # include "cx24123.h" | ||
61 | #endif | 40 | #endif |
41 | #include "zl10353.h" | ||
42 | #include "cx22702.h" | ||
43 | #include "or51132.h" | ||
44 | #include "lgdt330x.h" | ||
45 | #include "lg_h06xf.h" | ||
46 | #include "nxt200x.h" | ||
47 | #include "cx24123.h" | ||
62 | #include "isl6421.h" | 48 | #include "isl6421.h" |
63 | 49 | ||
64 | MODULE_DESCRIPTION("driver for cx2388x based DVB cards"); | 50 | MODULE_DESCRIPTION("driver for cx2388x based DVB cards"); |
@@ -114,8 +100,6 @@ static struct videobuf_queue_ops dvb_qops = { | |||
114 | }; | 100 | }; |
115 | 101 | ||
116 | /* ------------------------------------------------------------------ */ | 102 | /* ------------------------------------------------------------------ */ |
117 | |||
118 | #ifdef HAVE_MT352 | ||
119 | static int dvico_fusionhdtv_demod_init(struct dvb_frontend* fe) | 103 | static int dvico_fusionhdtv_demod_init(struct dvb_frontend* fe) |
120 | { | 104 | { |
121 | static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x39 }; | 105 | static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x39 }; |
@@ -181,7 +165,7 @@ static int dntv_live_dvbt_demod_init(struct dvb_frontend* fe) | |||
181 | } | 165 | } |
182 | 166 | ||
183 | static struct mt352_config dvico_fusionhdtv = { | 167 | static struct mt352_config dvico_fusionhdtv = { |
184 | .demod_address = 0x0F, | 168 | .demod_address = 0x0f, |
185 | .demod_init = dvico_fusionhdtv_demod_init, | 169 | .demod_init = dvico_fusionhdtv_demod_init, |
186 | }; | 170 | }; |
187 | 171 | ||
@@ -191,7 +175,7 @@ static struct mt352_config dntv_live_dvbt_config = { | |||
191 | }; | 175 | }; |
192 | 176 | ||
193 | static struct mt352_config dvico_fusionhdtv_dual = { | 177 | static struct mt352_config dvico_fusionhdtv_dual = { |
194 | .demod_address = 0x0F, | 178 | .demod_address = 0x0f, |
195 | .demod_init = dvico_dual_demod_init, | 179 | .demod_init = dvico_dual_demod_init, |
196 | }; | 180 | }; |
197 | 181 | ||
@@ -266,8 +250,8 @@ static int dntv_live_dvbt_pro_tuner_set_params(struct dvb_frontend* fe, | |||
266 | if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) { | 250 | if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) { |
267 | 251 | ||
268 | printk(KERN_WARNING "cx88-dvb: %s error " | 252 | printk(KERN_WARNING "cx88-dvb: %s error " |
269 | "(addr %02x <- %02x, err = %i)\n", | 253 | "(addr %02x <- %02x, err = %i)\n", |
270 | __FUNCTION__, dev->core->pll_addr, buf[0], err); | 254 | __FUNCTION__, dev->core->pll_addr, buf[0], err); |
271 | if (err < 0) | 255 | if (err < 0) |
272 | return err; | 256 | return err; |
273 | else | 257 | else |
@@ -283,9 +267,7 @@ static struct mt352_config dntv_live_dvbt_pro_config = { | |||
283 | .demod_init = dntv_live_dvbt_pro_demod_init, | 267 | .demod_init = dntv_live_dvbt_pro_demod_init, |
284 | }; | 268 | }; |
285 | #endif | 269 | #endif |
286 | #endif | ||
287 | 270 | ||
288 | #ifdef HAVE_ZL10353 | ||
289 | static int dvico_hybrid_tuner_set_params(struct dvb_frontend *fe, | 271 | static int dvico_hybrid_tuner_set_params(struct dvb_frontend *fe, |
290 | struct dvb_frontend_parameters *params) | 272 | struct dvb_frontend_parameters *params) |
291 | { | 273 | { |
@@ -304,8 +286,8 @@ static int dvico_hybrid_tuner_set_params(struct dvb_frontend *fe, | |||
304 | fe->ops.i2c_gate_ctrl(fe, 1); | 286 | fe->ops.i2c_gate_ctrl(fe, 1); |
305 | if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) { | 287 | if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) { |
306 | printk(KERN_WARNING "cx88-dvb: %s error " | 288 | printk(KERN_WARNING "cx88-dvb: %s error " |
307 | "(addr %02x <- %02x, err = %i)\n", | 289 | "(addr %02x <- %02x, err = %i)\n", |
308 | __FUNCTION__, pllbuf[0], pllbuf[1], err); | 290 | __FUNCTION__, pllbuf[0], pllbuf[1], err); |
309 | if (err < 0) | 291 | if (err < 0) |
310 | return err; | 292 | return err; |
311 | else | 293 | else |
@@ -316,16 +298,14 @@ static int dvico_hybrid_tuner_set_params(struct dvb_frontend *fe, | |||
316 | } | 298 | } |
317 | 299 | ||
318 | static struct zl10353_config dvico_fusionhdtv_hybrid = { | 300 | static struct zl10353_config dvico_fusionhdtv_hybrid = { |
319 | .demod_address = 0x0F, | 301 | .demod_address = 0x0f, |
320 | .no_tuner = 1, | 302 | .no_tuner = 1, |
321 | }; | 303 | }; |
322 | 304 | ||
323 | static struct zl10353_config dvico_fusionhdtv_plus_v1_1 = { | 305 | static struct zl10353_config dvico_fusionhdtv_plus_v1_1 = { |
324 | .demod_address = 0x0F, | 306 | .demod_address = 0x0f, |
325 | }; | 307 | }; |
326 | #endif | ||
327 | 308 | ||
328 | #ifdef HAVE_CX22702 | ||
329 | static struct cx22702_config connexant_refboard_config = { | 309 | static struct cx22702_config connexant_refboard_config = { |
330 | .demod_address = 0x43, | 310 | .demod_address = 0x43, |
331 | .output_mode = CX22702_SERIAL_OUTPUT, | 311 | .output_mode = CX22702_SERIAL_OUTPUT, |
@@ -339,9 +319,11 @@ static struct cx22702_config hauppauge_hvr1100_config = { | |||
339 | .demod_address = 0x63, | 319 | .demod_address = 0x63, |
340 | .output_mode = CX22702_SERIAL_OUTPUT, | 320 | .output_mode = CX22702_SERIAL_OUTPUT, |
341 | }; | 321 | }; |
342 | #endif | 322 | static struct cx22702_config hauppauge_hvr1300_config = { |
323 | .demod_address = 0x63, | ||
324 | .output_mode = CX22702_SERIAL_OUTPUT, | ||
325 | }; | ||
343 | 326 | ||
344 | #ifdef HAVE_OR51132 | ||
345 | static int or51132_set_ts_param(struct dvb_frontend* fe, | 327 | static int or51132_set_ts_param(struct dvb_frontend* fe, |
346 | int is_punctured) | 328 | int is_punctured) |
347 | { | 329 | { |
@@ -351,12 +333,10 @@ static int or51132_set_ts_param(struct dvb_frontend* fe, | |||
351 | } | 333 | } |
352 | 334 | ||
353 | static struct or51132_config pchdtv_hd3000 = { | 335 | static struct or51132_config pchdtv_hd3000 = { |
354 | .demod_address = 0x15, | 336 | .demod_address = 0x15, |
355 | .set_ts_params = or51132_set_ts_param, | 337 | .set_ts_params = or51132_set_ts_param, |
356 | }; | 338 | }; |
357 | #endif | ||
358 | 339 | ||
359 | #ifdef HAVE_LGDT330X | ||
360 | static int lgdt3302_tuner_set_params(struct dvb_frontend* fe, | 340 | static int lgdt3302_tuner_set_params(struct dvb_frontend* fe, |
361 | struct dvb_frontend_parameters* params) | 341 | struct dvb_frontend_parameters* params) |
362 | { | 342 | { |
@@ -373,14 +353,14 @@ static int lgdt3302_tuner_set_params(struct dvb_frontend* fe, | |||
373 | 353 | ||
374 | dvb_pll_configure(core->pll_desc, buf, params->frequency, 0); | 354 | dvb_pll_configure(core->pll_desc, buf, params->frequency, 0); |
375 | dprintk(1, "%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n", | 355 | dprintk(1, "%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n", |
376 | __FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]); | 356 | __FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]); |
377 | 357 | ||
378 | if (fe->ops.i2c_gate_ctrl) | 358 | if (fe->ops.i2c_gate_ctrl) |
379 | fe->ops.i2c_gate_ctrl(fe, 1); | 359 | fe->ops.i2c_gate_ctrl(fe, 1); |
380 | if ((err = i2c_transfer(&core->i2c_adap, &msg, 1)) != 1) { | 360 | if ((err = i2c_transfer(&core->i2c_adap, &msg, 1)) != 1) { |
381 | printk(KERN_WARNING "cx88-dvb: %s error " | 361 | printk(KERN_WARNING "cx88-dvb: %s error " |
382 | "(addr %02x <- %02x, err = %i)\n", | 362 | "(addr %02x <- %02x, err = %i)\n", |
383 | __FUNCTION__, buf[0], buf[1], err); | 363 | __FUNCTION__, buf[0], buf[1], err); |
384 | if (err < 0) | 364 | if (err < 0) |
385 | return err; | 365 | return err; |
386 | else | 366 | else |
@@ -425,28 +405,26 @@ static int lgdt330x_set_ts_param(struct dvb_frontend* fe, int is_punctured) | |||
425 | } | 405 | } |
426 | 406 | ||
427 | static struct lgdt330x_config fusionhdtv_3_gold = { | 407 | static struct lgdt330x_config fusionhdtv_3_gold = { |
428 | .demod_address = 0x0e, | 408 | .demod_address = 0x0e, |
429 | .demod_chip = LGDT3302, | 409 | .demod_chip = LGDT3302, |
430 | .serial_mpeg = 0x04, /* TPSERIAL for 3302 in TOP_CONTROL */ | 410 | .serial_mpeg = 0x04, /* TPSERIAL for 3302 in TOP_CONTROL */ |
431 | .set_ts_params = lgdt330x_set_ts_param, | 411 | .set_ts_params = lgdt330x_set_ts_param, |
432 | }; | 412 | }; |
433 | 413 | ||
434 | static struct lgdt330x_config fusionhdtv_5_gold = { | 414 | static struct lgdt330x_config fusionhdtv_5_gold = { |
435 | .demod_address = 0x0e, | 415 | .demod_address = 0x0e, |
436 | .demod_chip = LGDT3303, | 416 | .demod_chip = LGDT3303, |
437 | .serial_mpeg = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */ | 417 | .serial_mpeg = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */ |
438 | .set_ts_params = lgdt330x_set_ts_param, | 418 | .set_ts_params = lgdt330x_set_ts_param, |
439 | }; | 419 | }; |
440 | 420 | ||
441 | static struct lgdt330x_config pchdtv_hd5500 = { | 421 | static struct lgdt330x_config pchdtv_hd5500 = { |
442 | .demod_address = 0x59, | 422 | .demod_address = 0x59, |
443 | .demod_chip = LGDT3303, | 423 | .demod_chip = LGDT3303, |
444 | .serial_mpeg = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */ | 424 | .serial_mpeg = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */ |
445 | .set_ts_params = lgdt330x_set_ts_param, | 425 | .set_ts_params = lgdt330x_set_ts_param, |
446 | }; | 426 | }; |
447 | #endif | ||
448 | 427 | ||
449 | #ifdef HAVE_NXT200X | ||
450 | static int nxt200x_set_ts_param(struct dvb_frontend* fe, | 428 | static int nxt200x_set_ts_param(struct dvb_frontend* fe, |
451 | int is_punctured) | 429 | int is_punctured) |
452 | { | 430 | { |
@@ -465,28 +443,27 @@ static int nxt200x_set_pll_input(u8* buf, int input) | |||
465 | } | 443 | } |
466 | 444 | ||
467 | static struct nxt200x_config ati_hdtvwonder = { | 445 | static struct nxt200x_config ati_hdtvwonder = { |
468 | .demod_address = 0x0a, | 446 | .demod_address = 0x0a, |
469 | .set_pll_input = nxt200x_set_pll_input, | 447 | .set_pll_input = nxt200x_set_pll_input, |
470 | .set_ts_params = nxt200x_set_ts_param, | 448 | .set_ts_params = nxt200x_set_ts_param, |
471 | }; | 449 | }; |
472 | #endif | ||
473 | 450 | ||
474 | #ifdef HAVE_CX24123 | ||
475 | static int cx24123_set_ts_param(struct dvb_frontend* fe, | 451 | static int cx24123_set_ts_param(struct dvb_frontend* fe, |
476 | int is_punctured) | 452 | int is_punctured) |
477 | { | 453 | { |
478 | struct cx8802_dev *dev= fe->dvb->priv; | 454 | struct cx8802_dev *dev= fe->dvb->priv; |
479 | dev->ts_gen_cntrl = 0x2; | 455 | dev->ts_gen_cntrl = 0x02; |
480 | return 0; | 456 | return 0; |
481 | } | 457 | } |
482 | 458 | ||
483 | static int kworld_dvbs_100_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage) | 459 | static int kworld_dvbs_100_set_voltage(struct dvb_frontend* fe, |
460 | fe_sec_voltage_t voltage) | ||
484 | { | 461 | { |
485 | struct cx8802_dev *dev= fe->dvb->priv; | 462 | struct cx8802_dev *dev= fe->dvb->priv; |
486 | struct cx88_core *core = dev->core; | 463 | struct cx88_core *core = dev->core; |
487 | 464 | ||
488 | if (voltage == SEC_VOLTAGE_OFF) { | 465 | if (voltage == SEC_VOLTAGE_OFF) { |
489 | cx_write(MO_GP0_IO, 0x000006fB); | 466 | cx_write(MO_GP0_IO, 0x000006fb); |
490 | } else { | 467 | } else { |
491 | cx_write(MO_GP0_IO, 0x000006f9); | 468 | cx_write(MO_GP0_IO, 0x000006f9); |
492 | } | 469 | } |
@@ -496,7 +473,8 @@ static int kworld_dvbs_100_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t | |||
496 | return 0; | 473 | return 0; |
497 | } | 474 | } |
498 | 475 | ||
499 | static int geniatech_dvbs_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) | 476 | static int geniatech_dvbs_set_voltage(struct dvb_frontend *fe, |
477 | fe_sec_voltage_t voltage) | ||
500 | { | 478 | { |
501 | struct cx8802_dev *dev= fe->dvb->priv; | 479 | struct cx8802_dev *dev= fe->dvb->priv; |
502 | struct cx88_core *core = dev->core; | 480 | struct cx88_core *core = dev->core; |
@@ -512,20 +490,20 @@ static int geniatech_dvbs_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t | |||
512 | } | 490 | } |
513 | 491 | ||
514 | static struct cx24123_config geniatech_dvbs_config = { | 492 | static struct cx24123_config geniatech_dvbs_config = { |
515 | .demod_address = 0x55, | 493 | .demod_address = 0x55, |
516 | .set_ts_params = cx24123_set_ts_param, | 494 | .set_ts_params = cx24123_set_ts_param, |
517 | }; | 495 | }; |
518 | 496 | ||
519 | static struct cx24123_config hauppauge_novas_config = { | 497 | static struct cx24123_config hauppauge_novas_config = { |
520 | .demod_address = 0x55, | 498 | .demod_address = 0x55, |
521 | .set_ts_params = cx24123_set_ts_param, | 499 | .set_ts_params = cx24123_set_ts_param, |
522 | }; | 500 | }; |
523 | 501 | ||
524 | static struct cx24123_config kworld_dvbs_100_config = { | 502 | static struct cx24123_config kworld_dvbs_100_config = { |
525 | .demod_address = 0x15, | 503 | .demod_address = 0x15, |
526 | .set_ts_params = cx24123_set_ts_param, | 504 | .set_ts_params = cx24123_set_ts_param, |
505 | .lnb_polarity = 1, | ||
527 | }; | 506 | }; |
528 | #endif | ||
529 | 507 | ||
530 | static int dvb_register(struct cx8802_dev *dev) | 508 | static int dvb_register(struct cx8802_dev *dev) |
531 | { | 509 | { |
@@ -535,114 +513,114 @@ static int dvb_register(struct cx8802_dev *dev) | |||
535 | 513 | ||
536 | /* init frontend */ | 514 | /* init frontend */ |
537 | switch (dev->core->board) { | 515 | switch (dev->core->board) { |
538 | #ifdef HAVE_CX22702 | ||
539 | case CX88_BOARD_HAUPPAUGE_DVB_T1: | 516 | case CX88_BOARD_HAUPPAUGE_DVB_T1: |
540 | dev->dvb.frontend = cx22702_attach(&hauppauge_novat_config, | 517 | dev->dvb.frontend = dvb_attach(cx22702_attach, |
541 | &dev->core->i2c_adap); | 518 | &hauppauge_novat_config, |
519 | &dev->core->i2c_adap); | ||
542 | if (dev->dvb.frontend != NULL) { | 520 | if (dev->dvb.frontend != NULL) { |
543 | dvb_pll_attach(dev->dvb.frontend, 0x61, | 521 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
544 | &dev->core->i2c_adap, | 522 | &dev->core->i2c_adap, |
545 | &dvb_pll_thomson_dtt759x); | 523 | &dvb_pll_thomson_dtt759x); |
546 | } | 524 | } |
547 | break; | 525 | break; |
548 | case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1: | 526 | case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1: |
549 | case CX88_BOARD_CONEXANT_DVB_T1: | 527 | case CX88_BOARD_CONEXANT_DVB_T1: |
550 | case CX88_BOARD_KWORLD_DVB_T_CX22702: | 528 | case CX88_BOARD_KWORLD_DVB_T_CX22702: |
551 | case CX88_BOARD_WINFAST_DTV1000: | 529 | case CX88_BOARD_WINFAST_DTV1000: |
552 | dev->dvb.frontend = cx22702_attach(&connexant_refboard_config, | 530 | dev->dvb.frontend = dvb_attach(cx22702_attach, |
553 | &dev->core->i2c_adap); | 531 | &connexant_refboard_config, |
532 | &dev->core->i2c_adap); | ||
554 | if (dev->dvb.frontend != NULL) { | 533 | if (dev->dvb.frontend != NULL) { |
555 | dvb_pll_attach(dev->dvb.frontend, 0x60, | 534 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60, |
556 | &dev->core->i2c_adap, | 535 | &dev->core->i2c_adap, |
557 | &dvb_pll_thomson_dtt7579); | 536 | &dvb_pll_thomson_dtt7579); |
558 | } | 537 | } |
559 | break; | 538 | break; |
560 | case CX88_BOARD_WINFAST_DTV2000H: | 539 | case CX88_BOARD_WINFAST_DTV2000H: |
561 | case CX88_BOARD_HAUPPAUGE_HVR1100: | 540 | case CX88_BOARD_HAUPPAUGE_HVR1100: |
562 | case CX88_BOARD_HAUPPAUGE_HVR1100LP: | 541 | case CX88_BOARD_HAUPPAUGE_HVR1100LP: |
563 | dev->dvb.frontend = cx22702_attach(&hauppauge_hvr1100_config, | 542 | dev->dvb.frontend = dvb_attach(cx22702_attach, |
564 | &dev->core->i2c_adap); | 543 | &hauppauge_hvr1100_config, |
544 | &dev->core->i2c_adap); | ||
565 | if (dev->dvb.frontend != NULL) { | 545 | if (dev->dvb.frontend != NULL) { |
566 | dvb_pll_attach(dev->dvb.frontend, 0x61, | 546 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
567 | &dev->core->i2c_adap, | 547 | &dev->core->i2c_adap, |
568 | &dvb_pll_fmd1216me); | 548 | &dvb_pll_fmd1216me); |
549 | } | ||
550 | break; | ||
551 | case CX88_BOARD_HAUPPAUGE_HVR1300: | ||
552 | dev->dvb.frontend = dvb_attach(cx22702_attach, | ||
553 | &hauppauge_hvr1300_config, | ||
554 | &dev->core->i2c_adap); | ||
555 | if (dev->dvb.frontend != NULL) { | ||
556 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, | ||
557 | &dev->core->i2c_adap, | ||
558 | &dvb_pll_fmd1216me); | ||
569 | } | 559 | } |
570 | break; | 560 | break; |
571 | #endif | ||
572 | #if defined(HAVE_MT352) || defined(HAVE_ZL10353) | ||
573 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: | 561 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: |
574 | #ifdef HAVE_MT352 | 562 | dev->dvb.frontend = dvb_attach(mt352_attach, |
575 | dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv, | 563 | &dvico_fusionhdtv, |
576 | &dev->core->i2c_adap); | 564 | &dev->core->i2c_adap); |
577 | if (dev->dvb.frontend != NULL) { | 565 | if (dev->dvb.frontend != NULL) { |
578 | dvb_pll_attach(dev->dvb.frontend, 0x60, | 566 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60, |
579 | &dev->core->i2c_adap, | 567 | NULL, &dvb_pll_thomson_dtt7579); |
580 | &dvb_pll_thomson_dtt7579); | ||
581 | break; | 568 | break; |
582 | } | 569 | } |
583 | #endif | ||
584 | #ifdef HAVE_ZL10353 | ||
585 | /* ZL10353 replaces MT352 on later cards */ | 570 | /* ZL10353 replaces MT352 on later cards */ |
586 | dev->dvb.frontend = zl10353_attach(&dvico_fusionhdtv_plus_v1_1, | 571 | dev->dvb.frontend = dvb_attach(zl10353_attach, |
587 | &dev->core->i2c_adap); | 572 | &dvico_fusionhdtv_plus_v1_1, |
573 | &dev->core->i2c_adap); | ||
588 | if (dev->dvb.frontend != NULL) { | 574 | if (dev->dvb.frontend != NULL) { |
589 | dvb_pll_attach(dev->dvb.frontend, 0x60, | 575 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60, |
590 | &dev->core->i2c_adap, | 576 | NULL, &dvb_pll_thomson_dtt7579); |
591 | &dvb_pll_thomson_dtt7579); | ||
592 | } | 577 | } |
593 | #endif | ||
594 | break; | 578 | break; |
595 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL: | 579 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL: |
596 | #ifdef HAVE_MT352 | ||
597 | /* The tin box says DEE1601, but it seems to be DTT7579 | 580 | /* The tin box says DEE1601, but it seems to be DTT7579 |
598 | * compatible, with a slightly different MT352 AGC gain. */ | 581 | * compatible, with a slightly different MT352 AGC gain. */ |
599 | dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv_dual, | 582 | dev->dvb.frontend = dvb_attach(mt352_attach, |
600 | &dev->core->i2c_adap); | 583 | &dvico_fusionhdtv_dual, |
584 | &dev->core->i2c_adap); | ||
601 | if (dev->dvb.frontend != NULL) { | 585 | if (dev->dvb.frontend != NULL) { |
602 | dvb_pll_attach(dev->dvb.frontend, 0x61, | 586 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
603 | &dev->core->i2c_adap, | 587 | NULL, &dvb_pll_thomson_dtt7579); |
604 | &dvb_pll_thomson_dtt7579); | ||
605 | break; | 588 | break; |
606 | } | 589 | } |
607 | #endif | ||
608 | #ifdef HAVE_ZL10353 | ||
609 | /* ZL10353 replaces MT352 on later cards */ | 590 | /* ZL10353 replaces MT352 on later cards */ |
610 | dev->dvb.frontend = zl10353_attach(&dvico_fusionhdtv_plus_v1_1, | 591 | dev->dvb.frontend = dvb_attach(zl10353_attach, |
611 | &dev->core->i2c_adap); | 592 | &dvico_fusionhdtv_plus_v1_1, |
593 | &dev->core->i2c_adap); | ||
612 | if (dev->dvb.frontend != NULL) { | 594 | if (dev->dvb.frontend != NULL) { |
613 | dvb_pll_attach(dev->dvb.frontend, 0x61, | 595 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
614 | &dev->core->i2c_adap, | 596 | NULL, &dvb_pll_thomson_dtt7579); |
615 | &dvb_pll_thomson_dtt7579); | ||
616 | } | 597 | } |
617 | #endif | ||
618 | break; | 598 | break; |
619 | #endif /* HAVE_MT352 || HAVE_ZL10353 */ | ||
620 | #ifdef HAVE_MT352 | ||
621 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1: | 599 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1: |
622 | dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv, | 600 | dev->dvb.frontend = dvb_attach(mt352_attach, |
623 | &dev->core->i2c_adap); | 601 | &dvico_fusionhdtv, |
602 | &dev->core->i2c_adap); | ||
624 | if (dev->dvb.frontend != NULL) { | 603 | if (dev->dvb.frontend != NULL) { |
625 | dvb_pll_attach(dev->dvb.frontend, 0x61, | 604 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
626 | &dev->core->i2c_adap, | 605 | NULL, &dvb_pll_lg_z201); |
627 | &dvb_pll_lg_z201); | ||
628 | } | 606 | } |
629 | break; | 607 | break; |
630 | case CX88_BOARD_KWORLD_DVB_T: | 608 | case CX88_BOARD_KWORLD_DVB_T: |
631 | case CX88_BOARD_DNTV_LIVE_DVB_T: | 609 | case CX88_BOARD_DNTV_LIVE_DVB_T: |
632 | case CX88_BOARD_ADSTECH_DVB_T_PCI: | 610 | case CX88_BOARD_ADSTECH_DVB_T_PCI: |
633 | dev->dvb.frontend = mt352_attach(&dntv_live_dvbt_config, | 611 | dev->dvb.frontend = dvb_attach(mt352_attach, |
634 | &dev->core->i2c_adap); | 612 | &dntv_live_dvbt_config, |
613 | &dev->core->i2c_adap); | ||
635 | if (dev->dvb.frontend != NULL) { | 614 | if (dev->dvb.frontend != NULL) { |
636 | dvb_pll_attach(dev->dvb.frontend, 0x61, | 615 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
637 | &dev->core->i2c_adap, | 616 | NULL, &dvb_pll_unknown_1); |
638 | &dvb_pll_unknown_1); | ||
639 | } | 617 | } |
640 | break; | 618 | break; |
641 | case CX88_BOARD_DNTV_LIVE_DVB_T_PRO: | 619 | case CX88_BOARD_DNTV_LIVE_DVB_T_PRO: |
642 | #ifdef HAVE_VP3054_I2C | 620 | #ifdef HAVE_VP3054_I2C |
643 | dev->core->pll_addr = 0x61; | 621 | dev->core->pll_addr = 0x61; |
644 | dev->core->pll_desc = &dvb_pll_fmd1216me; | 622 | dev->core->pll_desc = &dvb_pll_fmd1216me; |
645 | dev->dvb.frontend = mt352_attach(&dntv_live_dvbt_pro_config, | 623 | dev->dvb.frontend = dvb_attach(mt352_attach, &dntv_live_dvbt_pro_config, |
646 | &((struct vp3054_i2c_state *)dev->card_priv)->adap); | 624 | &((struct vp3054_i2c_state *)dev->card_priv)->adap); |
647 | if (dev->dvb.frontend != NULL) { | 625 | if (dev->dvb.frontend != NULL) { |
648 | dev->dvb.frontend->ops.tuner_ops.set_params = dntv_live_dvbt_pro_tuner_set_params; | 626 | dev->dvb.frontend->ops.tuner_ops.set_params = dntv_live_dvbt_pro_tuner_set_params; |
@@ -651,30 +629,26 @@ static int dvb_register(struct cx8802_dev *dev) | |||
651 | printk("%s: built without vp3054 support\n", dev->core->name); | 629 | printk("%s: built without vp3054 support\n", dev->core->name); |
652 | #endif | 630 | #endif |
653 | break; | 631 | break; |
654 | #endif | ||
655 | #ifdef HAVE_ZL10353 | ||
656 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID: | 632 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID: |
657 | dev->core->pll_addr = 0x61; | 633 | dev->core->pll_addr = 0x61; |
658 | dev->core->pll_desc = &dvb_pll_thomson_fe6600; | 634 | dev->core->pll_desc = &dvb_pll_thomson_fe6600; |
659 | dev->dvb.frontend = zl10353_attach(&dvico_fusionhdtv_hybrid, | 635 | dev->dvb.frontend = dvb_attach(zl10353_attach, |
660 | &dev->core->i2c_adap); | 636 | &dvico_fusionhdtv_hybrid, |
637 | &dev->core->i2c_adap); | ||
661 | if (dev->dvb.frontend != NULL) { | 638 | if (dev->dvb.frontend != NULL) { |
662 | dev->dvb.frontend->ops.tuner_ops.set_params = dvico_hybrid_tuner_set_params; | 639 | dev->dvb.frontend->ops.tuner_ops.set_params = dvico_hybrid_tuner_set_params; |
663 | } | 640 | } |
664 | break; | 641 | break; |
665 | #endif | ||
666 | #ifdef HAVE_OR51132 | ||
667 | case CX88_BOARD_PCHDTV_HD3000: | 642 | case CX88_BOARD_PCHDTV_HD3000: |
668 | dev->dvb.frontend = or51132_attach(&pchdtv_hd3000, | 643 | dev->dvb.frontend = dvb_attach(or51132_attach, |
669 | &dev->core->i2c_adap); | 644 | &pchdtv_hd3000, |
645 | &dev->core->i2c_adap); | ||
670 | if (dev->dvb.frontend != NULL) { | 646 | if (dev->dvb.frontend != NULL) { |
671 | dvb_pll_attach(dev->dvb.frontend, 0x61, | 647 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
672 | &dev->core->i2c_adap, | 648 | &dev->core->i2c_adap, |
673 | &dvb_pll_thomson_dtt761x); | 649 | &dvb_pll_thomson_dtt761x); |
674 | } | 650 | } |
675 | break; | 651 | break; |
676 | #endif | ||
677 | #ifdef HAVE_LGDT330X | ||
678 | case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q: | 652 | case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q: |
679 | dev->ts_gen_cntrl = 0x08; | 653 | dev->ts_gen_cntrl = 0x08; |
680 | { | 654 | { |
@@ -690,8 +664,9 @@ static int dvb_register(struct cx8802_dev *dev) | |||
690 | fusionhdtv_3_gold.pll_rf_set = lgdt330x_pll_rf_set; | 664 | fusionhdtv_3_gold.pll_rf_set = lgdt330x_pll_rf_set; |
691 | dev->core->pll_addr = 0x61; | 665 | dev->core->pll_addr = 0x61; |
692 | dev->core->pll_desc = &dvb_pll_microtune_4042; | 666 | dev->core->pll_desc = &dvb_pll_microtune_4042; |
693 | dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_3_gold, | 667 | dev->dvb.frontend = dvb_attach(lgdt330x_attach, |
694 | &dev->core->i2c_adap); | 668 | &fusionhdtv_3_gold, |
669 | &dev->core->i2c_adap); | ||
695 | if (dev->dvb.frontend != NULL) { | 670 | if (dev->dvb.frontend != NULL) { |
696 | dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3302_tuner_set_params; | 671 | dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3302_tuner_set_params; |
697 | } | 672 | } |
@@ -709,8 +684,9 @@ static int dvb_register(struct cx8802_dev *dev) | |||
709 | mdelay(200); | 684 | mdelay(200); |
710 | dev->core->pll_addr = 0x61; | 685 | dev->core->pll_addr = 0x61; |
711 | dev->core->pll_desc = &dvb_pll_thomson_dtt761x; | 686 | dev->core->pll_desc = &dvb_pll_thomson_dtt761x; |
712 | dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_3_gold, | 687 | dev->dvb.frontend = dvb_attach(lgdt330x_attach, |
713 | &dev->core->i2c_adap); | 688 | &fusionhdtv_3_gold, |
689 | &dev->core->i2c_adap); | ||
714 | if (dev->dvb.frontend != NULL) { | 690 | if (dev->dvb.frontend != NULL) { |
715 | dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3302_tuner_set_params; | 691 | dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3302_tuner_set_params; |
716 | } | 692 | } |
@@ -726,8 +702,9 @@ static int dvb_register(struct cx8802_dev *dev) | |||
726 | mdelay(100); | 702 | mdelay(100); |
727 | cx_set(MO_GP0_IO, 1); | 703 | cx_set(MO_GP0_IO, 1); |
728 | mdelay(200); | 704 | mdelay(200); |
729 | dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_5_gold, | 705 | dev->dvb.frontend = dvb_attach(lgdt330x_attach, |
730 | &dev->core->i2c_adap); | 706 | &fusionhdtv_5_gold, |
707 | &dev->core->i2c_adap); | ||
731 | if (dev->dvb.frontend != NULL) { | 708 | if (dev->dvb.frontend != NULL) { |
732 | dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3303_tuner_set_params; | 709 | dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3303_tuner_set_params; |
733 | } | 710 | } |
@@ -743,52 +720,51 @@ static int dvb_register(struct cx8802_dev *dev) | |||
743 | mdelay(100); | 720 | mdelay(100); |
744 | cx_set(MO_GP0_IO, 1); | 721 | cx_set(MO_GP0_IO, 1); |
745 | mdelay(200); | 722 | mdelay(200); |
746 | dev->dvb.frontend = lgdt330x_attach(&pchdtv_hd5500, | 723 | dev->dvb.frontend = dvb_attach(lgdt330x_attach, |
747 | &dev->core->i2c_adap); | 724 | &pchdtv_hd5500, |
725 | &dev->core->i2c_adap); | ||
748 | if (dev->dvb.frontend != NULL) { | 726 | if (dev->dvb.frontend != NULL) { |
749 | dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3303_tuner_set_params; | 727 | dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3303_tuner_set_params; |
750 | } | 728 | } |
751 | } | 729 | } |
752 | break; | 730 | break; |
753 | #endif | ||
754 | #ifdef HAVE_NXT200X | ||
755 | case CX88_BOARD_ATI_HDTVWONDER: | 731 | case CX88_BOARD_ATI_HDTVWONDER: |
756 | dev->dvb.frontend = nxt200x_attach(&ati_hdtvwonder, | 732 | dev->dvb.frontend = dvb_attach(nxt200x_attach, |
757 | &dev->core->i2c_adap); | 733 | &ati_hdtvwonder, |
734 | &dev->core->i2c_adap); | ||
758 | if (dev->dvb.frontend != NULL) { | 735 | if (dev->dvb.frontend != NULL) { |
759 | dvb_pll_attach(dev->dvb.frontend, 0x61, | 736 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
760 | &dev->core->i2c_adap, | 737 | NULL, &dvb_pll_tuv1236d); |
761 | &dvb_pll_tuv1236d); | ||
762 | } | 738 | } |
763 | break; | 739 | break; |
764 | #endif | ||
765 | #ifdef HAVE_CX24123 | ||
766 | case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: | 740 | case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: |
767 | case CX88_BOARD_HAUPPAUGE_NOVASE2_S1: | 741 | case CX88_BOARD_HAUPPAUGE_NOVASE2_S1: |
768 | dev->dvb.frontend = cx24123_attach(&hauppauge_novas_config, | 742 | dev->dvb.frontend = dvb_attach(cx24123_attach, |
769 | &dev->core->i2c_adap); | 743 | &hauppauge_novas_config, |
744 | &dev->core->i2c_adap); | ||
770 | if (dev->dvb.frontend) { | 745 | if (dev->dvb.frontend) { |
771 | isl6421_attach(dev->dvb.frontend, &dev->core->i2c_adap, | 746 | dvb_attach(isl6421_attach, dev->dvb.frontend, |
772 | 0x08, 0x00, 0x00); | 747 | &dev->core->i2c_adap, 0x08, 0x00, 0x00); |
773 | } | 748 | } |
774 | break; | 749 | break; |
775 | case CX88_BOARD_KWORLD_DVBS_100: | 750 | case CX88_BOARD_KWORLD_DVBS_100: |
776 | dev->dvb.frontend = cx24123_attach(&kworld_dvbs_100_config, | 751 | dev->dvb.frontend = dvb_attach(cx24123_attach, |
777 | &dev->core->i2c_adap); | 752 | &kworld_dvbs_100_config, |
753 | &dev->core->i2c_adap); | ||
778 | if (dev->dvb.frontend) { | 754 | if (dev->dvb.frontend) { |
779 | dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage; | 755 | dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage; |
780 | dev->dvb.frontend->ops.set_voltage = kworld_dvbs_100_set_voltage; | 756 | dev->dvb.frontend->ops.set_voltage = kworld_dvbs_100_set_voltage; |
781 | } | 757 | } |
782 | break; | 758 | break; |
783 | case CX88_BOARD_GENIATECH_DVBS: | 759 | case CX88_BOARD_GENIATECH_DVBS: |
784 | dev->dvb.frontend = cx24123_attach(&geniatech_dvbs_config, | 760 | dev->dvb.frontend = dvb_attach(cx24123_attach, |
785 | &dev->core->i2c_adap); | 761 | &geniatech_dvbs_config, |
762 | &dev->core->i2c_adap); | ||
786 | if (dev->dvb.frontend) { | 763 | if (dev->dvb.frontend) { |
787 | dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage; | 764 | dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage; |
788 | dev->dvb.frontend->ops.set_voltage = geniatech_dvbs_set_voltage; | 765 | dev->dvb.frontend->ops.set_voltage = geniatech_dvbs_set_voltage; |
789 | } | 766 | } |
790 | break; | 767 | break; |
791 | #endif | ||
792 | default: | 768 | default: |
793 | printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n", | 769 | printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n", |
794 | dev->core->name); | 770 | dev->core->name); |
@@ -908,8 +884,10 @@ static struct pci_driver dvb_pci_driver = { | |||
908 | .id_table = cx8802_pci_tbl, | 884 | .id_table = cx8802_pci_tbl, |
909 | .probe = dvb_probe, | 885 | .probe = dvb_probe, |
910 | .remove = __devexit_p(dvb_remove), | 886 | .remove = __devexit_p(dvb_remove), |
887 | #ifdef CONFIG_PM | ||
911 | .suspend = cx8802_suspend_common, | 888 | .suspend = cx8802_suspend_common, |
912 | .resume = cx8802_resume_common, | 889 | .resume = cx8802_resume_common, |
890 | #endif | ||
913 | }; | 891 | }; |
914 | 892 | ||
915 | static int dvb_init(void) | 893 | static int dvb_init(void) |