aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx23885/cx23885-dvb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-dvb.c')
-rw-r--r--drivers/media/video/cx23885/cx23885-dvb.c105
1 files changed, 65 insertions, 40 deletions
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c
index 291b9d008da8..24bd18327aa0 100644
--- a/drivers/media/video/cx23885/cx23885-dvb.c
+++ b/drivers/media/video/cx23885/cx23885-dvb.c
@@ -42,6 +42,7 @@
42#include "tuner-simple.h" 42#include "tuner-simple.h"
43#include "dib7000p.h" 43#include "dib7000p.h"
44#include "dibx000_common.h" 44#include "dibx000_common.h"
45#include "zl10353.h"
45 46
46static unsigned int debug; 47static unsigned int debug;
47 48
@@ -188,13 +189,11 @@ static struct s5h1411_config dvico_s5h1411_config = {
188static struct xc5000_config hauppauge_hvr1500q_tunerconfig = { 189static struct xc5000_config hauppauge_hvr1500q_tunerconfig = {
189 .i2c_address = 0x61, 190 .i2c_address = 0x61,
190 .if_khz = 5380, 191 .if_khz = 5380,
191 .tuner_callback = cx23885_tuner_callback
192}; 192};
193 193
194static struct xc5000_config dvico_xc5000_tunerconfig = { 194static struct xc5000_config dvico_xc5000_tunerconfig = {
195 .i2c_address = 0x64, 195 .i2c_address = 0x64,
196 .if_khz = 5380, 196 .if_khz = 5380,
197 .tuner_callback = cx23885_tuner_callback
198}; 197};
199 198
200static struct tda829x_config tda829x_no_probe = { 199static struct tda829x_config tda829x_no_probe = {
@@ -303,35 +302,11 @@ static struct dib7000p_config hauppauge_hvr1400_dib7000_config = {
303 .output_mode = OUTMODE_MPEG2_SERIAL, 302 .output_mode = OUTMODE_MPEG2_SERIAL,
304}; 303};
305 304
306static int cx23885_hvr1500_xc3028_callback(void *ptr, int command, int arg) 305static struct zl10353_config dvico_fusionhdtv_xc3028 = {
307{ 306 .demod_address = 0x0f,
308 struct cx23885_tsport *port = ptr; 307 .if2 = 45600,
309 struct cx23885_dev *dev = port->dev; 308 .no_tuner = 1,
310 309};
311 switch (command) {
312 case XC2028_TUNER_RESET:
313 /* Send the tuner in then out of reset */
314 /* GPIO-2 xc3028 tuner */
315 dprintk(1, "%s: XC2028_TUNER_RESET %d\n", __func__, arg);
316
317 cx_set(GP0_IO, 0x00040000);
318 cx_clear(GP0_IO, 0x00000004);
319 msleep(5);
320
321 cx_set(GP0_IO, 0x00040004);
322 msleep(5);
323 break;
324 case XC2028_RESET_CLK:
325 dprintk(1, "%s: XC2028_RESET_CLK %d\n", __func__, arg);
326 break;
327 default:
328 dprintk(1, "%s: unknown command %d, arg %d\n", __func__,
329 command, arg);
330 return -EINVAL;
331 }
332
333 return 0;
334}
335 310
336static int dvb_register(struct cx23885_tsport *port) 311static int dvb_register(struct cx23885_tsport *port)
337{ 312{
@@ -413,8 +388,8 @@ static int dvb_register(struct cx23885_tsport *port)
413 &dev->i2c_bus[0].i2c_adap); 388 &dev->i2c_bus[0].i2c_adap);
414 if (port->dvb.frontend != NULL) 389 if (port->dvb.frontend != NULL)
415 dvb_attach(xc5000_attach, port->dvb.frontend, 390 dvb_attach(xc5000_attach, port->dvb.frontend,
416 &i2c_bus->i2c_adap, 391 &i2c_bus->i2c_adap,
417 &hauppauge_hvr1500q_tunerconfig, i2c_bus); 392 &hauppauge_hvr1500q_tunerconfig);
418 break; 393 break;
419 case CX23885_BOARD_HAUPPAUGE_HVR1500: 394 case CX23885_BOARD_HAUPPAUGE_HVR1500:
420 i2c_bus = &dev->i2c_bus[1]; 395 i2c_bus = &dev->i2c_bus[1];
@@ -426,10 +401,9 @@ static int dvb_register(struct cx23885_tsport *port)
426 struct xc2028_config cfg = { 401 struct xc2028_config cfg = {
427 .i2c_adap = &i2c_bus->i2c_adap, 402 .i2c_adap = &i2c_bus->i2c_adap,
428 .i2c_addr = 0x61, 403 .i2c_addr = 0x61,
429 .callback = cx23885_hvr1500_xc3028_callback,
430 }; 404 };
431 static struct xc2028_ctrl ctl = { 405 static struct xc2028_ctrl ctl = {
432 .fname = "xc3028-v27.fw", 406 .fname = XC2028_DEFAULT_FIRMWARE,
433 .max_len = 64, 407 .max_len = 64,
434 .scode_table = XC3028_FE_OREN538, 408 .scode_table = XC3028_FE_OREN538,
435 }; 409 };
@@ -465,13 +439,13 @@ static int dvb_register(struct cx23885_tsport *port)
465 struct xc2028_config cfg = { 439 struct xc2028_config cfg = {
466 .i2c_adap = &dev->i2c_bus[1].i2c_adap, 440 .i2c_adap = &dev->i2c_bus[1].i2c_adap,
467 .i2c_addr = 0x64, 441 .i2c_addr = 0x64,
468 .callback = cx23885_hvr1500_xc3028_callback,
469 }; 442 };
470 static struct xc2028_ctrl ctl = { 443 static struct xc2028_ctrl ctl = {
471 .fname = "xc3028L-v36.fw", 444 .fname = XC3028L_DEFAULT_FIRMWARE,
472 .max_len = 64, 445 .max_len = 64,
473 .demod = 5000, 446 .demod = 5000,
474 .d2633 = 1 447 /* This is true for all demods with v36 firmware? */
448 .type = XC2028_D2633,
475 }; 449 };
476 450
477 fe = dvb_attach(xc2028_attach, 451 fe = dvb_attach(xc2028_attach,
@@ -492,8 +466,57 @@ static int dvb_register(struct cx23885_tsport *port)
492 &i2c_bus->i2c_adap); 466 &i2c_bus->i2c_adap);
493 if (port->dvb.frontend != NULL) 467 if (port->dvb.frontend != NULL)
494 dvb_attach(xc5000_attach, port->dvb.frontend, 468 dvb_attach(xc5000_attach, port->dvb.frontend,
495 &i2c_bus->i2c_adap, 469 &i2c_bus->i2c_adap,
496 &dvico_xc5000_tunerconfig, i2c_bus); 470 &dvico_xc5000_tunerconfig);
471 break;
472 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP: {
473 i2c_bus = &dev->i2c_bus[port->nr - 1];
474
475 port->dvb.frontend = dvb_attach(zl10353_attach,
476 &dvico_fusionhdtv_xc3028,
477 &i2c_bus->i2c_adap);
478 if (port->dvb.frontend != NULL) {
479 struct dvb_frontend *fe;
480 struct xc2028_config cfg = {
481 .i2c_adap = &i2c_bus->i2c_adap,
482 .i2c_addr = 0x61,
483 };
484 static struct xc2028_ctrl ctl = {
485 .fname = XC2028_DEFAULT_FIRMWARE,
486 .max_len = 64,
487 .demod = XC3028_FE_ZARLINK456,
488 };
489
490 fe = dvb_attach(xc2028_attach, port->dvb.frontend,
491 &cfg);
492 if (fe != NULL && fe->ops.tuner_ops.set_config != NULL)
493 fe->ops.tuner_ops.set_config(fe, &ctl);
494 }
495 break;
496 }
497 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H:
498 i2c_bus = &dev->i2c_bus[0];
499
500 port->dvb.frontend = dvb_attach(zl10353_attach,
501 &dvico_fusionhdtv_xc3028,
502 &i2c_bus->i2c_adap);
503 if (port->dvb.frontend != NULL) {
504 struct dvb_frontend *fe;
505 struct xc2028_config cfg = {
506 .i2c_adap = &dev->i2c_bus[1].i2c_adap,
507 .i2c_addr = 0x61,
508 };
509 static struct xc2028_ctrl ctl = {
510 .fname = XC2028_DEFAULT_FIRMWARE,
511 .max_len = 64,
512 .demod = XC3028_FE_ZARLINK456,
513 };
514
515 fe = dvb_attach(xc2028_attach, port->dvb.frontend,
516 &cfg);
517 if (fe != NULL && fe->ops.tuner_ops.set_config != NULL)
518 fe->ops.tuner_ops.set_config(fe, &ctl);
519 }
497 break; 520 break;
498 default: 521 default:
499 printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n", 522 printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n",
@@ -504,6 +527,8 @@ static int dvb_register(struct cx23885_tsport *port)
504 printk("%s: frontend initialization failed\n", dev->name); 527 printk("%s: frontend initialization failed\n", dev->name);
505 return -1; 528 return -1;
506 } 529 }
530 /* define general-purpose callback pointer */
531 port->dvb.frontend->callback = cx23885_tuner_callback;
507 532
508 /* Put the analog decoder in standby to keep it quiet */ 533 /* Put the analog decoder in standby to keep it quiet */
509 cx23885_call_i2c_clients(i2c_bus, TUNER_SET_STANDBY, NULL); 534 cx23885_call_i2c_clients(i2c_bus, TUNER_SET_STANDBY, NULL);