diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2007-09-07 17:19:57 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-09 21:14:46 -0400 |
commit | 05a4611b5d71ad6f968fdeef092c24914570898b (patch) | |
tree | 8898c9610f656430e3f2644195889e4e9f3cae94 /drivers/media/dvb | |
parent | a27e5e769e46626052fc18ff63f274ee97142bab (diff) |
V4L/DVB (6228): dvb-pll: add module option to specify rf input
Add a module option to dvb-pll, called "input" to specify which rf
input to use on devices with multiple rf inputs. If the module option
is not specified, then the driver will autoselect the rf input, as per
previous behavior.
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/frontends/dvb-pll.c | 82 |
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 | ||
27 | struct 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 | |||
45 | static unsigned int dvb_pll_devcount; | ||
46 | |||
47 | static int debug = 0; | ||
48 | module_param(debug, int, 0644); | ||
49 | MODULE_PARM_DESC(debug, "enable verbose debug messages"); | ||
50 | |||
51 | static unsigned int input[DVB_PLL_MAX] = { [ 0 ... (DVB_PLL_MAX-1) ] = 0 }; | ||
52 | module_param_array(input, int, NULL, 0644); | ||
53 | MODULE_PARM_DESC(input,"specify rf input choice, 0 for autoselect (default)"); | ||
54 | |||
55 | /* ----------------------------------------------------------- */ | ||
56 | |||
27 | struct dvb_pll_desc { | 57 | struct 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 = { | |||
362 | static void tuv1236d_rf(struct dvb_frontend *fe, u8 *buf, | 392 | static 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 | |||
558 | struct 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 | ||
577 | static int debug = 0; | ||
578 | module_param(debug, int, 0644); | ||
579 | MODULE_PARM_DESC(debug, "enable verbose debug messages"); | ||
580 | |||
581 | static unsigned int dvb_pll_devcount; | ||
582 | |||
583 | static int dvb_pll_configure(struct dvb_frontend *fe, u8 *buf, | 607 | static 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 | { |