summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/tuner-core.c
diff options
context:
space:
mode:
authorSteven Toth <stoth@hauppauge.com>2008-01-05 14:50:14 -0500
committerSteven Toth <stoth@hauppauge.com>2008-01-05 14:50:14 -0500
commit0ff72a9f6b16aacf4796b7cc828a8e6ef23d21f6 (patch)
tree2eee9782f80c80e10d49c5e82d10c949a065413e /linux/drivers/media/video/tuner-core.c
parente2139d325792137613705857f08f07a43ba118f8 (diff)
downloadmediapointer-dvb-s2-0ff72a9f6b16aacf4796b7cc828a8e6ef23d21f6.tar.gz
mediapointer-dvb-s2-0ff72a9f6b16aacf4796b7cc828a8e6ef23d21f6.tar.bz2
xc5000: Tuner analog support
From: Steven Toth <stoth@hauppauge.com> 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: Chaogui Zhang <czhang1974@gmail.com> Signed-off-by: Steven Toth <stoth@hauppauge.com>
Diffstat (limited to 'linux/drivers/media/video/tuner-core.c')
-rw-r--r--linux/drivers/media/video/tuner-core.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c
index d93a764aa..9fb2b3f77 100644
--- a/linux/drivers/media/video/tuner-core.c
+++ b/linux/drivers/media/video/tuner-core.c
@@ -31,6 +31,7 @@
#include "tuner-xc2028.h"
#include "tuner-simple.h"
#include "tda9887.h"
+#include "xc5000.h"
#define UNSET (-1U)
@@ -358,6 +359,8 @@ static void attach_tda829x(struct tuner *t)
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,
unsigned int new_mode_mask, unsigned int new_config,
int (*tuner_callback) (void *dev, int command,int arg))
@@ -457,6 +460,23 @@ static void set_type(struct i2c_client *c, unsigned int type,
case TUNER_TDA9887:
tda9887_attach(&t->fe, t->i2c->adapter, t->i2c->addr);
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:
attach_simple_tuner(t);
break;