Commit 215b95ba authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

V4L/DVB (6430): Convert tuner-xc2028 driver to the newer hybrid approach

This changeset converts tuner-xc2028 to the newer hybrid approach. It also
prevents creating twice the xc3028 private struct by both DVB and V4L parts.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 3b20532c
...@@ -69,6 +69,7 @@ source "drivers/media/common/Kconfig" ...@@ -69,6 +69,7 @@ source "drivers/media/common/Kconfig"
config VIDEO_TUNER config VIDEO_TUNER
tristate tristate
depends on I2C depends on I2C
select TUNER_XC2028 if !VIDEO_TUNER_CUSTOMIZE
select TUNER_MT20XX if !VIDEO_TUNER_CUSTOMIZE select TUNER_MT20XX if !VIDEO_TUNER_CUSTOMIZE
select TUNER_TDA8290 if !VIDEO_TUNER_CUSTOMIZE select TUNER_TDA8290 if !VIDEO_TUNER_CUSTOMIZE
select TUNER_TEA5761 if !VIDEO_TUNER_CUSTOMIZE select TUNER_TEA5761 if !VIDEO_TUNER_CUSTOMIZE
...@@ -89,6 +90,13 @@ menuconfig VIDEO_TUNER_CUSTOMIZE ...@@ -89,6 +90,13 @@ menuconfig VIDEO_TUNER_CUSTOMIZE
if VIDEO_TUNER_CUSTOMIZE if VIDEO_TUNER_CUSTOMIZE
config TUNER_XC2028
tristate "XCeive xc2028/xc3028 tuners"
depends on I2C
default m if VIDEO_TUNER_CUSTOMIZE
help
Say Y here to include support for the xc2028/xc3028 tuners.
config TUNER_MT20XX config TUNER_MT20XX
tristate "Microtune 2032 / 2050 tuners" tristate "Microtune 2032 / 2050 tuners"
depends on I2C depends on I2C
......
...@@ -505,18 +505,6 @@ config TUNER_3036 ...@@ -505,18 +505,6 @@ config TUNER_3036
Say Y here to include support for Philips SAB3036 compatible tuners. Say Y here to include support for Philips SAB3036 compatible tuners.
If in doubt, say N. If in doubt, say N.
config TUNER_XC2028
tristate "Xceive xc2028 support for tm5600/tm6000 driver"
depends on I2C
select VIDEO_TUNER
help
Say Y here to include support for Xceive xc2028 tuner. This is
required on a few tm5600/tm6000 designs. You should notice
that this module currently works only with the special
firmware versions used on those Trident chips.
If in doubt, say N.
config VIDEO_VINO config VIDEO_VINO
tristate "SGI Vino Video For Linux (EXPERIMENTAL)" tristate "SGI Vino Video For Linux (EXPERIMENTAL)"
depends on I2C && SGI_IP22 && EXPERIMENTAL && VIDEO_V4L2 depends on I2C && SGI_IP22 && EXPERIMENTAL && VIDEO_V4L2
......
...@@ -6,10 +6,6 @@ zr36067-objs := zoran_procfs.o zoran_device.o \ ...@@ -6,10 +6,6 @@ zr36067-objs := zoran_procfs.o zoran_device.o \
zoran_driver.o zoran_card.o zoran_driver.o zoran_card.o
tuner-objs := tuner-core.o tuner-types.o tda9887.o tuner-objs := tuner-core.o tuner-types.o tda9887.o
ifneq ($(CONFIG_TUNER_XC2028),)
tuner-objs += tuner-xc2028.o
endif
msp3400-objs := msp3400-driver.o msp3400-kthreads.o msp3400-objs := msp3400-driver.o msp3400-kthreads.o
obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o compat_ioctl32.o \ obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o compat_ioctl32.o \
...@@ -85,6 +81,7 @@ obj-$(CONFIG_TUNER_3036) += tuner-3036.o ...@@ -85,6 +81,7 @@ obj-$(CONFIG_TUNER_3036) += tuner-3036.o
obj-$(CONFIG_VIDEO_TUNER) += tuner.o obj-$(CONFIG_VIDEO_TUNER) += tuner.o
obj-$(CONFIG_TUNER_XC2028) += tuner-xc2028.o
obj-$(CONFIG_TUNER_SIMPLE) += tuner-simple.o obj-$(CONFIG_TUNER_SIMPLE) += tuner-simple.o
obj-$(CONFIG_TUNER_MT20XX) += mt20xx.o obj-$(CONFIG_TUNER_MT20XX) += mt20xx.o
obj-$(CONFIG_TUNER_TDA8290) += tda8290.o obj-$(CONFIG_TUNER_TDA8290) += tda8290.o
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "tda8290.h" #include "tda8290.h"
#include "tea5761.h" #include "tea5761.h"
#include "tea5767.h" #include "tea5767.h"
#include "tuner-xc2028.h"
#include "tuner-simple.h" #include "tuner-simple.h"
#define UNSET (-1U) #define UNSET (-1U)
...@@ -323,8 +324,17 @@ static void set_type(struct i2c_client *c, unsigned int type, ...@@ -323,8 +324,17 @@ static void set_type(struct i2c_client *c, unsigned int type,
attach_simple_tuner(t); attach_simple_tuner(t);
break; break;
case TUNER_XC2028: case TUNER_XC2028:
xc2028_tuner_init(c); {
int rc=xc2028_attach(&t->fe, t->i2c.adapter, t->i2c.addr,
&c->dev, c->adapter->algo_data,
t->tuner_callback);
if (rc<0) {
t->type = TUNER_ABSENT;
t->mode_mask = T_UNINITIALIZED;
return;
}
break; break;
}
case TUNER_TDA9887: case TUNER_TDA9887:
tda9887_tuner_init(t); tda9887_tuner_init(t);
break; break;
......
...@@ -70,8 +70,6 @@ struct tuner { ...@@ -70,8 +70,6 @@ struct tuner {
struct tuner_operations ops; struct tuner_operations ops;
}; };
extern int xc2028_tuner_init(struct i2c_client *c);
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
extern int tda9887_tuner_init(struct tuner *t); extern int tda9887_tuner_init(struct tuner *t);
......
This diff is collapsed.
...@@ -4,6 +4,11 @@ ...@@ -4,6 +4,11 @@
* This code is placed under the terms of the GNU General Public License v2 * This code is placed under the terms of the GNU General Public License v2
*/ */
#ifndef __TUNER_XC2028_H__
#define __TUNER_XC2028_H__
#include "dvb_frontend.h"
/* xc2028 commands for callback */ /* xc2028 commands for callback */
#define XC2028_TUNER_RESET 0 #define XC2028_TUNER_RESET 0
#define XC2028_RESET_CLK 1 #define XC2028_RESET_CLK 1
...@@ -11,4 +16,21 @@ ...@@ -11,4 +16,21 @@
struct dvb_frontend; struct dvb_frontend;
struct i2c_client; struct i2c_client;
int xc2028_attach(struct i2c_client *c, struct dvb_frontend *fe); #if defined(CONFIG_TUNER_XC2028) || (defined(CONFIG_TUNER_XC2028_MODULE) && defined(MODULE))
int xc2028_attach(struct dvb_frontend *fe, struct i2c_adapter* i2c_adap,
u8 i2c_addr, struct device *dev, void *video_dev,
int (*tuner_callback) (void *dev, int command,int arg));
#else
static inline int xc2028_attach(struct dvb_frontend *fe,
struct i2c_adapter* i2c_adap,
u8 i2c_addr, struct device *dev, void *video_dev,
int (*tuner_callback) (void *dev, int command,int arg))
{
printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n",
__FUNCTION__);
return -EINVAL;
}
#endif
#endif /* __TUNER_XC2028_H__ */
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