diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-03-27 22:18:30 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:07:55 -0400 |
commit | 99e09eac25f752b25f65392da7bd747b77040fea (patch) | |
tree | 0d60bc8f498aa0d43b92f334e30771131b04dd63 /drivers/media/video/cx88/cx88-dvb.c | |
parent | a2401d9eed955d90e682b911c343d7fb4ad22436 (diff) |
V4L/DVB (7448): Add support for Kworld ATSC 120
This board has a s5h1409 demod, plus a xc30x8 tuner (probably, xc3018).
This patch adds proper support for radio, video, s-video, composite and ATSC.
However, support for radio and video depends on having s5h1409 i2c gate open,
otherwise, xc30x8 chip won't be visible.
For a better support, some rework is needed on cx88 driver, to allow adding
xc30x8 to i2c bus without sending i2c 0 byte reading to 0xc2 address.
Thanks to Vanessa Ezekowitz <vanessaezekowitz@gmail.com> for helping to figure
out the proper parameters for s5h1409 and the GPIO pins used by each
configuration.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx88/cx88-dvb.c')
-rw-r--r-- | drivers/media/video/cx88/cx88-dvb.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 8dca20b944dd..13cc395ca656 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c | |||
@@ -45,7 +45,6 @@ | |||
45 | #include "nxt200x.h" | 45 | #include "nxt200x.h" |
46 | #include "cx24123.h" | 46 | #include "cx24123.h" |
47 | #include "isl6421.h" | 47 | #include "isl6421.h" |
48 | #include "tuner-xc2028.h" | ||
49 | #include "tuner-xc2028-types.h" | 48 | #include "tuner-xc2028-types.h" |
50 | #include "tuner-simple.h" | 49 | #include "tuner-simple.h" |
51 | #include "tda9887.h" | 50 | #include "tda9887.h" |
@@ -443,6 +442,16 @@ static struct s5h1409_config dvico_hdtv5_pci_nano_config = { | |||
443 | .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK, | 442 | .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK, |
444 | }; | 443 | }; |
445 | 444 | ||
445 | static struct s5h1409_config kworld_atsc_120_config = { | ||
446 | .demod_address = 0x32 >> 1, | ||
447 | .qam_if = 44000, | ||
448 | .output_mode = S5H1409_SERIAL_OUTPUT, | ||
449 | .gpio = S5H1409_GPIO_OFF, | ||
450 | .inversion = S5H1409_INVERSION_OFF, | ||
451 | .status_mode = S5H1409_DEMODLOCKING, | ||
452 | .mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK, | ||
453 | }; | ||
454 | |||
446 | static struct xc5000_config pinnacle_pctv_hd_800i_tuner_config = { | 455 | static struct xc5000_config pinnacle_pctv_hd_800i_tuner_config = { |
447 | .i2c_address = 0x64, | 456 | .i2c_address = 0x64, |
448 | .if_khz = 5380, | 457 | .if_khz = 5380, |
@@ -457,9 +466,12 @@ static struct zl10353_config cx88_geniatech_x8000_mt = { | |||
457 | static int attach_xc3028(u8 addr, struct cx8802_dev *dev) | 466 | static int attach_xc3028(u8 addr, struct cx8802_dev *dev) |
458 | { | 467 | { |
459 | struct dvb_frontend *fe; | 468 | struct dvb_frontend *fe; |
469 | struct xc2028_ctrl ctl; | ||
460 | struct xc2028_config cfg = { | 470 | struct xc2028_config cfg = { |
461 | .i2c_adap = &dev->core->i2c_adap, | 471 | .i2c_adap = &dev->core->i2c_adap, |
462 | .i2c_addr = addr, | 472 | .i2c_addr = addr, |
473 | .ctrl = &ctl, | ||
474 | .callback = cx88_tuner_callback, | ||
463 | }; | 475 | }; |
464 | 476 | ||
465 | if (!dev->dvb.frontend) { | 477 | if (!dev->dvb.frontend) { |
@@ -469,6 +481,13 @@ static int attach_xc3028(u8 addr, struct cx8802_dev *dev) | |||
469 | return -EINVAL; | 481 | return -EINVAL; |
470 | } | 482 | } |
471 | 483 | ||
484 | /* | ||
485 | * Some xc3028 devices may be hidden by an I2C gate. This is known | ||
486 | * to happen with some s5h1409-based devices. | ||
487 | * Now that I2C gate is open, sets up xc3028 configuration | ||
488 | */ | ||
489 | cx88_setup_xc3028(dev->core, &ctl); | ||
490 | |||
472 | fe = dvb_attach(xc2028_attach, dev->dvb.frontend, &cfg); | 491 | fe = dvb_attach(xc2028_attach, dev->dvb.frontend, &cfg); |
473 | if (!fe) { | 492 | if (!fe) { |
474 | printk(KERN_ERR "%s/2: xc3028 attach failed\n", | 493 | printk(KERN_ERR "%s/2: xc3028 attach failed\n", |
@@ -810,7 +829,7 @@ static int dvb_register(struct cx8802_dev *dev) | |||
810 | return -EINVAL; | 829 | return -EINVAL; |
811 | break; | 830 | break; |
812 | case CX88_BOARD_GENIATECH_X8000_MT: | 831 | case CX88_BOARD_GENIATECH_X8000_MT: |
813 | dev->ts_gen_cntrl = 0x00; | 832 | dev->ts_gen_cntrl = 0x00; |
814 | 833 | ||
815 | dev->dvb.frontend = dvb_attach(zl10353_attach, | 834 | dev->dvb.frontend = dvb_attach(zl10353_attach, |
816 | &cx88_geniatech_x8000_mt, | 835 | &cx88_geniatech_x8000_mt, |
@@ -818,6 +837,13 @@ static int dvb_register(struct cx8802_dev *dev) | |||
818 | if (attach_xc3028(0x61, dev) < 0) | 837 | if (attach_xc3028(0x61, dev) < 0) |
819 | return -EINVAL; | 838 | return -EINVAL; |
820 | break; | 839 | break; |
840 | case CX88_BOARD_KWORLD_ATSC_120: | ||
841 | dev->dvb.frontend = dvb_attach(s5h1409_attach, | ||
842 | &kworld_atsc_120_config, | ||
843 | &dev->core->i2c_adap); | ||
844 | if (attach_xc3028(0x61, dev) < 0) | ||
845 | return -EINVAL; | ||
846 | break; | ||
821 | default: | 847 | default: |
822 | printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n", | 848 | printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n", |
823 | dev->core->name); | 849 | dev->core->name); |