diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2007-12-16 18:11:46 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:03:55 -0500 |
commit | 8ca4083b50752d588f8b8b1e5e5776fb17d00304 (patch) | |
tree | 3a52ef63a3d60b2cddf0d88823fe4da640724abe /drivers/media | |
parent | 91c9d4a16710b047781248a38e7000ce9de324af (diff) |
V4L/DVB (6842): tda9887: remove dependency on struct tuner
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/tda9887.c | 22 | ||||
-rw-r--r-- | drivers/media/video/tda9887.h | 13 | ||||
-rw-r--r-- | drivers/media/video/tuner-core.c | 2 |
3 files changed, 21 insertions, 16 deletions
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 95d974298fe9..0b5dc37fea51 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c | |||
@@ -9,6 +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 "tuner-i2c.h" | 13 | #include "tuner-i2c.h" |
13 | #include "tda9887.h" | 14 | #include "tda9887.h" |
14 | 15 | ||
@@ -665,26 +666,25 @@ static struct analog_tuner_ops tda9887_tuner_ops = { | |||
665 | .set_config = tda9887_set_config, | 666 | .set_config = tda9887_set_config, |
666 | }; | 667 | }; |
667 | 668 | ||
668 | int tda9887_attach(struct tuner *t) | 669 | struct dvb_frontend *tda9887_attach(struct dvb_frontend *fe, |
670 | struct i2c_adapter *i2c_adap, | ||
671 | u8 i2c_addr) | ||
669 | { | 672 | { |
670 | struct tda9887_priv *priv = NULL; | 673 | struct tda9887_priv *priv = NULL; |
671 | 674 | ||
672 | priv = kzalloc(sizeof(struct tda9887_priv), GFP_KERNEL); | 675 | priv = kzalloc(sizeof(struct tda9887_priv), GFP_KERNEL); |
673 | if (priv == NULL) | 676 | if (priv == NULL) |
674 | return -ENOMEM; | 677 | return NULL; |
675 | t->fe.analog_demod_priv = priv; | 678 | fe->analog_demod_priv = priv; |
676 | 679 | ||
677 | priv->i2c_props.addr = t->i2c->addr; | 680 | priv->i2c_props.addr = i2c_addr; |
678 | priv->i2c_props.adap = t->i2c->adapter; | 681 | priv->i2c_props.adap = i2c_adap; |
679 | 682 | ||
680 | strlcpy(t->i2c->name, "tda9887", sizeof(t->i2c->name)); | 683 | tda9887_info("tda988[5/6/7] found\n"); |
681 | 684 | ||
682 | tda9887_info("tda988[5/6/7] found @ 0x%x (%s)\n", t->i2c->addr, | 685 | fe->ops.analog_demod_ops = &tda9887_tuner_ops; |
683 | t->i2c->driver->driver.name); | ||
684 | 686 | ||
685 | t->fe.ops.analog_demod_ops = &tda9887_tuner_ops; | 687 | return fe; |
686 | |||
687 | return 0; | ||
688 | } | 688 | } |
689 | EXPORT_SYMBOL_GPL(tda9887_attach); | 689 | EXPORT_SYMBOL_GPL(tda9887_attach); |
690 | 690 | ||
diff --git a/drivers/media/video/tda9887.h b/drivers/media/video/tda9887.h index b879f0ec2855..8f873a8e6ed2 100644 --- a/drivers/media/video/tda9887.h +++ b/drivers/media/video/tda9887.h | |||
@@ -17,16 +17,21 @@ | |||
17 | #ifndef __TDA9887_H__ | 17 | #ifndef __TDA9887_H__ |
18 | #define __TDA9887_H__ | 18 | #define __TDA9887_H__ |
19 | 19 | ||
20 | #include "tuner-driver.h" | 20 | #include <linux/i2c.h> |
21 | #include "dvb_frontend.h" | ||
21 | 22 | ||
22 | /* ------------------------------------------------------------------------ */ | 23 | /* ------------------------------------------------------------------------ */ |
23 | #if defined(CONFIG_TUNER_TDA9887) || (defined(CONFIG_TUNER_TDA9887_MODULE) && defined(MODULE)) | 24 | #if defined(CONFIG_TUNER_TDA9887) || (defined(CONFIG_TUNER_TDA9887_MODULE) && defined(MODULE)) |
24 | extern int tda9887_attach(struct tuner *t); | 25 | extern struct dvb_frontend *tda9887_attach(struct dvb_frontend *fe, |
26 | struct i2c_adapter *i2c_adap, | ||
27 | u8 i2c_addr); | ||
25 | #else | 28 | #else |
26 | static inline int tda9887_attach(struct tuner *t) | 29 | static inline struct dvb_frontend *tda9887_attach(struct dvb_frontend *fe, |
30 | struct i2c_adapter *i2c_adap, | ||
31 | u8 i2c_addr) | ||
27 | { | 32 | { |
28 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__); | 33 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__); |
29 | return -EINVAL; | 34 | return NULL; |
30 | } | 35 | } |
31 | #endif | 36 | #endif |
32 | 37 | ||
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 695f39ebe77b..d51f3afa969d 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -408,7 +408,7 @@ static void set_type(struct i2c_client *c, unsigned int type, | |||
408 | break; | 408 | break; |
409 | } | 409 | } |
410 | case TUNER_TDA9887: | 410 | case TUNER_TDA9887: |
411 | tda9887_attach(t); | 411 | tda9887_attach(&t->fe, t->i2c->adapter, t->i2c->addr); |
412 | break; | 412 | break; |
413 | default: | 413 | default: |
414 | attach_simple_tuner(t); | 414 | attach_simple_tuner(t); |