aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authorJohannes Stezenbach <js@linuxtv.org>2005-06-24 01:02:35 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-24 03:05:30 -0400
commit776338e121b9db3156bfb4e21622a0219bbab9d4 (patch)
tree5102272b708a9e8ff81165714870d3d38363cc23 /drivers/media/dvb/frontends
parentb6a235b1186dda0800c8bedc2526830a4a36b44e (diff)
[PATCH] dvb: Add generalized dvb-usb driver
Add generalized dvb-usb driver which supports a wide variety of devices. Signed-off-by: Patrick Boettcher <pb@linuxtv.org> Signed-off-by: Johannes Stezenbach <js@linuxtv.org> Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r--drivers/media/dvb/frontends/dib3000-common.c2
-rw-r--r--drivers/media/dvb/frontends/dib3000.h5
-rw-r--r--drivers/media/dvb/frontends/dib3000mb.c20
-rw-r--r--drivers/media/dvb/frontends/dib3000mb_priv.h2
-rw-r--r--drivers/media/dvb/frontends/dib3000mc.c29
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.c94
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.h9
7 files changed, 110 insertions, 51 deletions
diff --git a/drivers/media/dvb/frontends/dib3000-common.c b/drivers/media/dvb/frontends/dib3000-common.c
index 47ab02e133d1..1a4f1f7c228a 100644
--- a/drivers/media/dvb/frontends/dib3000-common.c
+++ b/drivers/media/dvb/frontends/dib3000-common.c
@@ -73,7 +73,7 @@ u16 dib3000_seq[2][2][2] = /* fft,gua, inv */
73 }; 73 };
74 74
75MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de"); 75MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de");
76MODULE_DESCRIPTION("Common functions for the dib3000mb/dib3000mc dvb-frontend drivers"); 76MODULE_DESCRIPTION("Common functions for the dib3000mb/dib3000mc dvb frontend drivers");
77MODULE_LICENSE("GPL"); 77MODULE_LICENSE("GPL");
78 78
79EXPORT_SYMBOL(dib3000_seq); 79EXPORT_SYMBOL(dib3000_seq);
diff --git a/drivers/media/dvb/frontends/dib3000.h b/drivers/media/dvb/frontends/dib3000.h
index 80687c130836..2d5475b5c063 100644
--- a/drivers/media/dvb/frontends/dib3000.h
+++ b/drivers/media/dvb/frontends/dib3000.h
@@ -32,9 +32,8 @@ struct dib3000_config
32 u8 demod_address; 32 u8 demod_address;
33 33
34 /* PLL maintenance and the i2c address of the PLL */ 34 /* PLL maintenance and the i2c address of the PLL */
35 u8 (*pll_addr)(struct dvb_frontend *fe); 35 int (*pll_init)(struct dvb_frontend *fe);
36 int (*pll_init)(struct dvb_frontend *fe, u8 pll_buf[5]); 36 int (*pll_set)(struct dvb_frontend *fe, struct dvb_frontend_parameters* params);
37 int (*pll_set)(struct dvb_frontend *fe, struct dvb_frontend_parameters* params, u8 pll_buf[5]);
38}; 37};
39 38
40struct dib_fe_xfer_ops 39struct dib_fe_xfer_ops
diff --git a/drivers/media/dvb/frontends/dib3000mb.c b/drivers/media/dvb/frontends/dib3000mb.c
index 6f52d649e97e..cd434b7cf9db 100644
--- a/drivers/media/dvb/frontends/dib3000mb.c
+++ b/drivers/media/dvb/frontends/dib3000mb.c
@@ -48,8 +48,6 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=setfe,8=getfe (|-a
48#define deb_setf(args...) dprintk(0x04,args) 48#define deb_setf(args...) dprintk(0x04,args)
49#define deb_getf(args...) dprintk(0x08,args) 49#define deb_getf(args...) dprintk(0x08,args)
50 50
51static int dib3000mb_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_addr);
52
53static int dib3000mb_get_frontend(struct dvb_frontend* fe, 51static int dib3000mb_get_frontend(struct dvb_frontend* fe,
54 struct dvb_frontend_parameters *fep); 52 struct dvb_frontend_parameters *fep);
55 53
@@ -61,10 +59,8 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe,
61 fe_code_rate_t fe_cr = FEC_NONE; 59 fe_code_rate_t fe_cr = FEC_NONE;
62 int search_state, seq; 60 int search_state, seq;
63 61
64 if (tuner && state->config.pll_addr && state->config.pll_set) { 62 if (tuner && state->config.pll_set) {
65 dib3000mb_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe)); 63 state->config.pll_set(fe, fep);
66 state->config.pll_set(fe, fep, NULL);
67 dib3000mb_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe));
68 64
69 deb_setf("bandwidth: "); 65 deb_setf("bandwidth: ");
70 switch (ofdm->bandwidth) { 66 switch (ofdm->bandwidth) {
@@ -389,11 +385,8 @@ static int dib3000mb_fe_init(struct dvb_frontend* fe, int mobile_mode)
389 385
390 wr(DIB3000MB_REG_DATA_IN_DIVERSITY, DIB3000MB_DATA_DIVERSITY_IN_OFF); 386 wr(DIB3000MB_REG_DATA_IN_DIVERSITY, DIB3000MB_DATA_DIVERSITY_IN_OFF);
391 387
392 if (state->config.pll_init) { 388 if (state->config.pll_init)
393 dib3000mb_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe)); 389 state->config.pll_init(fe);
394 state->config.pll_init(fe,NULL);
395 dib3000mb_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe));
396 }
397 390
398 return 0; 391 return 0;
399} 392}
@@ -623,7 +616,7 @@ static int dib3000mb_read_unc_blocks(struct dvb_frontend* fe, u32 *unc)
623{ 616{
624 struct dib3000_state* state = fe->demodulator_priv; 617 struct dib3000_state* state = fe->demodulator_priv;
625 618
626 *unc = rd(DIB3000MB_REG_UNC); 619 *unc = rd(DIB3000MB_REG_PACKET_ERROR_RATE);
627 return 0; 620 return 0;
628} 621}
629 622
@@ -638,9 +631,6 @@ static int dib3000mb_sleep(struct dvb_frontend* fe)
638static int dib3000mb_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings *tune) 631static int dib3000mb_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings *tune)
639{ 632{
640 tune->min_delay_ms = 800; 633 tune->min_delay_ms = 800;
641 tune->step_size = 166667;
642 tune->max_drift = 166667 * 2;
643
644 return 0; 634 return 0;
645} 635}
646 636
diff --git a/drivers/media/dvb/frontends/dib3000mb_priv.h b/drivers/media/dvb/frontends/dib3000mb_priv.h
index 57e61aa5b07b..999b19047816 100644
--- a/drivers/media/dvb/frontends/dib3000mb_priv.h
+++ b/drivers/media/dvb/frontends/dib3000mb_priv.h
@@ -294,7 +294,7 @@ static u16 dib3000mb_reg_filter_coeffs[] = {
294 294
295static u16 dib3000mb_filter_coeffs[] = { 295static u16 dib3000mb_filter_coeffs[] = {
296 226, 160, 29, 296 226, 160, 29,
297 979, 998, 19, 297 979, 998, 19,
298 22, 1019, 1006, 298 22, 1019, 1006,
299 1022, 12, 6, 299 1022, 12, 6,
300 1017, 1017, 3, 300 1017, 1017, 3,
diff --git a/drivers/media/dvb/frontends/dib3000mc.c b/drivers/media/dvb/frontends/dib3000mc.c
index 888f10a5e96b..cd33705a4320 100644
--- a/drivers/media/dvb/frontends/dib3000mc.c
+++ b/drivers/media/dvb/frontends/dib3000mc.c
@@ -48,8 +48,6 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=setfe,8=getfe,16=s
48#define deb_getf(args...) dprintk(0x08,args) 48#define deb_getf(args...) dprintk(0x08,args)
49#define deb_stat(args...) dprintk(0x10,args) 49#define deb_stat(args...) dprintk(0x10,args)
50 50
51static int dib3000mc_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_addr);
52
53static int dib3000mc_set_impulse_noise(struct dib3000_state * state, int mode, 51static int dib3000mc_set_impulse_noise(struct dib3000_state * state, int mode,
54 fe_transmit_mode_t transmission_mode, fe_bandwidth_t bandwidth) 52 fe_transmit_mode_t transmission_mode, fe_bandwidth_t bandwidth)
55{ 53{
@@ -463,10 +461,8 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe,
463 int search_state,auto_val; 461 int search_state,auto_val;
464 u16 val; 462 u16 val;
465 463
466 if (tuner && state->config.pll_addr && state->config.pll_set) { /* initial call from dvb */ 464 if (tuner && state->config.pll_set) { /* initial call from dvb */
467 dib3000mc_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe)); 465 state->config.pll_set(fe,fep);
468 state->config.pll_set(fe,fep,NULL);
469 dib3000mc_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe));
470 466
471 state->last_tuned_freq = fep->frequency; 467 state->last_tuned_freq = fep->frequency;
472 // if (!scanboost) { 468 // if (!scanboost) {
@@ -554,19 +550,15 @@ static int dib3000mc_set_frontend(struct dvb_frontend* fe,
554 dib3000mc_set_adp_cfg(state,ofdm->constellation); 550 dib3000mc_set_adp_cfg(state,ofdm->constellation);
555 wr_foreach(dib3000mc_reg_offset, 551 wr_foreach(dib3000mc_reg_offset,
556 dib3000mc_offset[(ofdm->transmission_mode == TRANSMISSION_MODE_8K)+1]); 552 dib3000mc_offset[(ofdm->transmission_mode == TRANSMISSION_MODE_8K)+1]);
557
558
559 } 553 }
560 return 0; 554 return 0;
561} 555}
562 556
563static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode) 557static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode)
564{ 558{
565 struct dib3000_state *state; 559 struct dib3000_state *state = fe->demodulator_priv;
566
567 deb_info("init start\n"); 560 deb_info("init start\n");
568 561
569 state = fe->demodulator_priv;
570 state->timing_offset = 0; 562 state->timing_offset = 0;
571 state->timing_offset_comp_done = 0; 563 state->timing_offset_comp_done = 0;
572 564
@@ -649,11 +641,9 @@ static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode)
649 641
650 set_or(DIB3000MC_REG_CLK_CFG_7,DIB3000MC_CLK_CFG_7_DIV_IN_OFF); 642 set_or(DIB3000MC_REG_CLK_CFG_7,DIB3000MC_CLK_CFG_7_DIV_IN_OFF);
651 643
652/* if (state->config->pll_init) { 644 if (state->config.pll_init)
653 dib3000mc_tuner_pass_ctrl(fe,1,state->config.pll_addr(fe)); 645 state->config.pll_init(fe);
654 state->config->pll_init(fe,NULL); 646
655 dib3000mc_tuner_pass_ctrl(fe,0,state->config.pll_addr(fe));
656 }*/
657 deb_info("init end\n"); 647 deb_info("init end\n");
658 return 0; 648 return 0;
659} 649}
@@ -688,7 +678,7 @@ static int dib3000mc_read_unc_blocks(struct dvb_frontend* fe, u32 *unc)
688{ 678{
689 struct dib3000_state* state = fe->demodulator_priv; 679 struct dib3000_state* state = fe->demodulator_priv;
690 680
691 *unc = rd(DIB3000MC_REG_PACKET_ERROR_COUNT); 681 *unc = rd(DIB3000MC_REG_PACKET_ERRORS);
692 return 0; 682 return 0;
693} 683}
694 684
@@ -737,10 +727,7 @@ static int dib3000mc_sleep(struct dvb_frontend* fe)
737 727
738static int dib3000mc_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings *tune) 728static int dib3000mc_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings *tune)
739{ 729{
740 tune->min_delay_ms = 2000; 730 tune->min_delay_ms = 1000;
741 tune->step_size = 166667;
742 tune->max_drift = 166667 * 2;
743
744 return 0; 731 return 0;
745} 732}
746 733
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index 2a3c2ce7b2aa..f73b5f48e235 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * $Id: dvb-pll.c,v 1.7 2005/02/10 11:52:02 kraxel Exp $
3 *
4 * descriptions + helper functions for simple dvb plls. 2 * descriptions + helper functions for simple dvb plls.
5 * 3 *
6 * (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] 4 * (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
@@ -114,6 +112,92 @@ struct dvb_pll_desc dvb_pll_unknown_1 = {
114}; 112};
115EXPORT_SYMBOL(dvb_pll_unknown_1); 113EXPORT_SYMBOL(dvb_pll_unknown_1);
116 114
115/* Infineon TUA6010XS
116 * used in Thomson Cable Tuner
117 */
118struct dvb_pll_desc dvb_pll_tua6010xs = {
119 .name = "Infineon TUA6010XS",
120 .min = 44250000,
121 .max = 858000000,
122 .count = 3,
123 .entries = {
124 { 115750000, 36125000, 62500, 0x8e, 0x03 },
125 { 403250000, 36125000, 62500, 0x8e, 0x06 },
126 { 999999999, 36125000, 62500, 0x8e, 0x85 },
127 },
128};
129EXPORT_SYMBOL(dvb_pll_tua6010xs);
130
131/* Panasonic env57h1xd5 (some Philips PLL ?) */
132struct dvb_pll_desc dvb_pll_env57h1xd5 = {
133 .name = "Panasonic ENV57H1XD5",
134 .min = 44250000,
135 .max = 858000000,
136 .count = 4,
137 .entries = {
138 { 153000000, 36291666, 166666, 0xc2, 0x41 },
139 { 470000000, 36291666, 166666, 0xc2, 0x42 },
140 { 526000000, 36291666, 166666, 0xc2, 0x84 },
141 { 999999999, 36291666, 166666, 0xc2, 0xa4 },
142 },
143};
144EXPORT_SYMBOL(dvb_pll_env57h1xd5);
145
146/* Philips TDA6650/TDA6651
147 * used in Panasonic ENV77H11D5
148 */
149static void tda665x_bw(u8 *buf, int bandwidth)
150{
151 if (bandwidth == BANDWIDTH_8_MHZ)
152 buf[3] |= 0x08;
153}
154
155struct dvb_pll_desc dvb_pll_tda665x = {
156 .name = "Philips TDA6650/TDA6651",
157 .min = 44250000,
158 .max = 858000000,
159 .setbw = tda665x_bw,
160 .count = 12,
161 .entries = {
162 { 93834000, 36249333, 166667, 0xca, 0x61 /* 011 0 0 0 01 */ },
163 { 123834000, 36249333, 166667, 0xca, 0xa1 /* 101 0 0 0 01 */ },
164 { 161000000, 36249333, 166667, 0xca, 0xa1 /* 101 0 0 0 01 */ },
165 { 163834000, 36249333, 166667, 0xca, 0xc2 /* 110 0 0 0 10 */ },
166 { 253834000, 36249333, 166667, 0xca, 0x62 /* 011 0 0 0 10 */ },
167 { 383834000, 36249333, 166667, 0xca, 0xa2 /* 101 0 0 0 10 */ },
168 { 443834000, 36249333, 166667, 0xca, 0xc2 /* 110 0 0 0 10 */ },
169 { 444000000, 36249333, 166667, 0xca, 0xc3 /* 110 0 0 0 11 */ },
170 { 583834000, 36249333, 166667, 0xca, 0x63 /* 011 0 0 0 11 */ },
171 { 793834000, 36249333, 166667, 0xca, 0xa3 /* 101 0 0 0 11 */ },
172 { 444834000, 36249333, 166667, 0xca, 0xc3 /* 110 0 0 0 11 */ },
173 { 861000000, 36249333, 166667, 0xca, 0xe3 /* 111 0 0 0 11 */ },
174 }
175};
176EXPORT_SYMBOL(dvb_pll_tda665x);
177
178/* Infineon TUA6034
179 * used in LG TDTP E102P
180 */
181static void tua6034_bw(u8 *buf, int bandwidth)
182{
183 if (BANDWIDTH_7_MHZ != bandwidth)
184 buf[3] |= 0x08;
185}
186
187struct dvb_pll_desc dvb_pll_tua6034 = {
188 .name = "Infineon TUA6034",
189 .min = 44250000,
190 .max = 858000000,
191 .count = 3,
192 .setbw = tua6034_bw,
193 .entries = {
194 { 174500000, 36166667, 62500, 0xce, 0x01 },
195 { 230000000, 36166667, 62500, 0xce, 0x02 },
196 { 999999999, 36166667, 62500, 0xce, 0x04 },
197 },
198};
199EXPORT_SYMBOL(dvb_pll_tua6034);
200
117/* ----------------------------------------------------------- */ 201/* ----------------------------------------------------------- */
118/* code */ 202/* code */
119 203
@@ -160,9 +244,3 @@ EXPORT_SYMBOL(dvb_pll_configure);
160MODULE_DESCRIPTION("dvb pll library"); 244MODULE_DESCRIPTION("dvb pll library");
161MODULE_AUTHOR("Gerd Knorr"); 245MODULE_AUTHOR("Gerd Knorr");
162MODULE_LICENSE("GPL"); 246MODULE_LICENSE("GPL");
163
164/*
165 * Local variables:
166 * c-basic-offset: 8
167 * End:
168 */
diff --git a/drivers/media/dvb/frontends/dvb-pll.h b/drivers/media/dvb/frontends/dvb-pll.h
index c4c3c56c4a81..b796778624b6 100644
--- a/drivers/media/dvb/frontends/dvb-pll.h
+++ b/drivers/media/dvb/frontends/dvb-pll.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: dvb-pll.h,v 1.2 2005/02/10 11:43:41 kraxel Exp $ 2 * descriptions + helper functions for simple dvb plls.
3 */ 3 */
4 4
5#ifndef __DVB_PLL_H__ 5#ifndef __DVB_PLL_H__
@@ -17,7 +17,7 @@ struct dvb_pll_desc {
17 u32 stepsize; 17 u32 stepsize;
18 u8 cb1; 18 u8 cb1;
19 u8 cb2; 19 u8 cb2;
20 } entries[9]; 20 } entries[12];
21}; 21};
22 22
23extern struct dvb_pll_desc dvb_pll_thomson_dtt7579; 23extern struct dvb_pll_desc dvb_pll_thomson_dtt7579;
@@ -26,6 +26,11 @@ extern struct dvb_pll_desc dvb_pll_thomson_dtt7610;
26extern struct dvb_pll_desc dvb_pll_lg_z201; 26extern struct dvb_pll_desc dvb_pll_lg_z201;
27extern struct dvb_pll_desc dvb_pll_unknown_1; 27extern struct dvb_pll_desc dvb_pll_unknown_1;
28 28
29extern struct dvb_pll_desc dvb_pll_tua6010xs;
30extern struct dvb_pll_desc dvb_pll_env57h1xd5;
31extern struct dvb_pll_desc dvb_pll_tua6034;
32extern struct dvb_pll_desc dvb_pll_tda665x;
33
29int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf, 34int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf,
30 u32 freq, int bandwidth); 35 u32 freq, int bandwidth);
31 36