Commit 746d9732 authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

V4L/DVB (6433): Move all tda8275/8275a tuning code from tda8290 module into tda827x module

Add analog tuning support to tda827x dvb_frontend tuner module.

Convert tda8290 module back to native tuner interface.

The tda8290 analog demodulator will be handled the same way as tda9887.
The tuner.ko module (tuner-core) will pass commands to tda8290 via the
tuner_operations interface.  tda8290 will communicate with tda827x via
the dvb_frontend interface, while passing a pointer to a private data
structure.
Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Reviewed-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent de3fe21b
......@@ -107,6 +107,7 @@ config TUNER_MT20XX
config TUNER_TDA8290
tristate "TDA 8290+8275(a) tuner combo"
depends on I2C
select DVB_TDA827X
default m if VIDEO_TUNER_CUSTOMIZE
help
Say Y here to include support for Philips TDA8290+8275(a) tuner.
......
This diff is collapsed.
......@@ -29,9 +29,19 @@
struct tda827x_config
{
/* saa7134 - provided callbacks */
void (*lna_gain) (struct dvb_frontend *fe, int high);
int (*init) (struct dvb_frontend *fe);
int (*sleep) (struct dvb_frontend *fe);
/* interface to tda829x driver */
unsigned char tda827x_lpsel;
unsigned int sgIF;
unsigned int *config;
int (*tuner_callback) (void *dev, int command, int arg);
void (*agcf)(struct dvb_frontend *fe);
};
......
This diff is collapsed.
......@@ -18,36 +18,24 @@
#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);
};
#include "tuner-driver.h"
#if defined(CONFIG_TUNER_TDA8290) || (defined(CONFIG_TUNER_TDA8290_MODULE) && defined(MODULE))
extern int tda8290_probe(struct i2c_adapter* i2c_adap, u8 i2c_addr);
extern int tda8290_probe(struct tuner *t);
extern struct dvb_frontend *tda8290_attach(struct dvb_frontend *fe,
struct i2c_adapter* i2c_adap,
u8 i2c_addr,
struct tda8290_config *cfg);
extern int tda8290_attach(struct tuner *t);
#else
static inline int tda8290_probe(struct i2c_adapter* i2c_adap, u8 i2c_addr)
static inline int tda8290_probe(struct tuner *t)
{
printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n",
__FUNCTION__);
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
return -EINVAL;
}
static inline struct dvb_frontend *tda8290_attach(struct dvb_frontend *fe,
struct i2c_adapter* i2c_adap,
u8 i2c_addr,
struct tda8290_config *cfg)
static inline int tda8290_attach(struct tuner *t)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __FUNCTION__);
return NULL;
printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n",
__FUNCTION__);
return -EINVAL;
}
#endif
......
......@@ -220,15 +220,6 @@ 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 attach_simple_tuner(struct tuner *t)
{
struct simple_tuner_config cfg = {
......@@ -284,7 +275,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
break;
case TUNER_PHILIPS_TDA8290:
{
attach_tda8290(t);
tda8290_attach(t);
break;
}
case TUNER_TEA5767:
......@@ -343,7 +334,8 @@ static void set_type(struct i2c_client *c, unsigned int type,
break;
}
if (fe_tuner_ops->set_analog_params) {
if ((fe_tuner_ops->set_analog_params) &&
((NULL == t->ops.set_tv_freq) && (NULL == t->ops.set_radio_freq))) {
strlcpy(t->i2c.name, fe_tuner_ops->info.name, sizeof(t->i2c.name));
t->ops.set_tv_freq = fe_set_freq;
......@@ -624,7 +616,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->i2c.adapter, t->i2c.addr) == 0) {
if (tda8290_probe(t) == 0) {
tuner_dbg("chip at addr %x is a tda8290\n", addr);
} else {
/* Default is being tda9887 */
......
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