aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-04-22 13:41:51 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 12:42:24 -0400
commit060a5bd764a1d798c20eceeaac5399c672334960 (patch)
treec993cee91438db9f19f766ff1fee98297d3c71e7
parent65e8d29f7a37faaf9c73c633447bebd4b31b2c89 (diff)
V4L/DVB (7127): tuner: remove dependency of tuner-core on tuner-types
This patch fully removes the dependency of tuner-core on tuner-types. There is no longer any need to pass struct tunertype in attach-time config structure - instead pass the tuner type ID. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/video/tuner-core.c11
-rw-r--r--drivers/media/video/tuner-simple.c10
-rw-r--r--drivers/media/video/tuner-simple.h11
3 files changed, 10 insertions, 22 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 4d791766ce11..d6b64e9178eb 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -313,18 +313,13 @@ static void tuner_i2c_address_check(struct tuner *t)
313 tuner_warn("output to v4l-dvb-maintainer@linuxtv.org\n"); 313 tuner_warn("output to v4l-dvb-maintainer@linuxtv.org\n");
314 tuner_warn("Please use subject line: \"obsolete tuner i2c address.\"\n"); 314 tuner_warn("Please use subject line: \"obsolete tuner i2c address.\"\n");
315 tuner_warn("driver: %s, addr: 0x%02x, type: %d (%s)\n", 315 tuner_warn("driver: %s, addr: 0x%02x, type: %d (%s)\n",
316 t->i2c->adapter->name, t->i2c->addr, t->type, 316 t->i2c->adapter->name, t->i2c->addr, t->type, t->i2c->name);
317 tuners[t->type].name);
318 tuner_warn("====================== WARNING! ======================\n"); 317 tuner_warn("====================== WARNING! ======================\n");
319} 318}
320 319
321static void attach_simple_tuner(struct tuner *t) 320static inline void attach_simple_tuner(struct tuner *t)
322{ 321{
323 struct simple_tuner_config cfg = { 322 simple_tuner_attach(&t->fe, t->i2c->adapter, t->i2c->addr, t->type);
324 .type = t->type,
325 .tun = &tuners[t->type]
326 };
327 simple_tuner_attach(&t->fe, t->i2c->adapter, t->i2c->addr, &cfg);
328} 323}
329 324
330static void attach_tda829x(struct tuner *t) 325static void attach_tda829x(struct tuner *t)
diff --git a/drivers/media/video/tuner-simple.c b/drivers/media/video/tuner-simple.c
index d3362703e258..de0b291459f7 100644
--- a/drivers/media/video/tuner-simple.c
+++ b/drivers/media/video/tuner-simple.c
@@ -684,7 +684,7 @@ static struct dvb_tuner_ops simple_tuner_ops = {
684struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe, 684struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
685 struct i2c_adapter *i2c_adap, 685 struct i2c_adapter *i2c_adap,
686 u8 i2c_addr, 686 u8 i2c_addr,
687 struct simple_tuner_config *cfg) 687 unsigned int type)
688{ 688{
689 struct tuner_simple_priv *priv = NULL; 689 struct tuner_simple_priv *priv = NULL;
690 690
@@ -701,15 +701,15 @@ struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
701 701
702 priv->i2c_props.addr = i2c_addr; 702 priv->i2c_props.addr = i2c_addr;
703 priv->i2c_props.adap = i2c_adap; 703 priv->i2c_props.adap = i2c_adap;
704 priv->type = cfg->type; 704 priv->type = type;
705 priv->tun = cfg->tun; 705 priv->tun = &tuners[type];
706 706
707 memcpy(&fe->ops.tuner_ops, &simple_tuner_ops, 707 memcpy(&fe->ops.tuner_ops, &simple_tuner_ops,
708 sizeof(struct dvb_tuner_ops)); 708 sizeof(struct dvb_tuner_ops));
709 709
710 tuner_info("type set to %d (%s)\n", cfg->type, cfg->tun->name); 710 tuner_info("type set to %d (%s)\n", priv->type, priv->tun->name);
711 711
712 strlcpy(fe->ops.tuner_ops.info.name, cfg->tun->name, 712 strlcpy(fe->ops.tuner_ops.info.name, priv->tun->name,
713 sizeof(fe->ops.tuner_ops.info.name)); 713 sizeof(fe->ops.tuner_ops.info.name));
714 714
715 return fe; 715 return fe;
diff --git a/drivers/media/video/tuner-simple.h b/drivers/media/video/tuner-simple.h
index 9089939a8c02..bf425f325f87 100644
--- a/drivers/media/video/tuner-simple.h
+++ b/drivers/media/video/tuner-simple.h
@@ -20,23 +20,16 @@
20#include <linux/i2c.h> 20#include <linux/i2c.h>
21#include "dvb_frontend.h" 21#include "dvb_frontend.h"
22 22
23struct simple_tuner_config
24{
25 /* chip type */
26 unsigned int type;
27 struct tunertype *tun;
28};
29
30#if defined(CONFIG_TUNER_SIMPLE) || (defined(CONFIG_TUNER_SIMPLE_MODULE) && defined(MODULE)) 23#if defined(CONFIG_TUNER_SIMPLE) || (defined(CONFIG_TUNER_SIMPLE_MODULE) && defined(MODULE))
31extern struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe, 24extern struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
32 struct i2c_adapter *i2c_adap, 25 struct i2c_adapter *i2c_adap,
33 u8 i2c_addr, 26 u8 i2c_addr,
34 struct simple_tuner_config *cfg); 27 unsigned int type);
35#else 28#else
36static inline struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe, 29static inline struct dvb_frontend *simple_tuner_attach(struct dvb_frontend *fe,
37 struct i2c_adapter *i2c_adap, 30 struct i2c_adapter *i2c_adap,
38 u8 i2c_addr, 31 u8 i2c_addr,
39 struct simple_tuner_config *cfg) 32 unsigned int type)
40{ 33{
41 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__); 34 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
42 return NULL; 35 return NULL;