Commit 27c685a4 authored by Steven Toth's avatar Steven Toth Committed by Mauro Carvalho Chehab

V4L/DVB (7042): xc5000: Tuner analog support

From Zhang: This an updated patch that adds analog support for
the xc5000 tuner driver. it was tested on a Pinnacle PCTV HD 800i
card (patches to follow).

Patch commited as-is, cleanup to follow ... Steve.
Signed-off-by: default avatarChaogui Zhang <czhang1974@gmail.com>
Signed-off-by: default avatarSteven Toth <stoth@hauppauge.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent dfc1c08a
...@@ -73,3 +73,4 @@ tuner=71 - Xceive xc2028/xc3028 tuner ...@@ -73,3 +73,4 @@ tuner=71 - Xceive xc2028/xc3028 tuner
tuner=72 - Thomson FE6600 tuner=72 - Thomson FE6600
tuner=73 - Samsung TCPG 6121P30A tuner=73 - Samsung TCPG 6121P30A
tuner=75 - Philips TEA5761 FM Radio tuner=75 - Philips TEA5761 FM Radio
tuner=76 - Xceive 5000 tuner
This diff is collapsed.
...@@ -30,11 +30,13 @@ struct i2c_adapter; ...@@ -30,11 +30,13 @@ struct i2c_adapter;
struct xc5000_config { struct xc5000_config {
u8 i2c_address; u8 i2c_address;
u32 if_khz; u32 if_khz;
int (*request_firmware)(struct dvb_frontend *fe, void *video_dev;
const struct firmware **fw, char *name); int (*tuner_callback) (void *dev, int command, int arg);
int (*tuner_reset)(struct dvb_frontend* fe);
}; };
/* xc5000 callback command */
#define XC5000_TUNER_RESET 0
#if defined(CONFIG_DVB_TUNER_XC5000) || defined(CONFIG_DVB_TUNER_XC5000_MODULE) #if defined(CONFIG_DVB_TUNER_XC5000) || defined(CONFIG_DVB_TUNER_XC5000_MODULE)
extern struct dvb_frontend* xc5000_attach(struct dvb_frontend *fe, extern struct dvb_frontend* xc5000_attach(struct dvb_frontend *fe,
struct i2c_adapter *i2c, struct i2c_adapter *i2c,
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "tuner-xc2028.h" #include "tuner-xc2028.h"
#include "tuner-simple.h" #include "tuner-simple.h"
#include "tda9887.h" #include "tda9887.h"
#include "xc5000.h"
#define UNSET (-1U) #define UNSET (-1U)
...@@ -329,6 +330,8 @@ static void attach_tda829x(struct tuner *t) ...@@ -329,6 +330,8 @@ static void attach_tda829x(struct tuner *t)
tda829x_attach(&t->fe, t->i2c->adapter, t->i2c->addr, &cfg); tda829x_attach(&t->fe, t->i2c->adapter, t->i2c->addr, &cfg);
} }
static struct xc5000_config xc5000_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))
...@@ -428,6 +431,23 @@ static void set_type(struct i2c_client *c, unsigned int type, ...@@ -428,6 +431,23 @@ static void set_type(struct i2c_client *c, unsigned int type,
case TUNER_TDA9887: case TUNER_TDA9887:
tda9887_attach(&t->fe, t->i2c->adapter, t->i2c->addr); tda9887_attach(&t->fe, t->i2c->adapter, t->i2c->addr);
break; break;
case TUNER_XC5000:
xc5000_cfg.i2c_address = t->i2c->addr;
xc5000_cfg.if_khz = 5380;
xc5000_cfg.video_dev = c->adapter->algo_data;
xc5000_cfg.tuner_callback = t->tuner_callback;
if (!xc5000_attach(&t->fe, t->i2c->adapter, &xc5000_cfg)) {
t->type = TUNER_ABSENT;
t->mode_mask = T_UNINITIALIZED;
return;
}
{
struct dvb_tuner_ops *xc_tuner_ops;
xc_tuner_ops = &t->fe.ops.tuner_ops;
if(xc_tuner_ops->init != NULL)
xc_tuner_ops->init(&t->fe);
}
break;
default: default:
attach_simple_tuner(t); attach_simple_tuner(t);
break; break;
......
...@@ -1475,6 +1475,10 @@ struct tunertype tuners[] = { ...@@ -1475,6 +1475,10 @@ struct tunertype tuners[] = {
.name = "Philips TEA5761 FM Radio", .name = "Philips TEA5761 FM Radio",
/* see tea5767.c for details */ /* see tea5767.c for details */
}, },
[TUNER_XC5000] = { /* Xceive 5000 */
.name = "Xceive 5000 tuner",
/* see xc5000.c for details */
},
}; };
unsigned const int tuner_count = ARRAY_SIZE(tuners); unsigned const int tuner_count = ARRAY_SIZE(tuners);
...@@ -121,6 +121,7 @@ ...@@ -121,6 +121,7 @@
#define TUNER_SAMSUNG_TCPG_6121P30A 73 /* Hauppauge PVR-500 PAL */ #define TUNER_SAMSUNG_TCPG_6121P30A 73 /* Hauppauge PVR-500 PAL */
#define TUNER_TDA9887 74 /* This tuner should be used only internally */ #define TUNER_TDA9887 74 /* This tuner should be used only internally */
#define TUNER_TEA5761 75 /* Only FM Radio Tuner */ #define TUNER_TEA5761 75 /* Only FM Radio Tuner */
#define TUNER_XC5000 76 /* Xceive Silicon Tuner */
/* tv card specific */ /* tv card specific */
#define TDA9887_PRESENT (1<<0) #define TDA9887_PRESENT (1<<0)
......
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