aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/dvb/frontends/dvb-pll.c82
1 files changed, 53 insertions, 29 deletions
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index 5f4762edc405..7b133248b2bd 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -24,6 +24,36 @@
24 24
25#include "dvb-pll.h" 25#include "dvb-pll.h"
26 26
27struct dvb_pll_priv {
28 /* pll number */
29 int nr;
30
31 /* i2c details */
32 int pll_i2c_address;
33 struct i2c_adapter *i2c;
34
35 /* the PLL descriptor */
36 struct dvb_pll_desc *pll_desc;
37
38 /* cached frequency/bandwidth */
39 u32 frequency;
40 u32 bandwidth;
41};
42
43#define DVB_PLL_MAX 16
44
45static unsigned int dvb_pll_devcount;
46
47static int debug = 0;
48module_param(debug, int, 0644);
49MODULE_PARM_DESC(debug, "enable verbose debug messages");
50
51static unsigned int input[DVB_PLL_MAX] = { [ 0 ... (DVB_PLL_MAX-1) ] = 0 };
52module_param_array(input, int, NULL, 0644);
53MODULE_PARM_DESC(input,"specify rf input choice, 0 for autoselect (default)");
54
55/* ----------------------------------------------------------- */
56
27struct dvb_pll_desc { 57struct dvb_pll_desc {
28 char *name; 58 char *name;
29 u32 min; 59 u32 min;
@@ -362,14 +392,32 @@ static struct dvb_pll_desc dvb_pll_tdhu2 = {
362static void tuv1236d_rf(struct dvb_frontend *fe, u8 *buf, 392static void tuv1236d_rf(struct dvb_frontend *fe, u8 *buf,
363 const struct dvb_frontend_parameters *params) 393 const struct dvb_frontend_parameters *params)
364{ 394{
365 switch (params->u.vsb.modulation) { 395 struct dvb_pll_priv *priv = fe->tuner_priv;
366 case QAM_64: 396 unsigned int new_rf = input[priv->nr];
367 case QAM_256: 397
398 if ((new_rf == 0) || (new_rf > 2)) {
399 switch (params->u.vsb.modulation) {
400 case QAM_64:
401 case QAM_256:
402 new_rf = 1;
403 break;
404 case VSB_8:
405 default:
406 new_rf = 2;
407 }
408 }
409
410 switch (new_rf) {
411 case 1:
368 buf[3] |= 0x08; 412 buf[3] |= 0x08;
369 break; 413 break;
370 case VSB_8: 414 case 2:
371 default:
372 buf[3] &= ~0x08; 415 buf[3] &= ~0x08;
416 break;
417 default:
418 printk(KERN_WARNING
419 "%s: unhandled rf input selection: %d",
420 __FUNCTION__, new_rf);
373 } 421 }
374} 422}
375 423
@@ -554,32 +602,8 @@ static struct dvb_pll_desc *pll_list[] = {
554}; 602};
555 603
556/* ----------------------------------------------------------- */ 604/* ----------------------------------------------------------- */
557
558struct dvb_pll_priv {
559 /* pll number */
560 int nr;
561
562 /* i2c details */
563 int pll_i2c_address;
564 struct i2c_adapter *i2c;
565
566 /* the PLL descriptor */
567 struct dvb_pll_desc *pll_desc;
568
569 /* cached frequency/bandwidth */
570 u32 frequency;
571 u32 bandwidth;
572};
573
574/* ----------------------------------------------------------- */
575/* code */ 605/* code */
576 606
577static int debug = 0;
578module_param(debug, int, 0644);
579MODULE_PARM_DESC(debug, "enable verbose debug messages");
580
581static unsigned int dvb_pll_devcount;
582
583static int dvb_pll_configure(struct dvb_frontend *fe, u8 *buf, 607static int dvb_pll_configure(struct dvb_frontend *fe, u8 *buf,
584 const struct dvb_frontend_parameters *params) 608 const struct dvb_frontend_parameters *params)
585{ 609{