diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2007-09-07 17:11:15 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-09 21:14:45 -0400 |
commit | a27e5e769e46626052fc18ff63f274ee97142bab (patch) | |
tree | cb862da7906c82ae8258548fbad207dd0eb6d67e /drivers/media/dvb | |
parent | 5d7802b2617d785ea0b8631b0605defc19ee6561 (diff) |
V4L/DVB (6227): dvb-pll: store instance ID in dvb_pll_priv structure
Store an instance ID in the dvb_pll_priv structure, so that module options
specific to a given pll may be used by the functions within the driver.
When debug is turned on, print a message indicating which pll was attached
and it's instance id.
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 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c index 59ae4ece65ab..5f4762edc405 100644 --- a/drivers/media/dvb/frontends/dvb-pll.c +++ b/drivers/media/dvb/frontends/dvb-pll.c | |||
@@ -556,6 +556,9 @@ static struct dvb_pll_desc *pll_list[] = { | |||
556 | /* ----------------------------------------------------------- */ | 556 | /* ----------------------------------------------------------- */ |
557 | 557 | ||
558 | struct dvb_pll_priv { | 558 | struct dvb_pll_priv { |
559 | /* pll number */ | ||
560 | int nr; | ||
561 | |||
559 | /* i2c details */ | 562 | /* i2c details */ |
560 | int pll_i2c_address; | 563 | int pll_i2c_address; |
561 | struct i2c_adapter *i2c; | 564 | struct i2c_adapter *i2c; |
@@ -575,6 +578,8 @@ static int debug = 0; | |||
575 | module_param(debug, int, 0644); | 578 | module_param(debug, int, 0644); |
576 | MODULE_PARM_DESC(debug, "enable verbose debug messages"); | 579 | MODULE_PARM_DESC(debug, "enable verbose debug messages"); |
577 | 580 | ||
581 | static unsigned int dvb_pll_devcount; | ||
582 | |||
578 | static int dvb_pll_configure(struct dvb_frontend *fe, u8 *buf, | 583 | static int dvb_pll_configure(struct dvb_frontend *fe, u8 *buf, |
579 | const struct dvb_frontend_parameters *params) | 584 | const struct dvb_frontend_parameters *params) |
580 | { | 585 | { |
@@ -787,6 +792,7 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, | |||
787 | priv->pll_i2c_address = pll_addr; | 792 | priv->pll_i2c_address = pll_addr; |
788 | priv->i2c = i2c; | 793 | priv->i2c = i2c; |
789 | priv->pll_desc = desc; | 794 | priv->pll_desc = desc; |
795 | priv->nr = dvb_pll_devcount++; | ||
790 | 796 | ||
791 | memcpy(&fe->ops.tuner_ops, &dvb_pll_tuner_ops, | 797 | memcpy(&fe->ops.tuner_ops, &dvb_pll_tuner_ops, |
792 | sizeof(struct dvb_tuner_ops)); | 798 | sizeof(struct dvb_tuner_ops)); |
@@ -801,6 +807,14 @@ struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe, int pll_addr, | |||
801 | fe->ops.tuner_ops.sleep = NULL; | 807 | fe->ops.tuner_ops.sleep = NULL; |
802 | 808 | ||
803 | fe->tuner_priv = priv; | 809 | fe->tuner_priv = priv; |
810 | |||
811 | if (debug) { | ||
812 | printk("dvb-pll[%d]", priv->nr); | ||
813 | if (i2c != NULL) | ||
814 | printk(" %d-%04x", i2c_adapter_id(i2c), pll_addr); | ||
815 | printk(": id# %d (%s) attached\n", pll_desc_id, desc->name); | ||
816 | } | ||
817 | |||
804 | return fe; | 818 | return fe; |
805 | } | 819 | } |
806 | EXPORT_SYMBOL(dvb_pll_attach); | 820 | EXPORT_SYMBOL(dvb_pll_attach); |