Commit 910bb3e3 authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

V4L/DVB (6129): tda8290: convert from tuner sub-driver into dvb_frontend module

Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Acked-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Acked-by: default avatarMike Isely <isely@pobox.com>
Acked-by: default avatarSteven Toth <stoth@hauppauge.com>
Acked-by: default avatarPatrick Boettcher <pb@linuxtv.org>
Acked-by: default avatarJarod Wilson <jwilson@redhat.com>
Acked-by: default avatarTrent Piepho <xyzzy@speakeasy.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent e18f9444
This diff is collapsed.
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __TDA8290_H__
#define __TDA8290_H__
#include <linux/i2c.h>
#include "dvb_frontend.h"
struct tda8290_config
{
unsigned int *lna_cfg;
int (*tuner_callback) (void *dev, int command,int arg);
};
extern int tda8290_probe(struct i2c_adapter* i2c_adap, u8 i2c_addr);
extern struct dvb_frontend *tda8290_attach(struct dvb_frontend *fe,
struct i2c_adapter* i2c_adap,
u8 i2c_addr,
struct tda8290_config *cfg);
#endif /* __TDA8290_H__ */
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <media/tuner.h> #include <media/tuner.h>
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include "tuner-driver.h" #include "tuner-driver.h"
#include "tda8290.h"
#define UNSET (-1U) #define UNSET (-1U)
...@@ -200,6 +201,15 @@ static void tuner_i2c_address_check(struct tuner *t) ...@@ -200,6 +201,15 @@ static void tuner_i2c_address_check(struct tuner *t)
tuner_warn("====================== WARNING! ======================\n"); 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, static void set_type(struct i2c_client *c, unsigned int type,
unsigned int new_mode_mask, unsigned int new_config, unsigned int new_mode_mask, unsigned int new_config,
int (*tuner_callback) (void *dev, int command,int arg)) 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,8 +255,10 @@ static void set_type(struct i2c_client *c, unsigned int type,
microtune_init(t); microtune_init(t);
break; break;
case TUNER_PHILIPS_TDA8290: case TUNER_PHILIPS_TDA8290:
tda8290_init(t); {
attach_tda8290(t);
break; break;
}
case TUNER_TEA5767: case TUNER_TEA5767:
if (tea5767_tuner_init(t) == EINVAL) { if (tea5767_tuner_init(t) == EINVAL) {
t->type = TUNER_ABSENT; t->type = TUNER_ABSENT;
...@@ -575,7 +587,7 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) ...@@ -575,7 +587,7 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
case 0x4b: case 0x4b:
/* If chip is not tda8290, don't register. /* If chip is not tda8290, don't register.
since it can be tda9887*/ 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); tuner_dbg("chip at addr %x is a tda8290\n", addr);
} else { } else {
/* Default is being tda9887 */ /* Default is being tda9887 */
......
...@@ -78,9 +78,6 @@ extern int tda9887_tuner_init(struct tuner *t); ...@@ -78,9 +78,6 @@ extern int tda9887_tuner_init(struct tuner *t);
extern int microtune_init(struct tuner *t); extern int microtune_init(struct tuner *t);
extern int tda8290_init(struct tuner *t);
extern int tda8290_probe(struct tuner *t);
extern int tea5761_tuner_init(struct tuner *t); extern int tea5761_tuner_init(struct tuner *t);
extern int tea5761_autodetection(struct tuner *t); extern int tea5761_autodetection(struct tuner *t);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment