aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/tuner-core.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-08-27 21:22:20 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 22:07:35 -0300
commit910bb3e3c5a5d8ed5028846728efc6a375d200eb (patch)
treedae4791553084cd9a31b223be9f1aaf70c011be9 /drivers/media/video/tuner-core.c
parente18f9444bda60a67e6feef00c354f8de0cdaeba7 (diff)
V4L/DVB (6129): tda8290: convert from tuner sub-driver into dvb_frontend module
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Acked-by: Mike Isely <isely@pobox.com> Acked-by: Steven Toth <stoth@hauppauge.com> Acked-by: Patrick Boettcher <pb@linuxtv.org> Acked-by: Jarod Wilson <jwilson@redhat.com> Acked-by: Trent Piepho <xyzzy@speakeasy.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.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 183bbb9ba6a..f37fe83b199 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -19,6 +19,7 @@
#include <media/tuner.h>
#include <media/v4l2-common.h>
#include "tuner-driver.h"
+#include "tda8290.h"
#define UNSET (-1U)
@@ -200,6 +201,15 @@ static void tuner_i2c_address_check(struct tuner *t)
tuner_warn("====================== WARNING! ======================\n");
}
+static void attach_tda8290(struct tuner *t)
+{
+ struct tda8290_config cfg = {
+ .lna_cfg = &t->config,
+ .tuner_callback = t->tuner_callback
+ };
+ tda8290_attach(&t->fe, t->i2c.adapter, t->i2c.addr, &cfg);
+}
+
static void set_type(struct i2c_client *c, unsigned int type,
unsigned int new_mode_mask, unsigned int new_config,
int (*tuner_callback) (void *dev, int command,int arg))
@@ -245,8 +255,10 @@ static void set_type(struct i2c_client *c, unsigned int type,
microtune_init(t);
break;
case TUNER_PHILIPS_TDA8290:
- tda8290_init(t);
+ {
+ attach_tda8290(t);
break;
+ }
case TUNER_TEA5767:
if (tea5767_tuner_init(t) == EINVAL) {
t->type = TUNER_ABSENT;
@@ -575,7 +587,7 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
case 0x4b:
/* If chip is not tda8290, don't register.
since it can be tda9887*/
- if (tda8290_probe(t) == 0) {
+ if (tda8290_probe(t->i2c.adapter, t->i2c.addr) == 0) {
tuner_dbg("chip at addr %x is a tda8290\n", addr);
} else {
/* Default is being tda9887 */