diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2007-09-07 17:27:43 -0400 |
---|---|---|
committer | Michael Krufky <mkrufky@linuxtv.org> | 2007-09-07 17:27:43 -0400 |
commit | 151f8da8e33108204a6adb8d9fca52aed54d697c (patch) | |
tree | 2feeffdae415da0d8e188450f1f461d793ef26cd /linux/drivers/media/dvb/frontends/dvb-pll.c | |
parent | d4b985dfa0c42c41c9f245c65f2bbc580afa3a80 (diff) | |
download | mediapointer-dvb-s2-151f8da8e33108204a6adb8d9fca52aed54d697c.tar.gz mediapointer-dvb-s2-151f8da8e33108204a6adb8d9fca52aed54d697c.tar.bz2 |
dvb-pll: add module option to force dvb-pll desc id (for debug use only)
From: Michael Krufky <mkrufky@linuxtv.org>
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>
Diffstat (limited to 'linux/drivers/media/dvb/frontends/dvb-pll.c')
-rw-r--r-- | linux/drivers/media/dvb/frontends/dvb-pll.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/frontends/dvb-pll.c b/linux/drivers/media/dvb/frontends/dvb-pll.c index fe08d01dd..c283dd8e3 100644 --- a/linux/drivers/media/dvb/frontends/dvb-pll.c +++ b/linux/drivers/media/dvb/frontends/dvb-pll.c @@ -53,6 +53,11 @@ static unsigned int input[DVB_PLL_MAX] = { [ 0 ... (DVB_PLL_MAX-1) ] = 0 }; module_param_array(input, int, NULL, 0644); MODULE_PARM_DESC(input,"specify rf input choice, 0 for autoselect (default)"); +static unsigned int id[DVB_PLL_MAX] = + { [ 0 ... (DVB_PLL_MAX-1) ] = DVB_PLL_UNDEFINED }; +module_param_array(id, int, NULL, 0644); +MODULE_PARM_DESC(id, "force pll id to use (DEBUG ONLY)"); + /* ----------------------------------------------------------- */ struct dvb_pll_desc { @@ -795,6 +800,10 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, int ret; struct dvb_pll_desc *desc; + if ((id[dvb_pll_devcount] > DVB_PLL_UNDEFINED) && + (id[dvb_pll_devcount] < ARRAY_SIZE(pll_list))) + pll_desc_id = id[dvb_pll_devcount]; + BUG_ON(pll_desc_id < 1 || pll_desc_id >= ARRAY_SIZE(pll_list)); desc = pll_list[pll_desc_id]; @@ -837,7 +846,10 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, printk("dvb-pll[%d]", priv->nr); if (i2c != NULL) printk(" %d-%04x", i2c_adapter_id(i2c), pll_addr); - printk(": id# %d (%s) attached\n", pll_desc_id, desc->name); + printk(": id# %d (%s) attached, %s\n", pll_desc_id, desc->name, + id[priv->nr] == pll_desc_id ? + "insmod option" : "autodetected"); + } return fe; |