aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-09-07 17:27:43 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:14:48 -0400
commit704e39bf620810734a38b3f9c0e07cede2a76d91 (patch)
tree8f689d99c45e41195dec0cc59d87476855268003 /drivers/media/dvb
parentff3e7dd5809fb632447f1aa6de6b3ffb755727dd (diff)
V4L/DVB (6230): dvb-pll: add module option to force dvb-pll desc id (for debug use only)
Add a module option to force the dvb-pll module to use an alternate dvb-pll description without having to recompile the kernel. Having a module option like this is useful in some cases, where the vendor may release an alternate revision of the hardware using a different tuner, but without changing the pci subsystem / usb device ids. This option is intended for debugging purposes _only_. 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.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c
index 0fb4d453ae5b..64007032997c 100644
--- a/drivers/media/dvb/frontends/dvb-pll.c
+++ b/drivers/media/dvb/frontends/dvb-pll.c
@@ -52,6 +52,11 @@ static unsigned int input[DVB_PLL_MAX] = { [ 0 ... (DVB_PLL_MAX-1) ] = 0 };
52module_param_array(input, int, NULL, 0644); 52module_param_array(input, int, NULL, 0644);
53MODULE_PARM_DESC(input,"specify rf input choice, 0 for autoselect (default)"); 53MODULE_PARM_DESC(input,"specify rf input choice, 0 for autoselect (default)");
54 54
55static unsigned int id[DVB_PLL_MAX] =
56 { [ 0 ... (DVB_PLL_MAX-1) ] = DVB_PLL_UNDEFINED };
57module_param_array(id, int, NULL, 0644);
58MODULE_PARM_DESC(id, "force pll id to use (DEBUG ONLY)");
59
55/* ----------------------------------------------------------- */ 60/* ----------------------------------------------------------- */
56 61
57struct dvb_pll_desc { 62struct dvb_pll_desc {
@@ -794,6 +799,10 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr,
794 int ret; 799 int ret;
795 struct dvb_pll_desc *desc; 800 struct dvb_pll_desc *desc;
796 801
802 if ((id[dvb_pll_devcount] > DVB_PLL_UNDEFINED) &&
803 (id[dvb_pll_devcount] < ARRAY_SIZE(pll_list)))
804 pll_desc_id = id[dvb_pll_devcount];
805
797 BUG_ON(pll_desc_id < 1 || pll_desc_id >= ARRAY_SIZE(pll_list)); 806 BUG_ON(pll_desc_id < 1 || pll_desc_id >= ARRAY_SIZE(pll_list));
798 807
799 desc = pll_list[pll_desc_id]; 808 desc = pll_list[pll_desc_id];
@@ -836,7 +845,10 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr,
836 printk("dvb-pll[%d]", priv->nr); 845 printk("dvb-pll[%d]", priv->nr);
837 if (i2c != NULL) 846 if (i2c != NULL)
838 printk(" %d-%04x", i2c_adapter_id(i2c), pll_addr); 847 printk(" %d-%04x", i2c_adapter_id(i2c), pll_addr);
839 printk(": id# %d (%s) attached\n", pll_desc_id, desc->name); 848 printk(": id# %d (%s) attached, %s\n", pll_desc_id, desc->name,
849 id[priv->nr] == pll_desc_id ?
850 "insmod option" : "autodetected");
851
840 } 852 }
841 853
842 return fe; 854 return fe;