diff options
author | Hartmut Hackmann <hartmut.hackmann@t-online.de> | 2006-11-15 19:31:54 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-12-10 05:51:27 -0500 |
commit | 550a9a5e5f8086ae410832f134a5d80b9bd7fdb6 (patch) | |
tree | b8475cb1eeed049dd6b6cafa1cdf5dfb9fcc1521 | |
parent | ab33668f8e1bd686ebc87d51be3a0cf99a267a9f (diff) |
V4L/DVB (4835): Added support for the Terratec Cinergy HT PCMCIA module
This is a hybrid cardbus module. Besides the card support, i
modified the definition names for AGC and GPIO of the tda10046.
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | Documentation/video4linux/CARDLIST.saa7134 | 1 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/tda1004x.c | 10 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/tda1004x.h | 5 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-cards.c | 37 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-dvb.c | 63 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134.h | 3 |
6 files changed, 105 insertions, 14 deletions
diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index ef67ace59cb6..f6201cc37ec5 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 | |||
@@ -103,3 +103,4 @@ | |||
103 | 102 -> Avermedia AVerTV Studio 507 [1461:9715] | 103 | 102 -> Avermedia AVerTV Studio 507 [1461:9715] |
104 | 103 -> Compro Videomate DVB-T200A | 104 | 103 -> Compro Videomate DVB-T200A |
105 | 104 -> Hauppauge WinTV-HVR1110 DVB-T/Hybrid [0070:6701] | 105 | 104 -> Hauppauge WinTV-HVR1110 DVB-T/Hybrid [0070:6701] |
106 | 105 -> Terratec Cinergy HT PCMCIA [153b:1172] | ||
diff --git a/drivers/media/dvb/frontends/tda1004x.c b/drivers/media/dvb/frontends/tda1004x.c index 11e0dca9a2d7..00e4bcd9f1a4 100644 --- a/drivers/media/dvb/frontends/tda1004x.c +++ b/drivers/media/dvb/frontends/tda1004x.c | |||
@@ -648,18 +648,24 @@ static int tda10046_init(struct dvb_frontend* fe) | |||
648 | tda1004x_write_byteI(state, TDA10046H_AGC_CONF, 0x0a); // AGC setup | 648 | tda1004x_write_byteI(state, TDA10046H_AGC_CONF, 0x0a); // AGC setup |
649 | tda1004x_write_byteI(state, TDA10046H_CONF_POLARITY, 0x00); // set AGC polarities | 649 | tda1004x_write_byteI(state, TDA10046H_CONF_POLARITY, 0x00); // set AGC polarities |
650 | break; | 650 | break; |
651 | case TDA10046_AGC_TDA827X: | 651 | case TDA10046_AGC_TDA827X_GP11: |
652 | tda1004x_write_byteI(state, TDA10046H_AGC_CONF, 0x02); // AGC setup | 652 | tda1004x_write_byteI(state, TDA10046H_AGC_CONF, 0x02); // AGC setup |
653 | tda1004x_write_byteI(state, TDA10046H_AGC_THR, 0x70); // AGC Threshold | 653 | tda1004x_write_byteI(state, TDA10046H_AGC_THR, 0x70); // AGC Threshold |
654 | tda1004x_write_byteI(state, TDA10046H_AGC_RENORM, 0x08); // Gain Renormalize | 654 | tda1004x_write_byteI(state, TDA10046H_AGC_RENORM, 0x08); // Gain Renormalize |
655 | tda1004x_write_byteI(state, TDA10046H_CONF_POLARITY, 0x6a); // set AGC polarities | 655 | tda1004x_write_byteI(state, TDA10046H_CONF_POLARITY, 0x6a); // set AGC polarities |
656 | break; | 656 | break; |
657 | case TDA10046_AGC_TDA827X_GPL: | 657 | case TDA10046_AGC_TDA827X_GP00: |
658 | tda1004x_write_byteI(state, TDA10046H_AGC_CONF, 0x02); // AGC setup | 658 | tda1004x_write_byteI(state, TDA10046H_AGC_CONF, 0x02); // AGC setup |
659 | tda1004x_write_byteI(state, TDA10046H_AGC_THR, 0x70); // AGC Threshold | 659 | tda1004x_write_byteI(state, TDA10046H_AGC_THR, 0x70); // AGC Threshold |
660 | tda1004x_write_byteI(state, TDA10046H_AGC_RENORM, 0x08); // Gain Renormalize | 660 | tda1004x_write_byteI(state, TDA10046H_AGC_RENORM, 0x08); // Gain Renormalize |
661 | tda1004x_write_byteI(state, TDA10046H_CONF_POLARITY, 0x60); // set AGC polarities | 661 | tda1004x_write_byteI(state, TDA10046H_CONF_POLARITY, 0x60); // set AGC polarities |
662 | break; | 662 | break; |
663 | case TDA10046_AGC_TDA827X_GP01: | ||
664 | tda1004x_write_byteI(state, TDA10046H_AGC_CONF, 0x02); // AGC setup | ||
665 | tda1004x_write_byteI(state, TDA10046H_AGC_THR, 0x70); // AGC Threshold | ||
666 | tda1004x_write_byteI(state, TDA10046H_AGC_RENORM, 0x08); // Gain Renormalize | ||
667 | tda1004x_write_byteI(state, TDA10046H_CONF_POLARITY, 0x62); // set AGC polarities | ||
668 | break; | ||
663 | } | 669 | } |
664 | tda1004x_write_byteI(state, TDA1004X_CONFADC2, 0x38); | 670 | tda1004x_write_byteI(state, TDA1004X_CONFADC2, 0x38); |
665 | tda1004x_write_byteI(state, TDA10046H_CONF_TRISTATE1, 0x61); // Turn both AGC outputs on | 671 | tda1004x_write_byteI(state, TDA10046H_CONF_TRISTATE1, 0x61); // Turn both AGC outputs on |
diff --git a/drivers/media/dvb/frontends/tda1004x.h b/drivers/media/dvb/frontends/tda1004x.h index 605ad2dfc09d..ec502d71b83c 100644 --- a/drivers/media/dvb/frontends/tda1004x.h +++ b/drivers/media/dvb/frontends/tda1004x.h | |||
@@ -35,8 +35,9 @@ enum tda10046_agc { | |||
35 | TDA10046_AGC_DEFAULT, /* original configuration */ | 35 | TDA10046_AGC_DEFAULT, /* original configuration */ |
36 | TDA10046_AGC_IFO_AUTO_NEG, /* IF AGC only, automatic, negtive */ | 36 | TDA10046_AGC_IFO_AUTO_NEG, /* IF AGC only, automatic, negtive */ |
37 | TDA10046_AGC_IFO_AUTO_POS, /* IF AGC only, automatic, positive */ | 37 | TDA10046_AGC_IFO_AUTO_POS, /* IF AGC only, automatic, positive */ |
38 | TDA10046_AGC_TDA827X, /* IF AGC only, special setup for tda827x */ | 38 | TDA10046_AGC_TDA827X_GP11, /* IF AGC only, special setup for tda827x */ |
39 | TDA10046_AGC_TDA827X_GPL, /* same as above, but GPIOs 0 */ | 39 | TDA10046_AGC_TDA827X_GP00, /* same as above, but GPIOs 0 */ |
40 | TDA10046_AGC_TDA827X_GP01, /* same as above, but GPIO3=0 GPIO1=1*/ | ||
40 | }; | 41 | }; |
41 | 42 | ||
42 | enum tda10046_if { | 43 | enum tda10046_if { |
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index d8d8142d921b..d0ddc65d7eb1 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c | |||
@@ -3148,6 +3148,29 @@ struct saa7134_board saa7134_boards[] = { | |||
3148 | .gpio = 0x0200000, | 3148 | .gpio = 0x0200000, |
3149 | }, | 3149 | }, |
3150 | }, | 3150 | }, |
3151 | [SAA7134_BOARD_CINERGY_HT_PCMCIA] = { | ||
3152 | .name = "Terratec Cinergy HT PCMCIA", | ||
3153 | .audio_clock = 0x00187de7, | ||
3154 | .tuner_type = TUNER_PHILIPS_TDA8290, | ||
3155 | .radio_type = UNSET, | ||
3156 | .tuner_addr = ADDR_UNSET, | ||
3157 | .radio_addr = ADDR_UNSET, | ||
3158 | .mpeg = SAA7134_MPEG_DVB, | ||
3159 | .inputs = {{ | ||
3160 | .name = name_tv, | ||
3161 | .vmux = 1, | ||
3162 | .amux = TV, | ||
3163 | .tv = 1, | ||
3164 | },{ | ||
3165 | .name = name_comp1, | ||
3166 | .vmux = 0, | ||
3167 | .amux = LINE1, | ||
3168 | },{ | ||
3169 | .name = name_svideo, | ||
3170 | .vmux = 6, | ||
3171 | .amux = LINE1, | ||
3172 | }}, | ||
3173 | }, | ||
3151 | }; | 3174 | }; |
3152 | 3175 | ||
3153 | const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); | 3176 | const unsigned int saa7134_bcount = ARRAY_SIZE(saa7134_boards); |
@@ -3781,6 +3804,12 @@ struct pci_device_id saa7134_pci_tbl[] = { | |||
3781 | .subdevice = 0x6701, | 3804 | .subdevice = 0x6701, |
3782 | .driver_data = SAA7134_BOARD_HAUPPAUGE_HVR1110, | 3805 | .driver_data = SAA7134_BOARD_HAUPPAUGE_HVR1110, |
3783 | },{ | 3806 | },{ |
3807 | .vendor = PCI_VENDOR_ID_PHILIPS, | ||
3808 | .device = PCI_DEVICE_ID_PHILIPS_SAA7133, | ||
3809 | .subvendor = 0x153b, | ||
3810 | .subdevice = 0x1172, | ||
3811 | .driver_data = SAA7134_BOARD_CINERGY_HT_PCMCIA, | ||
3812 | },{ | ||
3784 | /* --- boards without eeprom + subsystem ID --- */ | 3813 | /* --- boards without eeprom + subsystem ID --- */ |
3785 | .vendor = PCI_VENDOR_ID_PHILIPS, | 3814 | .vendor = PCI_VENDOR_ID_PHILIPS, |
3786 | .device = PCI_DEVICE_ID_PHILIPS_SAA7134, | 3815 | .device = PCI_DEVICE_ID_PHILIPS_SAA7134, |
@@ -4107,6 +4136,14 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
4107 | i2c_transfer(&dev->i2c_adap, &msg, 1); | 4136 | i2c_transfer(&dev->i2c_adap, &msg, 1); |
4108 | } | 4137 | } |
4109 | break; | 4138 | break; |
4139 | case SAA7134_BOARD_CINERGY_HT_PCMCIA: | ||
4140 | /* make the tda10046 find its eeprom */ | ||
4141 | { | ||
4142 | u8 data[] = { 0x3c, 0x33, 0x60}; | ||
4143 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; | ||
4144 | i2c_transfer(&dev->i2c_adap, &msg, 1); | ||
4145 | } | ||
4146 | break; | ||
4110 | case SAA7134_BOARD_KWORLD_ATSC110: | 4147 | case SAA7134_BOARD_KWORLD_ATSC110: |
4111 | { | 4148 | { |
4112 | /* enable tuner */ | 4149 | /* enable tuner */ |
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index a51264f636fd..ce888f704956 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c | |||
@@ -677,7 +677,7 @@ static struct tda1004x_config tda827x_lifeview_config = { | |||
677 | .invert = 1, | 677 | .invert = 1, |
678 | .invert_oclk = 0, | 678 | .invert_oclk = 0, |
679 | .xtal_freq = TDA10046_XTAL_16M, | 679 | .xtal_freq = TDA10046_XTAL_16M, |
680 | .agc_config = TDA10046_AGC_TDA827X, | 680 | .agc_config = TDA10046_AGC_TDA827X_GP11, |
681 | .if_freq = TDA10046_FREQ_045, | 681 | .if_freq = TDA10046_FREQ_045, |
682 | .request_firmware = NULL, | 682 | .request_firmware = NULL, |
683 | }; | 683 | }; |
@@ -881,7 +881,40 @@ static struct tda1004x_config philips_tiger_config = { | |||
881 | .invert = 1, | 881 | .invert = 1, |
882 | .invert_oclk = 0, | 882 | .invert_oclk = 0, |
883 | .xtal_freq = TDA10046_XTAL_16M, | 883 | .xtal_freq = TDA10046_XTAL_16M, |
884 | .agc_config = TDA10046_AGC_TDA827X, | 884 | .agc_config = TDA10046_AGC_TDA827X_GP11, |
885 | .if_freq = TDA10046_FREQ_045, | ||
886 | .request_firmware = NULL, | ||
887 | }; | ||
888 | /* ------------------------------------------------------------------ */ | ||
889 | |||
890 | static int cinergy_ht_tuner_init(struct dvb_frontend *fe) | ||
891 | { | ||
892 | struct saa7134_dev *dev = fe->dvb->priv; | ||
893 | static u8 data[] = { 0x3c, 0x33, 0x62}; | ||
894 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; | ||
895 | |||
896 | if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) | ||
897 | return -EIO; | ||
898 | return 0; | ||
899 | } | ||
900 | |||
901 | static int cinergy_ht_tuner_sleep(struct dvb_frontend *fe) | ||
902 | { | ||
903 | struct saa7134_dev *dev = fe->dvb->priv; | ||
904 | static u8 data[] = { 0x3c, 0x33, 0x60}; | ||
905 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; | ||
906 | |||
907 | i2c_transfer(&dev->i2c_adap, &msg, 1); | ||
908 | philips_tda827xa_tuner_sleep( 0x61, fe); | ||
909 | return 0; | ||
910 | } | ||
911 | |||
912 | static struct tda1004x_config cinergy_ht_config = { | ||
913 | .demod_address = 0x08, | ||
914 | .invert = 1, | ||
915 | .invert_oclk = 0, | ||
916 | .xtal_freq = TDA10046_XTAL_16M, | ||
917 | .agc_config = TDA10046_AGC_TDA827X_GP01, | ||
885 | .if_freq = TDA10046_FREQ_045, | 918 | .if_freq = TDA10046_FREQ_045, |
886 | .request_firmware = NULL, | 919 | .request_firmware = NULL, |
887 | }; | 920 | }; |
@@ -893,7 +926,7 @@ static struct tda1004x_config pinnacle_pctv_310i_config = { | |||
893 | .invert = 1, | 926 | .invert = 1, |
894 | .invert_oclk = 0, | 927 | .invert_oclk = 0, |
895 | .xtal_freq = TDA10046_XTAL_16M, | 928 | .xtal_freq = TDA10046_XTAL_16M, |
896 | .agc_config = TDA10046_AGC_TDA827X, | 929 | .agc_config = TDA10046_AGC_TDA827X_GP11, |
897 | .if_freq = TDA10046_FREQ_045, | 930 | .if_freq = TDA10046_FREQ_045, |
898 | .request_firmware = philips_tda1004x_request_firmware, | 931 | .request_firmware = philips_tda1004x_request_firmware, |
899 | }; | 932 | }; |
@@ -905,7 +938,7 @@ static struct tda1004x_config hauppauge_hvr_1110_config = { | |||
905 | .invert = 1, | 938 | .invert = 1, |
906 | .invert_oclk = 0, | 939 | .invert_oclk = 0, |
907 | .xtal_freq = TDA10046_XTAL_16M, | 940 | .xtal_freq = TDA10046_XTAL_16M, |
908 | .agc_config = TDA10046_AGC_TDA827X, | 941 | .agc_config = TDA10046_AGC_TDA827X_GP11, |
909 | .if_freq = TDA10046_FREQ_045, | 942 | .if_freq = TDA10046_FREQ_045, |
910 | .request_firmware = philips_tda1004x_request_firmware, | 943 | .request_firmware = philips_tda1004x_request_firmware, |
911 | }; | 944 | }; |
@@ -917,7 +950,7 @@ static struct tda1004x_config asus_p7131_dual_config = { | |||
917 | .invert = 1, | 950 | .invert = 1, |
918 | .invert_oclk = 0, | 951 | .invert_oclk = 0, |
919 | .xtal_freq = TDA10046_XTAL_16M, | 952 | .xtal_freq = TDA10046_XTAL_16M, |
920 | .agc_config = TDA10046_AGC_TDA827X, | 953 | .agc_config = TDA10046_AGC_TDA827X_GP11, |
921 | .if_freq = TDA10046_FREQ_045, | 954 | .if_freq = TDA10046_FREQ_045, |
922 | .request_firmware = philips_tda1004x_request_firmware, | 955 | .request_firmware = philips_tda1004x_request_firmware, |
923 | }; | 956 | }; |
@@ -969,7 +1002,7 @@ static struct tda1004x_config lifeview_trio_config = { | |||
969 | .invert = 1, | 1002 | .invert = 1, |
970 | .invert_oclk = 0, | 1003 | .invert_oclk = 0, |
971 | .xtal_freq = TDA10046_XTAL_16M, | 1004 | .xtal_freq = TDA10046_XTAL_16M, |
972 | .agc_config = TDA10046_AGC_TDA827X_GPL, | 1005 | .agc_config = TDA10046_AGC_TDA827X_GP00, |
973 | .if_freq = TDA10046_FREQ_045, | 1006 | .if_freq = TDA10046_FREQ_045, |
974 | .request_firmware = NULL, | 1007 | .request_firmware = NULL, |
975 | }; | 1008 | }; |
@@ -1006,7 +1039,7 @@ static struct tda1004x_config ads_tech_duo_config = { | |||
1006 | .invert = 1, | 1039 | .invert = 1, |
1007 | .invert_oclk = 0, | 1040 | .invert_oclk = 0, |
1008 | .xtal_freq = TDA10046_XTAL_16M, | 1041 | .xtal_freq = TDA10046_XTAL_16M, |
1009 | .agc_config = TDA10046_AGC_TDA827X_GPL, | 1042 | .agc_config = TDA10046_AGC_TDA827X_GP00, |
1010 | .if_freq = TDA10046_FREQ_045, | 1043 | .if_freq = TDA10046_FREQ_045, |
1011 | .request_firmware = NULL, | 1044 | .request_firmware = NULL, |
1012 | }; | 1045 | }; |
@@ -1031,7 +1064,7 @@ static struct tda1004x_config tevion_dvbt220rf_config = { | |||
1031 | .invert = 1, | 1064 | .invert = 1, |
1032 | .invert_oclk = 0, | 1065 | .invert_oclk = 0, |
1033 | .xtal_freq = TDA10046_XTAL_16M, | 1066 | .xtal_freq = TDA10046_XTAL_16M, |
1034 | .agc_config = TDA10046_AGC_TDA827X, | 1067 | .agc_config = TDA10046_AGC_TDA827X_GP11, |
1035 | .if_freq = TDA10046_FREQ_045, | 1068 | .if_freq = TDA10046_FREQ_045, |
1036 | .request_firmware = NULL, | 1069 | .request_firmware = NULL, |
1037 | }; | 1070 | }; |
@@ -1076,7 +1109,7 @@ static struct tda1004x_config md8800_dvbt_config = { | |||
1076 | .invert = 1, | 1109 | .invert = 1, |
1077 | .invert_oclk = 0, | 1110 | .invert_oclk = 0, |
1078 | .xtal_freq = TDA10046_XTAL_16M, | 1111 | .xtal_freq = TDA10046_XTAL_16M, |
1079 | .agc_config = TDA10046_AGC_TDA827X, | 1112 | .agc_config = TDA10046_AGC_TDA827X_GP11, |
1080 | .if_freq = TDA10046_FREQ_045, | 1113 | .if_freq = TDA10046_FREQ_045, |
1081 | .request_firmware = NULL, | 1114 | .request_firmware = NULL, |
1082 | }; | 1115 | }; |
@@ -1362,6 +1395,18 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1362 | dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params; | 1395 | dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params; |
1363 | } | 1396 | } |
1364 | break; | 1397 | break; |
1398 | case SAA7134_BOARD_CINERGY_HT_PCMCIA: | ||
1399 | dev->dvb.frontend = dvb_attach(tda10046_attach, | ||
1400 | &cinergy_ht_config, | ||
1401 | &dev->i2c_adap); | ||
1402 | if (dev->dvb.frontend) { | ||
1403 | dev->dvb.frontend->ops.i2c_gate_ctrl = tda8290_i2c_gate_ctrl; | ||
1404 | dev->dvb.frontend->ops.tuner_ops.init = cinergy_ht_tuner_init; | ||
1405 | dev->dvb.frontend->ops.tuner_ops.sleep = cinergy_ht_tuner_sleep; | ||
1406 | dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params; | ||
1407 | |||
1408 | } | ||
1409 | break; | ||
1365 | default: | 1410 | default: |
1366 | printk("%s: Huh? unknown DVB card?\n",dev->name); | 1411 | printk("%s: Huh? unknown DVB card?\n",dev->name); |
1367 | break; | 1412 | break; |
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h index fee75123f9a6..e88ad7b40c47 100644 --- a/drivers/media/video/saa7134/saa7134.h +++ b/drivers/media/video/saa7134/saa7134.h | |||
@@ -230,7 +230,8 @@ struct saa7134_format { | |||
230 | #define SAA7134_BOARD_PINNACLE_PCTV_310i 101 | 230 | #define SAA7134_BOARD_PINNACLE_PCTV_310i 101 |
231 | #define SAA7134_BOARD_AVERMEDIA_STUDIO_507 102 | 231 | #define SAA7134_BOARD_AVERMEDIA_STUDIO_507 102 |
232 | #define SAA7134_BOARD_VIDEOMATE_DVBT_200A 103 | 232 | #define SAA7134_BOARD_VIDEOMATE_DVBT_200A 103 |
233 | #define SAA7134_BOARD_HAUPPAUGE_HVR1110 104 | 233 | #define SAA7134_BOARD_HAUPPAUGE_HVR1110 104 |
234 | #define SAA7134_BOARD_CINERGY_HT_PCMCIA 105 | ||
234 | 235 | ||
235 | #define SAA7134_MAXBOARDS 8 | 236 | #define SAA7134_MAXBOARDS 8 |
236 | #define SAA7134_INPUT_MAX 8 | 237 | #define SAA7134_INPUT_MAX 8 |