aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-core.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-12-09 00:26:48 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:03:28 -0500
commitab1660503ac3af7febfcf987648509b484d4feda (patch)
tree9ca5fbfadf1c4c7a6c227b5deb549d198217720a /drivers/media/video/tuner-core.c
parentfa746aee336fedfe25e6945e5967399966948420 (diff)
V4L/DVB (6785): tda8290: remove dependency on struct tuner
- remove dependency of tda8290 module on struct tuner - move tuner_foo printk macros from tuner-driver.h into tuner-core.c - clean up #includes of tuner-i2c.h / tuner-driver.h Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/tuner-core.c')
-rw-r--r--drivers/media/video/tuner-core.c43
1 files changed, 40 insertions, 3 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 5f8bffc8209b..0cc190761e24 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -52,7 +52,34 @@ static unsigned int no_autodetect = 0;
52static unsigned int show_i2c = 0; 52static unsigned int show_i2c = 0;
53 53
54/* insmod options used at runtime => read/write */ 54/* insmod options used at runtime => read/write */
55int tuner_debug = 0; 55static int tuner_debug;
56
57#define tuner_warn(fmt, arg...) do { \
58 printk(KERN_WARNING "%s %d-%04x: " fmt, PREFIX, \
59 i2c_adapter_id(t->i2c->adapter), \
60 t->i2c->addr, ##arg); \
61 } while (0)
62
63#define tuner_info(fmt, arg...) do { \
64 printk(KERN_INFO "%s %d-%04x: " fmt, PREFIX, \
65 i2c_adapter_id(t->i2c->adapter), \
66 t->i2c->addr, ##arg); \
67 } while (0)
68
69#define tuner_err(fmt, arg...) do { \
70 printk(KERN_ERR "%s %d-%04x: " fmt, PREFIX, \
71 i2c_adapter_id(t->i2c->adapter), \
72 t->i2c->addr, ##arg); \
73 } while (0)
74
75#define tuner_dbg(fmt, arg...) do { \
76 if (tuner_debug) \
77 printk(KERN_DEBUG "%s %d-%04x: " fmt, PREFIX, \
78 i2c_adapter_id(t->i2c->adapter), \
79 t->i2c->addr, ##arg); \
80 } while (0)
81
82/* ------------------------------------------------------------------------ */
56 83
57static unsigned int tv_range[2] = { 44, 958 }; 84static unsigned int tv_range[2] = { 44, 958 };
58static unsigned int radio_range[2] = { 65, 108 }; 85static unsigned int radio_range[2] = { 65, 108 };
@@ -261,6 +288,15 @@ static void attach_simple_tuner(struct tuner *t)
261 simple_tuner_attach(&t->fe, t->i2c->adapter, t->i2c->addr, &cfg); 288 simple_tuner_attach(&t->fe, t->i2c->adapter, t->i2c->addr, &cfg);
262} 289}
263 290
291static void attach_tda829x(struct tuner *t)
292{
293 struct tda829x_config cfg = {
294 .lna_cfg = &t->config,
295 .tuner_callback = t->tuner_callback,
296 };
297 tda829x_attach(&t->fe, t->i2c->adapter, t->i2c->addr, &cfg);
298}
299
264static void set_type(struct i2c_client *c, unsigned int type, 300static void set_type(struct i2c_client *c, unsigned int type,
265 unsigned int new_mode_mask, unsigned int new_config, 301 unsigned int new_mode_mask, unsigned int new_config,
266 int (*tuner_callback) (void *dev, int command,int arg)) 302 int (*tuner_callback) (void *dev, int command,int arg))
@@ -303,7 +339,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
303 break; 339 break;
304 case TUNER_PHILIPS_TDA8290: 340 case TUNER_PHILIPS_TDA8290:
305 { 341 {
306 tda829x_attach(t); 342 attach_tda829x(t);
307 break; 343 break;
308 } 344 }
309 case TUNER_TEA5767: 345 case TUNER_TEA5767:
@@ -1045,7 +1081,8 @@ static int tuner_probe(struct i2c_client *client)
1045 case 0x4b: 1081 case 0x4b:
1046 /* If chip is not tda8290, don't register. 1082 /* If chip is not tda8290, don't register.
1047 since it can be tda9887*/ 1083 since it can be tda9887*/
1048 if (tda829x_probe(t) == 0) { 1084 if (tda829x_probe(t->i2c->adapter,
1085 t->i2c->addr) == 0) {
1049 tuner_dbg("tda829x detected\n"); 1086 tuner_dbg("tda829x detected\n");
1050 } else { 1087 } else {
1051 /* Default is being tda9887 */ 1088 /* Default is being tda9887 */