aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/ttpci
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2005-09-09 16:03:07 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 16:57:45 -0400
commitdc27a1696089a9a9d317fc815915e6761e22eeb5 (patch)
treece797c46a6c8ef98d7c7bcc5da90e210967799d3 /drivers/media/dvb/ttpci
parentf63f5346c943008fe8f6ac66a9026f6c35e24947 (diff)
[PATCH] dvb: budget-ci: add support for TT DVB-C CI card
Add support for TT DVB-C CI card. Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net> Signed-off-by: Johannes Stezenbach <js@linuxtv.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/dvb/ttpci')
-rw-r--r--drivers/media/dvb/ttpci/av7110.c95
-rw-r--r--drivers/media/dvb/ttpci/budget-ci.c188
2 files changed, 281 insertions, 2 deletions
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index c91cf8958b38..48e8097d8430 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -1934,6 +1934,98 @@ static struct sp8870_config alps_tdlb7_config = {
1934}; 1934};
1935 1935
1936 1936
1937static u8 nexusca_stv0297_inittab[] = {
1938 0x80, 0x01,
1939 0x80, 0x00,
1940 0x81, 0x01,
1941 0x81, 0x00,
1942 0x00, 0x09,
1943 0x01, 0x69,
1944 0x03, 0x00,
1945 0x04, 0x00,
1946 0x07, 0x00,
1947 0x08, 0x00,
1948 0x20, 0x00,
1949 0x21, 0x40,
1950 0x22, 0x00,
1951 0x23, 0x00,
1952 0x24, 0x40,
1953 0x25, 0x88,
1954 0x30, 0xff,
1955 0x31, 0x00,
1956 0x32, 0xff,
1957 0x33, 0x00,
1958 0x34, 0x50,
1959 0x35, 0x7f,
1960 0x36, 0x00,
1961 0x37, 0x20,
1962 0x38, 0x00,
1963 0x40, 0x1c,
1964 0x41, 0xff,
1965 0x42, 0x29,
1966 0x43, 0x00,
1967 0x44, 0xff,
1968 0x45, 0x00,
1969 0x46, 0x00,
1970 0x49, 0x04,
1971 0x4a, 0x00,
1972 0x4b, 0x7b,
1973 0x52, 0x30,
1974 0x55, 0xae,
1975 0x56, 0x47,
1976 0x57, 0xe1,
1977 0x58, 0x3a,
1978 0x5a, 0x1e,
1979 0x5b, 0x34,
1980 0x60, 0x00,
1981 0x63, 0x00,
1982 0x64, 0x00,
1983 0x65, 0x00,
1984 0x66, 0x00,
1985 0x67, 0x00,
1986 0x68, 0x00,
1987 0x69, 0x00,
1988 0x6a, 0x02,
1989 0x6b, 0x00,
1990 0x70, 0xff,
1991 0x71, 0x00,
1992 0x72, 0x00,
1993 0x73, 0x00,
1994 0x74, 0x0c,
1995 0x80, 0x00,
1996 0x81, 0x00,
1997 0x82, 0x00,
1998 0x83, 0x00,
1999 0x84, 0x04,
2000 0x85, 0x80,
2001 0x86, 0x24,
2002 0x87, 0x78,
2003 0x88, 0x10,
2004 0x89, 0x00,
2005 0x90, 0x01,
2006 0x91, 0x01,
2007 0xa0, 0x04,
2008 0xa1, 0x00,
2009 0xa2, 0x00,
2010 0xb0, 0x91,
2011 0xb1, 0x0b,
2012 0xc0, 0x53,
2013 0xc1, 0x70,
2014 0xc2, 0x12,
2015 0xd0, 0x00,
2016 0xd1, 0x00,
2017 0xd2, 0x00,
2018 0xd3, 0x00,
2019 0xd4, 0x00,
2020 0xd5, 0x00,
2021 0xde, 0x00,
2022 0xdf, 0x00,
2023 0x61, 0x49,
2024 0x62, 0x0b,
2025 0x53, 0x08,
2026 0x59, 0x08,
2027 0xff, 0xff,
2028};
1937 2029
1938static int nexusca_stv0297_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) 2030static int nexusca_stv0297_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
1939{ 2031{
@@ -1982,6 +2074,7 @@ static int nexusca_stv0297_pll_set(struct dvb_frontend* fe, struct dvb_frontend_
1982static struct stv0297_config nexusca_stv0297_config = { 2074static struct stv0297_config nexusca_stv0297_config = {
1983 2075
1984 .demod_address = 0x1C, 2076 .demod_address = 0x1C,
2077 .inittab = nexusca_stv0297_inittab,
1985 .invert = 1, 2078 .invert = 1,
1986 .pll_set = nexusca_stv0297_pll_set, 2079 .pll_set = nexusca_stv0297_pll_set,
1987}; 2080};
@@ -2259,7 +2352,7 @@ static int frontend_init(struct av7110 *av7110)
2259 2352
2260 case 0x000A: // Hauppauge/TT Nexus-CA rev1.X 2353 case 0x000A: // Hauppauge/TT Nexus-CA rev1.X
2261 2354
2262 av7110->fe = stv0297_attach(&nexusca_stv0297_config, &av7110->i2c_adap, 0x7b); 2355 av7110->fe = stv0297_attach(&nexusca_stv0297_config, &av7110->i2c_adap);
2263 if (av7110->fe) { 2356 if (av7110->fe) {
2264 /* set TDA9819 into DVB mode */ 2357 /* set TDA9819 into DVB mode */
2265 saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD) 2358 saa7146_setgpio(av7110->dev, 1, SAA7146_GPIO_OUTLO); // TDA9198 pin9(STD)
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c
index 88f27a532163..2980db3ef22f 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -40,6 +40,7 @@
40 40
41#include "dvb_ca_en50221.h" 41#include "dvb_ca_en50221.h"
42#include "stv0299.h" 42#include "stv0299.h"
43#include "stv0297.h"
43#include "tda1004x.h" 44#include "tda1004x.h"
44 45
45#define DEBIADDR_IR 0x1234 46#define DEBIADDR_IR 0x1234
@@ -847,6 +848,180 @@ static struct tda1004x_config philips_tdm1316l_config = {
847 .request_firmware = philips_tdm1316l_request_firmware, 848 .request_firmware = philips_tdm1316l_request_firmware,
848}; 849};
849 850
851static int dvbc_philips_tdm1316l_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
852{
853 struct budget_ci *budget_ci = (struct budget_ci *) fe->dvb->priv;
854 u8 tuner_buf[5];
855 struct i2c_msg tuner_msg = {.addr = budget_ci->tuner_pll_address,
856 .flags = 0,
857 .buf = tuner_buf,
858 .len = sizeof(tuner_buf) };
859 int tuner_frequency = 0;
860 u8 band, cp, filter;
861
862 // determine charge pump
863 tuner_frequency = params->frequency + 36125000;
864 if (tuner_frequency < 87000000)
865 return -EINVAL;
866 else if (tuner_frequency < 130000000) {
867 cp = 3;
868 band = 1;
869 } else if (tuner_frequency < 160000000) {
870 cp = 5;
871 band = 1;
872 } else if (tuner_frequency < 200000000) {
873 cp = 6;
874 band = 1;
875 } else if (tuner_frequency < 290000000) {
876 cp = 3;
877 band = 2;
878 } else if (tuner_frequency < 420000000) {
879 cp = 5;
880 band = 2;
881 } else if (tuner_frequency < 480000000) {
882 cp = 6;
883 band = 2;
884 } else if (tuner_frequency < 620000000) {
885 cp = 3;
886 band = 4;
887 } else if (tuner_frequency < 830000000) {
888 cp = 5;
889 band = 4;
890 } else if (tuner_frequency < 895000000) {
891 cp = 7;
892 band = 4;
893 } else
894 return -EINVAL;
895
896 // assume PLL filter should always be 8MHz for the moment.
897 filter = 1;
898
899 // calculate divisor
900 tuner_frequency = (params->frequency + 36125000 + (62500/2)) / 62500;
901
902 // setup tuner buffer
903 tuner_buf[0] = tuner_frequency >> 8;
904 tuner_buf[1] = tuner_frequency & 0xff;
905 tuner_buf[2] = 0xc8;
906 tuner_buf[3] = (cp << 5) | (filter << 3) | band;
907 tuner_buf[4] = 0x80;
908
909 stv0297_enable_plli2c(fe);
910 if (i2c_transfer(&budget_ci->budget.i2c_adap, &tuner_msg, 1) != 1)
911 return -EIO;
912
913 msleep(50);
914
915 stv0297_enable_plli2c(fe);
916 if (i2c_transfer(&budget_ci->budget.i2c_adap, &tuner_msg, 1) != 1)
917 return -EIO;
918
919 msleep(1);
920
921 return 0;
922}
923
924static u8 dvbc_philips_tdm1316l_inittab[] = {
925 0x80, 0x01,
926 0x80, 0x00,
927 0x81, 0x01,
928 0x81, 0x00,
929 0x00, 0x09,
930 0x01, 0x69,
931 0x03, 0x00,
932 0x04, 0x00,
933 0x07, 0x00,
934 0x08, 0x00,
935 0x20, 0x00,
936 0x21, 0x40,
937 0x22, 0x00,
938 0x23, 0x00,
939 0x24, 0x40,
940 0x25, 0x88,
941 0x30, 0xff,
942 0x31, 0x00,
943 0x32, 0xff,
944 0x33, 0x00,
945 0x34, 0x50,
946 0x35, 0x7f,
947 0x36, 0x00,
948 0x37, 0x20,
949 0x38, 0x00,
950 0x40, 0x1c,
951 0x41, 0xff,
952 0x42, 0x29,
953 0x43, 0x20,
954 0x44, 0xff,
955 0x45, 0x00,
956 0x46, 0x00,
957 0x49, 0x04,
958 0x4a, 0x00,
959 0x4b, 0x7b,
960 0x52, 0x30,
961 0x55, 0xae,
962 0x56, 0x47,
963 0x57, 0xe1,
964 0x58, 0x3a,
965 0x5a, 0x1e,
966 0x5b, 0x34,
967 0x60, 0x00,
968 0x63, 0x00,
969 0x64, 0x00,
970 0x65, 0x00,
971 0x66, 0x00,
972 0x67, 0x00,
973 0x68, 0x00,
974 0x69, 0x00,
975 0x6a, 0x02,
976 0x6b, 0x00,
977 0x70, 0xff,
978 0x71, 0x00,
979 0x72, 0x00,
980 0x73, 0x00,
981 0x74, 0x0c,
982 0x80, 0x00,
983 0x81, 0x00,
984 0x82, 0x00,
985 0x83, 0x00,
986 0x84, 0x04,
987 0x85, 0x80,
988 0x86, 0x24,
989 0x87, 0x78,
990 0x88, 0x10,
991 0x89, 0x00,
992 0x90, 0x01,
993 0x91, 0x01,
994 0xa0, 0x04,
995 0xa1, 0x00,
996 0xa2, 0x00,
997 0xb0, 0x91,
998 0xb1, 0x0b,
999 0xc0, 0x53,
1000 0xc1, 0x70,
1001 0xc2, 0x12,
1002 0xd0, 0x00,
1003 0xd1, 0x00,
1004 0xd2, 0x00,
1005 0xd3, 0x00,
1006 0xd4, 0x00,
1007 0xd5, 0x00,
1008 0xde, 0x00,
1009 0xdf, 0x00,
1010 0x61, 0x38,
1011 0x62, 0x0a,
1012 0x53, 0x13,
1013 0x59, 0x08,
1014 0xff, 0xff,
1015};
1016
1017static struct stv0297_config dvbc_philips_tdm1316l_config = {
1018 .demod_address = 0x1c,
1019 .inittab = dvbc_philips_tdm1316l_inittab,
1020 .invert = 0,
1021 .pll_set = dvbc_philips_tdm1316l_pll_set,
1022};
1023
1024
850 1025
851 1026
852static void frontend_init(struct budget_ci *budget_ci) 1027static void frontend_init(struct budget_ci *budget_ci)
@@ -868,6 +1043,15 @@ static void frontend_init(struct budget_ci *budget_ci)
868 } 1043 }
869 break; 1044 break;
870 1045
1046 case 0x1010: // TT DVB-C CI budget (stv0297/Philips tdm1316l(tda6651tt))
1047 budget_ci->tuner_pll_address = 0x61;
1048 budget_ci->budget.dvb_frontend =
1049 stv0297_attach(&dvbc_philips_tdm1316l_config, &budget_ci->budget.i2c_adap);
1050 if (budget_ci->budget.dvb_frontend) {
1051 break;
1052 }
1053 break;
1054
871 case 0x1011: // Hauppauge/TT Nova-T budget (tda10045/Philips tdm1316l(tda6651tt) + TDA9889) 1055 case 0x1011: // Hauppauge/TT Nova-T budget (tda10045/Philips tdm1316l(tda6651tt) + TDA9889)
872 budget_ci->tuner_pll_address = 0x63; 1056 budget_ci->tuner_pll_address = 0x63;
873 budget_ci->budget.dvb_frontend = 1057 budget_ci->budget.dvb_frontend =
@@ -877,7 +1061,7 @@ static void frontend_init(struct budget_ci *budget_ci)
877 } 1061 }
878 break; 1062 break;
879 1063
880 case 0x1012: // Hauppauge/TT Nova-T CI budget (tda10045/Philips tdm1316l(tda6651tt) + TDA9889) 1064 case 0x1012: // TT DVB-T CI budget (tda10046/Philips tdm1316l(tda6651tt))
881 budget_ci->tuner_pll_address = 0x60; 1065 budget_ci->tuner_pll_address = 0x60;
882 budget_ci->budget.dvb_frontend = 1066 budget_ci->budget.dvb_frontend =
883 tda10046_attach(&philips_tdm1316l_config, &budget_ci->budget.i2c_adap); 1067 tda10046_attach(&philips_tdm1316l_config, &budget_ci->budget.i2c_adap);
@@ -965,10 +1149,12 @@ static struct saa7146_extension budget_extension;
965MAKE_BUDGET_INFO(ttbci, "TT-Budget/WinTV-NOVA-CI PCI", BUDGET_TT_HW_DISEQC); 1149MAKE_BUDGET_INFO(ttbci, "TT-Budget/WinTV-NOVA-CI PCI", BUDGET_TT_HW_DISEQC);
966MAKE_BUDGET_INFO(ttbt2, "TT-Budget/WinTV-NOVA-T PCI", BUDGET_TT); 1150MAKE_BUDGET_INFO(ttbt2, "TT-Budget/WinTV-NOVA-T PCI", BUDGET_TT);
967MAKE_BUDGET_INFO(ttbtci, "TT-Budget-T-CI PCI", BUDGET_TT); 1151MAKE_BUDGET_INFO(ttbtci, "TT-Budget-T-CI PCI", BUDGET_TT);
1152MAKE_BUDGET_INFO(ttbcci, "TT-Budget-C-CI PCI", BUDGET_TT);
968 1153
969static struct pci_device_id pci_tbl[] = { 1154static struct pci_device_id pci_tbl[] = {
970 MAKE_EXTENSION_PCI(ttbci, 0x13c2, 0x100c), 1155 MAKE_EXTENSION_PCI(ttbci, 0x13c2, 0x100c),
971 MAKE_EXTENSION_PCI(ttbci, 0x13c2, 0x100f), 1156 MAKE_EXTENSION_PCI(ttbci, 0x13c2, 0x100f),
1157 MAKE_EXTENSION_PCI(ttbcci, 0x13c2, 0x1010),
972 MAKE_EXTENSION_PCI(ttbt2, 0x13c2, 0x1011), 1158 MAKE_EXTENSION_PCI(ttbt2, 0x13c2, 0x1011),
973 MAKE_EXTENSION_PCI(ttbtci, 0x13c2, 0x1012), 1159 MAKE_EXTENSION_PCI(ttbtci, 0x13c2, 0x1012),
974 { 1160 {