提交 7e2d9820 编写于 作者: S Stefan Ringel 提交者: Mauro Carvalho Chehab

V4L/DVB: tm6000: add DVB support for tuner xc5000

[mchehab@redhat.com: Fix compilation breakage due to duplicate cfg config delaration without {}]
Signed-off-by: NStefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 dcf5d3aa
......@@ -28,6 +28,7 @@
#include <media/tuner.h>
#include "tuner-xc2028.h"
#include "xc5000.h"
static void inline print_err_status (struct tm6000_core *dev,
int packet, int status)
......@@ -257,27 +258,55 @@ int tm6000_dvb_register(struct tm6000_core *dev)
dvb->adapter.priv = dev;
if (dvb->frontend) {
struct xc2028_config cfg = {
.i2c_adap = &dev->i2c_adap,
.i2c_addr = dev->tuner_addr,
};
dvb->frontend->callback = tm6000_tuner_callback;
ret = dvb_register_frontend(&dvb->adapter, dvb->frontend);
if (ret < 0) {
printk(KERN_ERR
"tm6000: couldn't register frontend\n");
goto adapter_err;
switch (dev->tuner_type) {
case TUNER_XC2028: {
struct xc2028_config cfg = {
.i2c_adap = &dev->i2c_adap,
.i2c_addr = dev->tuner_addr,
};
dvb->frontend->callback = tm6000_tuner_callback;
ret = dvb_register_frontend(&dvb->adapter, dvb->frontend);
if (ret < 0) {
printk(KERN_ERR
"tm6000: couldn't register frontend\n");
goto adapter_err;
}
if (!dvb_attach(xc2028_attach, dvb->frontend, &cfg)) {
printk(KERN_ERR "tm6000: couldn't register "
"frontend (xc3028)\n");
ret = -EINVAL;
goto frontend_err;
}
printk(KERN_INFO "tm6000: XC2028/3028 asked to be "
"attached to frontend!\n");
break;
}
case TUNER_XC5000: {
struct xc5000_config cfg = {
.i2c_address = dev->tuner_addr,
};
dvb->frontend->callback = tm6000_xc5000_callback;
ret = dvb_register_frontend(&dvb->adapter, dvb->frontend);
if (ret < 0) {
printk(KERN_ERR
"tm6000: couldn't register frontend\n");
goto adapter_err;
}
if (!dvb_attach(xc5000_attach, dvb->frontend, &dev->i2c_adap, &cfg)) {
printk(KERN_ERR "tm6000: couldn't register "
"frontend (xc5000)\n");
ret = -EINVAL;
goto frontend_err;
}
printk(KERN_INFO "tm6000: XC5000 asked to be "
"attached to frontend!\n");
break;
}
}
if (!dvb_attach(xc2028_attach, dvb->frontend, &cfg)) {
printk(KERN_ERR "tm6000: couldn't register "
"frontend (xc3028)\n");
ret = -EINVAL;
goto frontend_err;
}
printk(KERN_INFO "tm6000: XC2028/3028 asked to be "
"attached to frontend!\n");
} else {
printk(KERN_ERR "tm6000: no frontend found\n");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册