aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-core.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-08-27 20:22:20 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:07:35 -0400
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 183bbb9ba6ab..f37fe83b1995 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -19,6 +19,7 @@
19#include <media/tuner.h> 19#include <media/tuner.h>
20#include <media/v4l2-common.h> 20#include <media/v4l2-common.h>
21#include "tuner-driver.h" 21#include "tuner-driver.h"
22#include "tda8290.h"
22 23
23#define UNSET (-1U) 24#define UNSET (-1U)
24 25
@@ -200,6 +201,15 @@ static void tuner_i2c_address_check(struct tuner *t)
200 tuner_warn("====================== WARNING! ======================\n"); 201 tuner_warn("====================== WARNING! ======================\n");
201} 202}
202 203
204static void attach_tda8290(struct tuner *t)
205{
206 struct tda8290_config cfg = {
207 .lna_cfg = &t->config,
208 .tuner_callback = t->tuner_callback
209 };
210 tda8290_attach(&t->fe, t->i2c.adapter, t->i2c.addr, &cfg);
211}
212
203static void set_type(struct i2c_client *c, unsigned int type, 213static void set_type(struct i2c_client *c, unsigned int type,
204 unsigned int new_mode_mask, unsigned int new_config, 214 unsigned int new_mode_mask, unsigned int new_config,
205 int (*tuner_callback) (void *dev, int command,int arg)) 215 int (*tuner_callback) (void *dev, int command,int arg))
@@ -245,8 +255,10 @@ static void set_type(struct i2c_client *c, unsigned int type,
245 microtune_init(t); 255 microtune_init(t);
246 break; 256 break;
247 case TUNER_PHILIPS_TDA8290: 257 case TUNER_PHILIPS_TDA8290:
248 tda8290_init(t); 258 {
259 attach_tda8290(t);
249 break; 260 break;
261 }
250 case TUNER_TEA5767: 262 case TUNER_TEA5767:
251 if (tea5767_tuner_init(t) == EINVAL) { 263 if (tea5767_tuner_init(t) == EINVAL) {
252 t->type = TUNER_ABSENT; 264 t->type = TUNER_ABSENT;
@@ -575,7 +587,7 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
575 case 0x4b: 587 case 0x4b:
576 /* If chip is not tda8290, don't register. 588 /* If chip is not tda8290, don't register.
577 since it can be tda9887*/ 589 since it can be tda9887*/
578 if (tda8290_probe(t) == 0) { 590 if (tda8290_probe(t->i2c.adapter, t->i2c.addr) == 0) {
579 tuner_dbg("chip at addr %x is a tda8290\n", addr); 591 tuner_dbg("chip at addr %x is a tda8290\n", addr);
580 } else { 592 } else {
581 /* Default is being tda9887 */ 593 /* Default is being tda9887 */