aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRegis Prevot <regis.prevot@anevia.com>2006-01-11 20:31:53 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-11 21:11:32 -0500
commitf8bf134d5f697311c04e867b6733d047a4b55a12 (patch)
treebe1f5fb03a8c59fa774d056a639d3ed9640e36c1 /drivers
parentac9ffb90b8d0d28e3d9e5b5a045ee870a6269b5f (diff)
V4L/DVB (3351): adding support for knc1 Tv Star dvb-s
- Added knc1 tv star dvb-s support with philips tuner sd1878. Signed-off-by: Regis Prevot <regis.prevot@anevia.com> Signed-off-by: Michael Krufky <mkrufky@m1k.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.c17
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.h1
-rw-r--r--drivers/media/dvb/ttpci/budget-av.c125
-rw-r--r--drivers/media/dvb/ttpci/budget.h1
4 files changed, 144 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index a3d57ce9dd12..757075f007c1 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -345,6 +345,23 @@ struct dvb_pll_desc dvb_pll_tbmv30111in = {
345}; 345};
346EXPORT_SYMBOL(dvb_pll_tbmv30111in); 346EXPORT_SYMBOL(dvb_pll_tbmv30111in);
347 347
348/*
349 * Philips SD1878 Tuner.
350 */
351struct dvb_pll_desc dvb_pll_philips_sd1878_tda8261 = {
352 .name = "Philips SD1878",
353 .min = 950000,
354 .max = 2150000,
355 .count = 4,
356 .entries = {
357 { 1250000, 499, 500, 0xc4, 0x00},
358 { 1550000, 499, 500, 0xc4, 0x40},
359 { 2050000, 499, 500, 0xc4, 0x80},
360 { 2150000, 499, 500, 0xc4, 0xc0},
361 },
362};
363EXPORT_SYMBOL(dvb_pll_philips_sd1878_tda8261);
364
348/* ----------------------------------------------------------- */ 365/* ----------------------------------------------------------- */
349/* code */ 366/* code */
350 367
diff --git a/drivers/media/dvb/frontends/dvb-pll.h b/drivers/media/dvb/frontends/dvb-pll.h
index 24d4d2e9acd8..f682c09189b3 100644
--- a/drivers/media/dvb/frontends/dvb-pll.h
+++ b/drivers/media/dvb/frontends/dvb-pll.h
@@ -39,6 +39,7 @@ extern struct dvb_pll_desc dvb_pll_tded4;
39extern struct dvb_pll_desc dvb_pll_tuv1236d; 39extern struct dvb_pll_desc dvb_pll_tuv1236d;
40extern struct dvb_pll_desc dvb_pll_tdhu2; 40extern struct dvb_pll_desc dvb_pll_tdhu2;
41extern struct dvb_pll_desc dvb_pll_tbmv30111in; 41extern struct dvb_pll_desc dvb_pll_tbmv30111in;
42extern struct dvb_pll_desc dvb_pll_philips_sd1878_tda8261;
42 43
43int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf, 44int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf,
44 u32 freq, int bandwidth); 45 u32 freq, int bandwidth);
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c
index aa2645895769..1465c04e49aa 100644
--- a/drivers/media/dvb/ttpci/budget-av.c
+++ b/drivers/media/dvb/ttpci/budget-av.c
@@ -37,6 +37,7 @@
37#include "stv0299.h" 37#include "stv0299.h"
38#include "tda10021.h" 38#include "tda10021.h"
39#include "tda1004x.h" 39#include "tda1004x.h"
40#include "dvb-pll.h"
40#include <media/saa7146_vv.h> 41#include <media/saa7146_vv.h>
41#include <linux/module.h> 42#include <linux/module.h>
42#include <linux/errno.h> 43#include <linux/errno.h>
@@ -864,8 +865,117 @@ static struct tda1004x_config philips_tu1216_config = {
864 .request_firmware = philips_tu1216_request_firmware, 865 .request_firmware = philips_tu1216_request_firmware,
865}; 866};
866 867
868static u8 philips_sd1878_inittab[] = {
869 0x01, 0x15,
870 0x02, 0x30,
871 0x03, 0x00,
872 0x04, 0x7d,
873 0x05, 0x35,
874 0x06, 0x40,
875 0x07, 0x00,
876 0x08, 0x43,
877 0x09, 0x02,
878 0x0C, 0x51,
879 0x0D, 0x82,
880 0x0E, 0x23,
881 0x10, 0x3f,
882 0x11, 0x84,
883 0x12, 0xb9,
884 0x15, 0xc9,
885 0x16, 0x19,
886 0x17, 0x8c,
887 0x18, 0x59,
888 0x19, 0xf8,
889 0x1a, 0xfe,
890 0x1c, 0x7f,
891 0x1d, 0x00,
892 0x1e, 0x00,
893 0x1f, 0x50,
894 0x20, 0x00,
895 0x21, 0x00,
896 0x22, 0x00,
897 0x23, 0x00,
898 0x28, 0x00,
899 0x29, 0x28,
900 0x2a, 0x14,
901 0x2b, 0x0f,
902 0x2c, 0x09,
903 0x2d, 0x09,
904 0x31, 0x1f,
905 0x32, 0x19,
906 0x33, 0xfc,
907 0x34, 0x93,
908 0xff, 0xff
909};
910
911static int philips_sd1878_tda8261_pll_set(struct dvb_frontend *fe,
912 struct i2c_adapter *i2c,
913 struct dvb_frontend_parameters *params)
914{
915 u8 buf[4];
916 int rc;
917 struct i2c_msg tuner_msg = {.addr=0x60,.flags=0,.buf=buf,.len=sizeof(buf)};
918
919 if((params->frequency < 950000) || (params->frequency > 2150000))
920 return -EINVAL;
921
922 rc=dvb_pll_configure(&dvb_pll_philips_sd1878_tda8261, buf,
923 params->frequency, 0);
924 if(rc < 0) return rc;
867 925
926 if(i2c_transfer(i2c, &tuner_msg, 1) != 1)
927 return -EIO;
868 928
929 return 0;
930}
931
932static int philips_sd1878_ci_set_symbol_rate(struct dvb_frontend *fe,
933 u32 srate, u32 ratio)
934{
935 u8 aclk = 0;
936 u8 bclk = 0;
937 u8 m1;
938
939 aclk = 0xb5;
940 if (srate < 2000000)
941 bclk = 0x86;
942 else if (srate < 5000000)
943 bclk = 0x89;
944 else if (srate < 15000000)
945 bclk = 0x8f;
946 else if (srate < 45000000)
947 bclk = 0x95;
948
949 m1 = 0x14;
950 if (srate < 4000000)
951 m1 = 0x10;
952
953 stv0299_writereg(fe, 0x0e, 0x23);
954 stv0299_writereg(fe, 0x0f, 0x94);
955 stv0299_writereg(fe, 0x10, 0x39);
956 stv0299_writereg(fe, 0x13, aclk);
957 stv0299_writereg(fe, 0x14, bclk);
958 stv0299_writereg(fe, 0x15, 0xc9);
959 stv0299_writereg(fe, 0x1f, (ratio >> 16) & 0xff);
960 stv0299_writereg(fe, 0x20, (ratio >> 8) & 0xff);
961 stv0299_writereg(fe, 0x21, (ratio) & 0xf0);
962 stv0299_writereg(fe, 0x0f, 0x80 | m1);
963
964 return 0;
965}
966
967static struct stv0299_config philips_sd1878_config = {
968 .demod_address = 0x68,
969 .inittab = philips_sd1878_inittab,
970 .mclk = 88000000UL,
971 .invert = 0,
972 .skip_reinit = 0,
973 .lock_output = STV0229_LOCKOUTPUT_1,
974 .volt13_op0_op1 = STV0299_VOLT13_OP0,
975 .min_delay_ms = 100,
976 .set_symbol_rate = philips_sd1878_ci_set_symbol_rate,
977 .pll_set = philips_sd1878_tda8261_pll_set,
978};
869 979
870static u8 read_pwm(struct budget_av *budget_av) 980static u8 read_pwm(struct budget_av *budget_av)
871{ 981{
@@ -886,7 +996,10 @@ static u8 read_pwm(struct budget_av *budget_av)
886#define SUBID_DVBS_KNC1_PLUS 0x0011 996#define SUBID_DVBS_KNC1_PLUS 0x0011
887#define SUBID_DVBS_TYPHOON 0x4f56 997#define SUBID_DVBS_TYPHOON 0x4f56
888#define SUBID_DVBS_CINERGY1200 0x1154 998#define SUBID_DVBS_CINERGY1200 0x1154
999#define SUBID_DVBS_CYNERGY1200N 0x1155
889 1000
1001#define SUBID_DVBS_TV_STAR 0x0014
1002#define SUBID_DVBS_TV_STAR_CI 0x0016
890#define SUBID_DVBC_KNC1 0x0020 1003#define SUBID_DVBC_KNC1 0x0020
891#define SUBID_DVBC_KNC1_PLUS 0x0021 1004#define SUBID_DVBC_KNC1_PLUS 0x0021
892#define SUBID_DVBC_CINERGY1200 0x1156 1005#define SUBID_DVBC_CINERGY1200 0x1156
@@ -922,6 +1035,13 @@ static void frontend_init(struct budget_av *budget_av)
922 } 1035 }
923 break; 1036 break;
924 1037
1038 case SUBID_DVBS_TV_STAR:
1039 case SUBID_DVBS_TV_STAR_CI:
1040 case SUBID_DVBS_CYNERGY1200N:
1041 fe = stv0299_attach(&philips_sd1878_config,
1042 &budget_av->budget.i2c_adap);
1043 break;
1044
925 case SUBID_DVBS_KNC1_PLUS: 1045 case SUBID_DVBS_KNC1_PLUS:
926 case SUBID_DVBS_TYPHOON: 1046 case SUBID_DVBS_TYPHOON:
927 fe = stv0299_attach(&typhoon_config, 1047 fe = stv0299_attach(&typhoon_config,
@@ -1164,10 +1284,12 @@ static struct saa7146_extension budget_extension;
1164MAKE_BUDGET_INFO(knc1s, "KNC1 DVB-S", BUDGET_KNC1S); 1284MAKE_BUDGET_INFO(knc1s, "KNC1 DVB-S", BUDGET_KNC1S);
1165MAKE_BUDGET_INFO(knc1c, "KNC1 DVB-C", BUDGET_KNC1C); 1285MAKE_BUDGET_INFO(knc1c, "KNC1 DVB-C", BUDGET_KNC1C);
1166MAKE_BUDGET_INFO(knc1t, "KNC1 DVB-T", BUDGET_KNC1T); 1286MAKE_BUDGET_INFO(knc1t, "KNC1 DVB-T", BUDGET_KNC1T);
1287MAKE_BUDGET_INFO(kncxs, "KNC TV STAR DVB-S", BUDGET_TVSTAR);
1167MAKE_BUDGET_INFO(knc1sp, "KNC1 DVB-S Plus", BUDGET_KNC1SP); 1288MAKE_BUDGET_INFO(knc1sp, "KNC1 DVB-S Plus", BUDGET_KNC1SP);
1168MAKE_BUDGET_INFO(knc1cp, "KNC1 DVB-C Plus", BUDGET_KNC1CP); 1289MAKE_BUDGET_INFO(knc1cp, "KNC1 DVB-C Plus", BUDGET_KNC1CP);
1169MAKE_BUDGET_INFO(knc1tp, "KNC1 DVB-T Plus", BUDGET_KNC1TP); 1290MAKE_BUDGET_INFO(knc1tp, "KNC1 DVB-T Plus", BUDGET_KNC1TP);
1170MAKE_BUDGET_INFO(cin1200s, "TerraTec Cinergy 1200 DVB-S", BUDGET_CIN1200S); 1291MAKE_BUDGET_INFO(cin1200s, "TerraTec Cinergy 1200 DVB-S", BUDGET_CIN1200S);
1292MAKE_BUDGET_INFO(cin1200sn, "TerraTec Cinergy 1200 DVB-S", BUDGET_CIN1200S);
1171MAKE_BUDGET_INFO(cin1200c, "Terratec Cinergy 1200 DVB-C", BUDGET_CIN1200C); 1293MAKE_BUDGET_INFO(cin1200c, "Terratec Cinergy 1200 DVB-C", BUDGET_CIN1200C);
1172MAKE_BUDGET_INFO(cin1200t, "Terratec Cinergy 1200 DVB-T", BUDGET_CIN1200T); 1294MAKE_BUDGET_INFO(cin1200t, "Terratec Cinergy 1200 DVB-T", BUDGET_CIN1200T);
1173 1295
@@ -1176,11 +1298,14 @@ static struct pci_device_id pci_tbl[] = {
1176 MAKE_EXTENSION_PCI(knc1s, 0x1131, 0x0010), 1298 MAKE_EXTENSION_PCI(knc1s, 0x1131, 0x0010),
1177 MAKE_EXTENSION_PCI(knc1s, 0x1894, 0x0010), 1299 MAKE_EXTENSION_PCI(knc1s, 0x1894, 0x0010),
1178 MAKE_EXTENSION_PCI(knc1sp, 0x1131, 0x0011), 1300 MAKE_EXTENSION_PCI(knc1sp, 0x1131, 0x0011),
1301 MAKE_EXTENSION_PCI(kncxs, 0x1894, 0x0014),
1302 MAKE_EXTENSION_PCI(kncxs, 0x1894, 0x0016),
1179 MAKE_EXTENSION_PCI(knc1c, 0x1894, 0x0020), 1303 MAKE_EXTENSION_PCI(knc1c, 0x1894, 0x0020),
1180 MAKE_EXTENSION_PCI(knc1cp, 0x1894, 0x0021), 1304 MAKE_EXTENSION_PCI(knc1cp, 0x1894, 0x0021),
1181 MAKE_EXTENSION_PCI(knc1t, 0x1894, 0x0030), 1305 MAKE_EXTENSION_PCI(knc1t, 0x1894, 0x0030),
1182 MAKE_EXTENSION_PCI(knc1tp, 0x1894, 0x0031), 1306 MAKE_EXTENSION_PCI(knc1tp, 0x1894, 0x0031),
1183 MAKE_EXTENSION_PCI(cin1200s, 0x153b, 0x1154), 1307 MAKE_EXTENSION_PCI(cin1200s, 0x153b, 0x1154),
1308 MAKE_EXTENSION_PCI(cin1200sn, 0x153b, 0x1155),
1184 MAKE_EXTENSION_PCI(cin1200c, 0x153b, 0x1156), 1309 MAKE_EXTENSION_PCI(cin1200c, 0x153b, 0x1156),
1185 MAKE_EXTENSION_PCI(cin1200t, 0x153b, 0x1157), 1310 MAKE_EXTENSION_PCI(cin1200t, 0x153b, 0x1157),
1186 { 1311 {
diff --git a/drivers/media/dvb/ttpci/budget.h b/drivers/media/dvb/ttpci/budget.h
index c8d48cfba277..c7bb63c4d98d 100644
--- a/drivers/media/dvb/ttpci/budget.h
+++ b/drivers/media/dvb/ttpci/budget.h
@@ -95,6 +95,7 @@ static struct saa7146_pci_extension_data x_var = { \
95#define BUDGET_KNC1SP 11 95#define BUDGET_KNC1SP 11
96#define BUDGET_KNC1CP 12 96#define BUDGET_KNC1CP 12
97#define BUDGET_KNC1TP 13 97#define BUDGET_KNC1TP 13
98#define BUDGET_TVSTAR 14
98 99
99#define BUDGET_VIDEO_PORTA 0 100#define BUDGET_VIDEO_PORTA 0
100#define BUDGET_VIDEO_PORTB 1 101#define BUDGET_VIDEO_PORTB 1