diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2007-10-21 19:48:48 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:01:10 -0500 |
commit | 31c9584c0b071dfa7a75db6e21cc727f728f97b0 (patch) | |
tree | 50a0e0b7d342fe00d2505ec69f324551659b4172 /drivers/media/video/tda9887.c | |
parent | 5c82f4497b46e9c3877618bc36661a4abbf9c646 (diff) |
V4L/DVB (6443): make tda9887 build selectable via Kconfig
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/tda9887.c')
-rw-r--r-- | drivers/media/video/tda9887.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 7663a5579757..4f5d76ff0b44 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c | |||
@@ -9,7 +9,7 @@ | |||
9 | #include <linux/videodev.h> | 9 | #include <linux/videodev.h> |
10 | #include <media/v4l2-common.h> | 10 | #include <media/v4l2-common.h> |
11 | #include <media/tuner.h> | 11 | #include <media/tuner.h> |
12 | #include "tuner-driver.h" | 12 | #include "tda9887.h" |
13 | 13 | ||
14 | 14 | ||
15 | /* Chips: | 15 | /* Chips: |
@@ -20,13 +20,18 @@ | |||
20 | Used as part of several tuners | 20 | Used as part of several tuners |
21 | */ | 21 | */ |
22 | 22 | ||
23 | static int tda9887_debug; | ||
24 | module_param_named(debug, tda9887_debug, int, 0644); | ||
25 | |||
23 | #define tda9887_info(fmt, arg...) do {\ | 26 | #define tda9887_info(fmt, arg...) do {\ |
24 | printk(KERN_INFO "%s %d-%04x: " fmt, priv->t->i2c.name, \ | 27 | printk(KERN_INFO "%s %d-%04x: " fmt, priv->t->i2c.name, \ |
25 | i2c_adapter_id(priv->t->i2c.adapter), priv->t->i2c.addr , ##arg); } while (0) | 28 | i2c_adapter_id(priv->t->i2c.adapter), \ |
29 | priv->t->i2c.addr, ##arg); } while (0) | ||
26 | #define tda9887_dbg(fmt, arg...) do {\ | 30 | #define tda9887_dbg(fmt, arg...) do {\ |
27 | if (tuner_debug) \ | 31 | if (tda9887_debug) \ |
28 | printk(KERN_INFO "%s %d-%04x: " fmt, priv->t->i2c.name, \ | 32 | printk(KERN_INFO "%s %d-%04x: " fmt, priv->t->i2c.name, \ |
29 | i2c_adapter_id(priv->t->i2c.adapter), priv->t->i2c.addr , ##arg); } while (0) | 33 | i2c_adapter_id(priv->t->i2c.adapter), \ |
34 | priv->t->i2c.addr, ##arg); } while (0) | ||
30 | 35 | ||
31 | struct tda9887_priv { | 36 | struct tda9887_priv { |
32 | struct tuner_i2c_props i2c_props; | 37 | struct tuner_i2c_props i2c_props; |
@@ -573,13 +578,13 @@ static void tda9887_configure(struct dvb_frontend *fe) | |||
573 | 578 | ||
574 | tda9887_dbg("writing: b=0x%02x c=0x%02x e=0x%02x\n", | 579 | tda9887_dbg("writing: b=0x%02x c=0x%02x e=0x%02x\n", |
575 | priv->data[1],priv->data[2],priv->data[3]); | 580 | priv->data[1],priv->data[2],priv->data[3]); |
576 | if (tuner_debug > 1) | 581 | if (tda9887_debug > 1) |
577 | dump_write_message(fe, priv->data); | 582 | dump_write_message(fe, priv->data); |
578 | 583 | ||
579 | if (4 != (rc = tuner_i2c_xfer_send(&priv->i2c_props,priv->data,4))) | 584 | if (4 != (rc = tuner_i2c_xfer_send(&priv->i2c_props,priv->data,4))) |
580 | tda9887_info("i2c i/o error: rc == %d (should be 4)\n",rc); | 585 | tda9887_info("i2c i/o error: rc == %d (should be 4)\n",rc); |
581 | 586 | ||
582 | if (tuner_debug > 2) { | 587 | if (tda9887_debug > 2) { |
583 | msleep_interruptible(1000); | 588 | msleep_interruptible(1000); |
584 | tda9887_status(fe); | 589 | tda9887_status(fe); |
585 | } | 590 | } |
@@ -590,7 +595,8 @@ static void tda9887_configure(struct dvb_frontend *fe) | |||
590 | static void tda9887_tuner_status(struct dvb_frontend *fe) | 595 | static void tda9887_tuner_status(struct dvb_frontend *fe) |
591 | { | 596 | { |
592 | struct tda9887_priv *priv = fe->analog_demod_priv; | 597 | struct tda9887_priv *priv = fe->analog_demod_priv; |
593 | tda9887_info("Data bytes: b=0x%02x c=0x%02x e=0x%02x\n", priv->data[1], priv->data[2], priv->data[3]); | 598 | tda9887_info("Data bytes: b=0x%02x c=0x%02x e=0x%02x\n", |
599 | priv->data[1], priv->data[2], priv->data[3]); | ||
594 | } | 600 | } |
595 | 601 | ||
596 | static int tda9887_get_afc(struct dvb_frontend *fe) | 602 | static int tda9887_get_afc(struct dvb_frontend *fe) |
@@ -636,7 +642,7 @@ static struct analog_tuner_ops tda9887_tuner_ops = { | |||
636 | .release = tda9887_release, | 642 | .release = tda9887_release, |
637 | }; | 643 | }; |
638 | 644 | ||
639 | int tda9887_tuner_init(struct tuner *t) | 645 | int tda9887_attach(struct tuner *t) |
640 | { | 646 | { |
641 | struct tda9887_priv *priv = NULL; | 647 | struct tda9887_priv *priv = NULL; |
642 | 648 | ||
@@ -658,6 +664,7 @@ int tda9887_tuner_init(struct tuner *t) | |||
658 | 664 | ||
659 | return 0; | 665 | return 0; |
660 | } | 666 | } |
667 | EXPORT_SYMBOL_GPL(tda9887_attach); | ||
661 | 668 | ||
662 | /* | 669 | /* |
663 | * Overrides for Emacs so that we follow Linus's tabbing style. | 670 | * Overrides for Emacs so that we follow Linus's tabbing style. |