diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 17:53:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 17:53:40 -0400 |
commit | 2d5e3e8d28a7820de1eb7b18a7c15d645bb26992 (patch) | |
tree | e6af4574977947de83e670dad1f71505b249fe1c /drivers/media/video/saa7134/saa7134-cards.c | |
parent | b57ab7632b8fc1eef139bbbb7a89002be61f99e1 (diff) | |
parent | aed6abd662c2903733bea7fcd3856c306e650680 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (28 commits)
V4L-DVB(7789a): cx18: fix symbol conflict with ivtv driver
V4L/DVB (7789): tuner: remove static dependencies on analog tuner sub-modules
V4L/DVB (7785): [2.6 patch] make mt9{m001,v022}_controls[] static
V4L/DVB (7786): cx18: new driver for the Conexant CX23418 MPEG encoder chip
V4L/DVB (7783): drivers/media/dvb/frontends/s5h1420.c: printk fix
V4L/DVB (7782): pvrusb2: Driver is no longer experimental
V4L/DVB (7781): pvrusb2-dvb: include dvb support by default and update Kconfig help text
V4L/DVB (7780): pvrusb2: always enable support for OnAir Creator / HDTV USB2
V4L/DVB (7779): pvrusb2-dvb: quiet down noise in kernel log for feed debug
Rename common tuner Kconfig names to use the same
Fix V4L/DVB core help messages
V4L/DVB (7769): Move other terrestrial tuners to common/tuners
V4L/DVB (7768): reorganize some DVB-S Kconfig items
V4L/DVB(7767): Move tuners to common/tuners
V4L/DVB (7766): saa7134: add another PCI ID for Beholder M6
V4L/DVB (7765): Add support for Beholder BeholdTV H6
V4L/DVB (7763): ivtv: add tuner support for the AverMedia M116
V4L/DVB (7762): ivtv: fix tuner detection for PAL-N/Nc
V4L/DVB (7761): ivtv: increase the DMA timeout from 100 to 300 ms
V4L/DVB (7759): ivtv: increase version number to 1.2.1
...
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-cards.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-cards.c | 260 |
1 files changed, 159 insertions, 101 deletions
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index 98375955a84b..b111903aa322 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c | |||
@@ -47,6 +47,9 @@ static char name_svideo[] = "S-Video"; | |||
47 | /* ------------------------------------------------------------------ */ | 47 | /* ------------------------------------------------------------------ */ |
48 | /* board config info */ | 48 | /* board config info */ |
49 | 49 | ||
50 | /* If radio_type !=UNSET, radio_addr should be specified | ||
51 | */ | ||
52 | |||
50 | struct saa7134_board saa7134_boards[] = { | 53 | struct saa7134_board saa7134_boards[] = { |
51 | [SAA7134_BOARD_UNKNOWN] = { | 54 | [SAA7134_BOARD_UNKNOWN] = { |
52 | .name = "UNKNOWN/GENERIC", | 55 | .name = "UNKNOWN/GENERIC", |
@@ -3087,7 +3090,7 @@ struct saa7134_board saa7134_boards[] = { | |||
3087 | .tuner_type = TUNER_PHILIPS_TD1316, /* untested */ | 3090 | .tuner_type = TUNER_PHILIPS_TD1316, /* untested */ |
3088 | .radio_type = TUNER_TEA5767, /* untested */ | 3091 | .radio_type = TUNER_TEA5767, /* untested */ |
3089 | .tuner_addr = ADDR_UNSET, | 3092 | .tuner_addr = ADDR_UNSET, |
3090 | .radio_addr = ADDR_UNSET, | 3093 | .radio_addr = 0x60, |
3091 | .tda9887_conf = TDA9887_PRESENT, | 3094 | .tda9887_conf = TDA9887_PRESENT, |
3092 | .mpeg = SAA7134_MPEG_DVB, | 3095 | .mpeg = SAA7134_MPEG_DVB, |
3093 | .inputs = {{ | 3096 | .inputs = {{ |
@@ -4247,6 +4250,36 @@ struct saa7134_board saa7134_boards[] = { | |||
4247 | .amux = LINE1, | 4250 | .amux = LINE1, |
4248 | } }, | 4251 | } }, |
4249 | }, | 4252 | }, |
4253 | [SAA7134_BOARD_BEHOLD_H6] = { | ||
4254 | /* Igor Kuznetsov <igk@igk.ru> */ | ||
4255 | .name = "Beholder BeholdTV H6", | ||
4256 | .audio_clock = 0x00187de7, | ||
4257 | .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3, | ||
4258 | .radio_type = UNSET, | ||
4259 | .tuner_addr = ADDR_UNSET, | ||
4260 | .radio_addr = ADDR_UNSET, | ||
4261 | .tda9887_conf = TDA9887_PRESENT, | ||
4262 | .inputs = {{ | ||
4263 | .name = name_tv, | ||
4264 | .vmux = 3, | ||
4265 | .amux = TV, | ||
4266 | .tv = 1, | ||
4267 | }, { | ||
4268 | .name = name_comp1, | ||
4269 | .vmux = 1, | ||
4270 | .amux = LINE1, | ||
4271 | }, { | ||
4272 | .name = name_svideo, | ||
4273 | .vmux = 8, | ||
4274 | .amux = LINE1, | ||
4275 | } }, | ||
4276 | .radio = { | ||
4277 | .name = name_radio, | ||
4278 | .amux = LINE2, | ||
4279 | }, | ||
4280 | /* no DVB support for now */ | ||
4281 | /* .mpeg = SAA7134_MPEG_DVB, */ | ||
4282 | }, | ||
4250 | }; | 4283 | }; |
4251 | 4284 | ||
4252 | const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); | 4285 | const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); |
@@ -5197,6 +5230,12 @@ struct pci_device_id saa7134_pci_tbl[] = { | |||
5197 | .subvendor = 0x5ace, | 5230 | .subvendor = 0x5ace, |
5198 | .subdevice = 0x6193, | 5231 | .subdevice = 0x6193, |
5199 | .driver_data = SAA7134_BOARD_BEHOLD_M6, | 5232 | .driver_data = SAA7134_BOARD_BEHOLD_M6, |
5233 | }, { | ||
5234 | .vendor = PCI_VENDOR_ID_PHILIPS, | ||
5235 | .device = PCI_DEVICE_ID_PHILIPS_SAA7133, | ||
5236 | .subvendor = 0x5ace, | ||
5237 | .subdevice = 0x6191, | ||
5238 | .driver_data = SAA7134_BOARD_BEHOLD_M6, | ||
5200 | },{ | 5239 | },{ |
5201 | .vendor = PCI_VENDOR_ID_PHILIPS, | 5240 | .vendor = PCI_VENDOR_ID_PHILIPS, |
5202 | .device = PCI_DEVICE_ID_PHILIPS_SAA7133, | 5241 | .device = PCI_DEVICE_ID_PHILIPS_SAA7133, |
@@ -5246,6 +5285,12 @@ struct pci_device_id saa7134_pci_tbl[] = { | |||
5246 | .subdevice = 0xc900, | 5285 | .subdevice = 0xc900, |
5247 | .driver_data = SAA7134_BOARD_VIDEOMATE_T750, | 5286 | .driver_data = SAA7134_BOARD_VIDEOMATE_T750, |
5248 | }, { | 5287 | }, { |
5288 | .vendor = PCI_VENDOR_ID_PHILIPS, | ||
5289 | .device = PCI_DEVICE_ID_PHILIPS_SAA7133, | ||
5290 | .subvendor = 0x5ace, | ||
5291 | .subdevice = 0x6290, | ||
5292 | .driver_data = SAA7134_BOARD_BEHOLD_H6, | ||
5293 | }, { | ||
5249 | /* --- boards without eeprom + subsystem ID --- */ | 5294 | /* --- boards without eeprom + subsystem ID --- */ |
5250 | .vendor = PCI_VENDOR_ID_PHILIPS, | 5295 | .vendor = PCI_VENDOR_ID_PHILIPS, |
5251 | .device = PCI_DEVICE_ID_PHILIPS_SAA7134, | 5296 | .device = PCI_DEVICE_ID_PHILIPS_SAA7134, |
@@ -5577,20 +5622,87 @@ int saa7134_board_init1(struct saa7134_dev *dev) | |||
5577 | return 0; | 5622 | return 0; |
5578 | } | 5623 | } |
5579 | 5624 | ||
5625 | static void saa7134_tuner_setup(struct saa7134_dev *dev) | ||
5626 | { | ||
5627 | struct tuner_setup tun_setup; | ||
5628 | unsigned int mode_mask = T_RADIO | | ||
5629 | T_ANALOG_TV | | ||
5630 | T_DIGITAL_TV; | ||
5631 | |||
5632 | memset(&tun_setup, 0, sizeof(tun_setup)); | ||
5633 | tun_setup.tuner_callback = saa7134_tuner_callback; | ||
5634 | |||
5635 | if (saa7134_boards[dev->board].radio_type != UNSET) { | ||
5636 | tun_setup.type = saa7134_boards[dev->board].radio_type; | ||
5637 | tun_setup.addr = saa7134_boards[dev->board].radio_addr; | ||
5638 | |||
5639 | tun_setup.mode_mask = T_RADIO; | ||
5640 | |||
5641 | saa7134_i2c_call_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup); | ||
5642 | mode_mask &= ~T_RADIO; | ||
5643 | } | ||
5644 | |||
5645 | if ((dev->tuner_type != TUNER_ABSENT) && (dev->tuner_type != UNSET)) { | ||
5646 | tun_setup.type = dev->tuner_type; | ||
5647 | tun_setup.addr = dev->tuner_addr; | ||
5648 | tun_setup.config = saa7134_boards[dev->board].tuner_config; | ||
5649 | tun_setup.tuner_callback = saa7134_tuner_callback; | ||
5650 | |||
5651 | tun_setup.mode_mask = mode_mask; | ||
5652 | |||
5653 | saa7134_i2c_call_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup); | ||
5654 | } | ||
5655 | |||
5656 | if (dev->tda9887_conf) { | ||
5657 | struct v4l2_priv_tun_config tda9887_cfg; | ||
5658 | |||
5659 | tda9887_cfg.tuner = TUNER_TDA9887; | ||
5660 | tda9887_cfg.priv = &dev->tda9887_conf; | ||
5661 | |||
5662 | saa7134_i2c_call_clients(dev, TUNER_SET_CONFIG, | ||
5663 | &tda9887_cfg); | ||
5664 | } | ||
5665 | |||
5666 | if (dev->tuner_type == TUNER_XC2028) { | ||
5667 | struct v4l2_priv_tun_config xc2028_cfg; | ||
5668 | struct xc2028_ctrl ctl; | ||
5669 | |||
5670 | memset(&xc2028_cfg, 0, sizeof(ctl)); | ||
5671 | memset(&ctl, 0, sizeof(ctl)); | ||
5672 | |||
5673 | ctl.fname = XC2028_DEFAULT_FIRMWARE; | ||
5674 | ctl.max_len = 64; | ||
5675 | |||
5676 | switch (dev->board) { | ||
5677 | case SAA7134_BOARD_AVERMEDIA_A16D: | ||
5678 | ctl.demod = XC3028_FE_ZARLINK456; | ||
5679 | break; | ||
5680 | default: | ||
5681 | ctl.demod = XC3028_FE_OREN538; | ||
5682 | ctl.mts = 1; | ||
5683 | } | ||
5684 | |||
5685 | xc2028_cfg.tuner = TUNER_XC2028; | ||
5686 | xc2028_cfg.priv = &ctl; | ||
5687 | |||
5688 | saa7134_i2c_call_clients(dev, TUNER_SET_CONFIG, &xc2028_cfg); | ||
5689 | } | ||
5690 | } | ||
5691 | |||
5580 | /* stuff which needs working i2c */ | 5692 | /* stuff which needs working i2c */ |
5581 | int saa7134_board_init2(struct saa7134_dev *dev) | 5693 | int saa7134_board_init2(struct saa7134_dev *dev) |
5582 | { | 5694 | { |
5583 | unsigned char buf; | 5695 | unsigned char buf; |
5584 | int board; | 5696 | int board; |
5585 | struct tuner_setup tun_setup; | 5697 | |
5586 | tun_setup.config = 0; | 5698 | dev->tuner_type = saa7134_boards[dev->board].tuner_type; |
5587 | tun_setup.tuner_callback = saa7134_tuner_callback; | 5699 | dev->tuner_addr = saa7134_boards[dev->board].tuner_addr; |
5588 | 5700 | ||
5589 | switch (dev->board) { | 5701 | switch (dev->board) { |
5590 | case SAA7134_BOARD_BMK_MPEX_NOTUNER: | 5702 | case SAA7134_BOARD_BMK_MPEX_NOTUNER: |
5591 | case SAA7134_BOARD_BMK_MPEX_TUNER: | 5703 | case SAA7134_BOARD_BMK_MPEX_TUNER: |
5592 | dev->i2c_client.addr = 0x60; | 5704 | dev->i2c_client.addr = 0x60; |
5593 | board = (i2c_master_recv(&dev->i2c_client,&buf,0) < 0) | 5705 | board = (i2c_master_recv(&dev->i2c_client, &buf, 0) < 0) |
5594 | ? SAA7134_BOARD_BMK_MPEX_NOTUNER | 5706 | ? SAA7134_BOARD_BMK_MPEX_NOTUNER |
5595 | : SAA7134_BOARD_BMK_MPEX_TUNER; | 5707 | : SAA7134_BOARD_BMK_MPEX_TUNER; |
5596 | if (board == dev->board) | 5708 | if (board == dev->board) |
@@ -5600,21 +5712,9 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
5600 | saa7134_boards[dev->board].name); | 5712 | saa7134_boards[dev->board].name); |
5601 | dev->tuner_type = saa7134_boards[dev->board].tuner_type; | 5713 | dev->tuner_type = saa7134_boards[dev->board].tuner_type; |
5602 | 5714 | ||
5603 | if (TUNER_ABSENT != dev->tuner_type) { | ||
5604 | tun_setup.mode_mask = T_RADIO | | ||
5605 | T_ANALOG_TV | | ||
5606 | T_DIGITAL_TV; | ||
5607 | tun_setup.type = dev->tuner_type; | ||
5608 | tun_setup.addr = ADDR_UNSET; | ||
5609 | tun_setup.tuner_callback = saa7134_tuner_callback; | ||
5610 | |||
5611 | saa7134_i2c_call_clients(dev, | ||
5612 | TUNER_SET_TYPE_ADDR, | ||
5613 | &tun_setup); | ||
5614 | } | ||
5615 | break; | 5715 | break; |
5616 | case SAA7134_BOARD_MD7134: | 5716 | case SAA7134_BOARD_MD7134: |
5617 | { | 5717 | { |
5618 | u8 subaddr; | 5718 | u8 subaddr; |
5619 | u8 data[3]; | 5719 | u8 data[3]; |
5620 | int ret, tuner_t; | 5720 | int ret, tuner_t; |
@@ -5667,30 +5767,8 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
5667 | } | 5767 | } |
5668 | 5768 | ||
5669 | printk(KERN_INFO "%s Tuner type is %d\n", dev->name, dev->tuner_type); | 5769 | printk(KERN_INFO "%s Tuner type is %d\n", dev->name, dev->tuner_type); |
5670 | if (dev->tuner_type == TUNER_PHILIPS_FMD1216ME_MK3) { | ||
5671 | struct v4l2_priv_tun_config tda9887_cfg; | ||
5672 | |||
5673 | tda9887_cfg.tuner = TUNER_TDA9887; | ||
5674 | tda9887_cfg.priv = &dev->tda9887_conf; | ||
5675 | |||
5676 | dev->tda9887_conf = TDA9887_PRESENT | | ||
5677 | TDA9887_PORT1_ACTIVE | | ||
5678 | TDA9887_PORT2_ACTIVE; | ||
5679 | |||
5680 | saa7134_i2c_call_clients(dev, TUNER_SET_CONFIG, | ||
5681 | &tda9887_cfg); | ||
5682 | } | ||
5683 | |||
5684 | tun_setup.mode_mask = T_RADIO | | ||
5685 | T_ANALOG_TV | | ||
5686 | T_DIGITAL_TV; | ||
5687 | tun_setup.type = dev->tuner_type; | ||
5688 | tun_setup.addr = ADDR_UNSET; | ||
5689 | |||
5690 | saa7134_i2c_call_clients(dev, | ||
5691 | TUNER_SET_TYPE_ADDR, &tun_setup); | ||
5692 | } | ||
5693 | break; | 5770 | break; |
5771 | } | ||
5694 | case SAA7134_BOARD_PHILIPS_EUROPA: | 5772 | case SAA7134_BOARD_PHILIPS_EUROPA: |
5695 | if (dev->autodetected && (dev->eedata[0x41] == 0x1c)) { | 5773 | if (dev->autodetected && (dev->eedata[0x41] == 0x1c)) { |
5696 | /* Reconfigure board as Snake reference design */ | 5774 | /* Reconfigure board as Snake reference design */ |
@@ -5702,43 +5780,43 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
5702 | } | 5780 | } |
5703 | case SAA7134_BOARD_VIDEOMATE_DVBT_300: | 5781 | case SAA7134_BOARD_VIDEOMATE_DVBT_300: |
5704 | case SAA7134_BOARD_ASUS_EUROPA2_HYBRID: | 5782 | case SAA7134_BOARD_ASUS_EUROPA2_HYBRID: |
5783 | { | ||
5784 | |||
5705 | /* The Philips EUROPA based hybrid boards have the tuner connected through | 5785 | /* The Philips EUROPA based hybrid boards have the tuner connected through |
5706 | * the channel decoder. We have to make it transparent to find it | 5786 | * the channel decoder. We have to make it transparent to find it |
5707 | */ | 5787 | */ |
5708 | { | ||
5709 | u8 data[] = { 0x07, 0x02}; | 5788 | u8 data[] = { 0x07, 0x02}; |
5710 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; | 5789 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; |
5711 | i2c_transfer(&dev->i2c_adap, &msg, 1); | 5790 | i2c_transfer(&dev->i2c_adap, &msg, 1); |
5712 | 5791 | ||
5713 | tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV; | ||
5714 | tun_setup.type = dev->tuner_type; | ||
5715 | tun_setup.addr = dev->tuner_addr; | ||
5716 | |||
5717 | saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup); | ||
5718 | } | ||
5719 | break; | 5792 | break; |
5793 | } | ||
5720 | case SAA7134_BOARD_PHILIPS_TIGER: | 5794 | case SAA7134_BOARD_PHILIPS_TIGER: |
5721 | case SAA7134_BOARD_PHILIPS_TIGER_S: | 5795 | case SAA7134_BOARD_PHILIPS_TIGER_S: |
5722 | { | 5796 | { |
5723 | u8 data[] = { 0x3c, 0x33, 0x60}; | 5797 | u8 data[] = { 0x3c, 0x33, 0x60}; |
5724 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; | 5798 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; |
5725 | if(dev->autodetected && (dev->eedata[0x49] == 0x50)) { | 5799 | if (dev->autodetected && (dev->eedata[0x49] == 0x50)) { |
5726 | dev->board = SAA7134_BOARD_PHILIPS_TIGER_S; | 5800 | dev->board = SAA7134_BOARD_PHILIPS_TIGER_S; |
5727 | printk(KERN_INFO "%s: Reconfigured board as %s\n", | 5801 | printk(KERN_INFO "%s: Reconfigured board as %s\n", |
5728 | dev->name, saa7134_boards[dev->board].name); | 5802 | dev->name, saa7134_boards[dev->board].name); |
5729 | } | 5803 | } |
5730 | if(dev->board == SAA7134_BOARD_PHILIPS_TIGER_S) { | 5804 | if (dev->board == SAA7134_BOARD_PHILIPS_TIGER_S) { |
5731 | tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV; | 5805 | dev->tuner_type = TUNER_PHILIPS_TDA8290; |
5732 | tun_setup.type = TUNER_PHILIPS_TDA8290; | 5806 | |
5733 | tun_setup.addr = 0x4b; | 5807 | saa7134_tuner_setup(dev); |
5734 | tun_setup.config = 2; | ||
5735 | 5808 | ||
5736 | saa7134_i2c_call_clients (dev, TUNER_SET_TYPE_ADDR,&tun_setup); | ||
5737 | data[2] = 0x68; | 5809 | data[2] = 0x68; |
5810 | i2c_transfer(&dev->i2c_adap, &msg, 1); | ||
5811 | |||
5812 | /* Tuner setup is handled before I2C transfer. | ||
5813 | Due to that, there's no need to do it later | ||
5814 | */ | ||
5815 | return 0; | ||
5738 | } | 5816 | } |
5739 | i2c_transfer(&dev->i2c_adap, &msg, 1); | 5817 | i2c_transfer(&dev->i2c_adap, &msg, 1); |
5740 | } | ||
5741 | break; | 5818 | break; |
5819 | } | ||
5742 | case SAA7134_BOARD_HAUPPAUGE_HVR1110: | 5820 | case SAA7134_BOARD_HAUPPAUGE_HVR1110: |
5743 | hauppauge_eeprom(dev, dev->eedata+0x80); | 5821 | hauppauge_eeprom(dev, dev->eedata+0x80); |
5744 | /* break intentionally omitted */ | 5822 | /* break intentionally omitted */ |
@@ -5751,52 +5829,55 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
5751 | case SAA7134_BOARD_AVERMEDIA_SUPER_007: | 5829 | case SAA7134_BOARD_AVERMEDIA_SUPER_007: |
5752 | case SAA7134_BOARD_TWINHAN_DTV_DVB_3056: | 5830 | case SAA7134_BOARD_TWINHAN_DTV_DVB_3056: |
5753 | case SAA7134_BOARD_CREATIX_CTX953: | 5831 | case SAA7134_BOARD_CREATIX_CTX953: |
5832 | { | ||
5754 | /* this is a hybrid board, initialize to analog mode | 5833 | /* this is a hybrid board, initialize to analog mode |
5755 | * and configure firmware eeprom address | 5834 | * and configure firmware eeprom address |
5756 | */ | 5835 | */ |
5757 | { | ||
5758 | u8 data[] = { 0x3c, 0x33, 0x60}; | 5836 | u8 data[] = { 0x3c, 0x33, 0x60}; |
5759 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; | 5837 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; |
5760 | i2c_transfer(&dev->i2c_adap, &msg, 1); | 5838 | i2c_transfer(&dev->i2c_adap, &msg, 1); |
5761 | } | ||
5762 | break; | 5839 | break; |
5840 | } | ||
5763 | case SAA7134_BOARD_FLYDVB_TRIO: | 5841 | case SAA7134_BOARD_FLYDVB_TRIO: |
5764 | { | 5842 | { |
5765 | u8 data[] = { 0x3c, 0x33, 0x62}; | 5843 | u8 data[] = { 0x3c, 0x33, 0x62}; |
5766 | struct i2c_msg msg = {.addr=0x09, .flags=0, .buf=data, .len = sizeof(data)}; | 5844 | struct i2c_msg msg = {.addr=0x09, .flags=0, .buf=data, .len = sizeof(data)}; |
5767 | i2c_transfer(&dev->i2c_adap, &msg, 1); | 5845 | i2c_transfer(&dev->i2c_adap, &msg, 1); |
5768 | } | ||
5769 | break; | 5846 | break; |
5847 | } | ||
5770 | case SAA7134_BOARD_ADS_DUO_CARDBUS_PTV331: | 5848 | case SAA7134_BOARD_ADS_DUO_CARDBUS_PTV331: |
5771 | case SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS: | 5849 | case SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS: |
5850 | { | ||
5772 | /* initialize analog mode */ | 5851 | /* initialize analog mode */ |
5773 | { | ||
5774 | u8 data[] = { 0x3c, 0x33, 0x6a}; | 5852 | u8 data[] = { 0x3c, 0x33, 0x6a}; |
5775 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; | 5853 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; |
5776 | i2c_transfer(&dev->i2c_adap, &msg, 1); | 5854 | i2c_transfer(&dev->i2c_adap, &msg, 1); |
5777 | } | ||
5778 | break; | 5855 | break; |
5856 | } | ||
5779 | case SAA7134_BOARD_CINERGY_HT_PCMCIA: | 5857 | case SAA7134_BOARD_CINERGY_HT_PCMCIA: |
5780 | case SAA7134_BOARD_CINERGY_HT_PCI: | 5858 | case SAA7134_BOARD_CINERGY_HT_PCI: |
5859 | { | ||
5781 | /* initialize analog mode */ | 5860 | /* initialize analog mode */ |
5782 | { | ||
5783 | u8 data[] = { 0x3c, 0x33, 0x68}; | 5861 | u8 data[] = { 0x3c, 0x33, 0x68}; |
5784 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; | 5862 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; |
5785 | i2c_transfer(&dev->i2c_adap, &msg, 1); | 5863 | i2c_transfer(&dev->i2c_adap, &msg, 1); |
5786 | } | ||
5787 | break; | 5864 | break; |
5865 | } | ||
5788 | case SAA7134_BOARD_KWORLD_ATSC110: | 5866 | case SAA7134_BOARD_KWORLD_ATSC110: |
5789 | { | 5867 | { |
5790 | /* enable tuner */ | 5868 | /* enable tuner */ |
5791 | int i; | 5869 | int i; |
5792 | static const u8 buffer [] = { 0x10,0x12,0x13,0x04,0x16,0x00,0x14,0x04,0x017,0x00 }; | 5870 | static const u8 buffer [] = { 0x10, 0x12, 0x13, 0x04, 0x16, |
5793 | dev->i2c_client.addr = 0x0a; | 5871 | 0x00, 0x14, 0x04, 0x17, 0x00 }; |
5794 | for (i = 0; i < 5; i++) | 5872 | dev->i2c_client.addr = 0x0a; |
5795 | if (2 != i2c_master_send(&dev->i2c_client,&buffer[i*2],2)) | 5873 | for (i = 0; i < 5; i++) |
5796 | printk(KERN_WARNING "%s: Unable to enable tuner(%i).\n", | 5874 | if (2 != i2c_master_send(&dev->i2c_client, |
5797 | dev->name, i); | 5875 | &buffer[i*2], 2)) |
5798 | } | 5876 | printk(KERN_WARNING |
5877 | "%s: Unable to enable tuner(%i).\n", | ||
5878 | dev->name, i); | ||
5799 | break; | 5879 | break; |
5880 | } | ||
5800 | case SAA7134_BOARD_VIDEOMATE_DVBT_200: | 5881 | case SAA7134_BOARD_VIDEOMATE_DVBT_200: |
5801 | case SAA7134_BOARD_VIDEOMATE_DVBT_200A: | 5882 | case SAA7134_BOARD_VIDEOMATE_DVBT_200A: |
5802 | /* The T200 and the T200A share the same pci id. Consequently, | 5883 | /* The T200 and the T200A share the same pci id. Consequently, |
@@ -5821,7 +5902,7 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
5821 | } | 5902 | } |
5822 | break; | 5903 | break; |
5823 | case SAA7134_BOARD_BEHOLD_COLUMBUS_TVFM: | 5904 | case SAA7134_BOARD_BEHOLD_COLUMBUS_TVFM: |
5824 | { | 5905 | { |
5825 | struct v4l2_priv_tun_config tea5767_cfg; | 5906 | struct v4l2_priv_tun_config tea5767_cfg; |
5826 | struct tea5767_ctrl ctl; | 5907 | struct tea5767_ctrl ctl; |
5827 | 5908 | ||
@@ -5832,34 +5913,11 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
5832 | tea5767_cfg.tuner = TUNER_TEA5767; | 5913 | tea5767_cfg.tuner = TUNER_TEA5767; |
5833 | tea5767_cfg.priv = &ctl; | 5914 | tea5767_cfg.priv = &ctl; |
5834 | saa7134_i2c_call_clients(dev, TUNER_SET_CONFIG, &tea5767_cfg); | 5915 | saa7134_i2c_call_clients(dev, TUNER_SET_CONFIG, &tea5767_cfg); |
5835 | } | ||
5836 | break; | 5916 | break; |
5837 | } | 5917 | } |
5918 | } /* switch() */ | ||
5838 | 5919 | ||
5839 | if (dev->tuner_type == TUNER_XC2028) { | 5920 | saa7134_tuner_setup(dev); |
5840 | struct v4l2_priv_tun_config xc2028_cfg; | ||
5841 | struct xc2028_ctrl ctl; | ||
5842 | |||
5843 | memset(&xc2028_cfg, 0, sizeof(ctl)); | ||
5844 | memset(&ctl, 0, sizeof(ctl)); | ||
5845 | |||
5846 | ctl.fname = XC2028_DEFAULT_FIRMWARE; | ||
5847 | ctl.max_len = 64; | ||
5848 | |||
5849 | switch (dev->board) { | ||
5850 | case SAA7134_BOARD_AVERMEDIA_A16D: | ||
5851 | ctl.demod = XC3028_FE_ZARLINK456; | ||
5852 | break; | ||
5853 | default: | ||
5854 | ctl.demod = XC3028_FE_OREN538; | ||
5855 | ctl.mts = 1; | ||
5856 | } | ||
5857 | |||
5858 | xc2028_cfg.tuner = TUNER_XC2028; | ||
5859 | xc2028_cfg.priv = &ctl; | ||
5860 | |||
5861 | saa7134_i2c_call_clients(dev, TUNER_SET_CONFIG, &xc2028_cfg); | ||
5862 | } | ||
5863 | 5921 | ||
5864 | return 0; | 5922 | return 0; |
5865 | } | 5923 | } |