aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStefan Ringel <stefan.ringel@arcor.de>2010-05-23 14:31:44 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-06-01 00:22:07 -0400
commit7e2d9820c37525da2469147eec897488ec141bcf (patch)
tree956b28000e146aca764e8d868bcafac224c82823 /drivers
parentdcf5d3aa081617a4a8aa56b7e24988d600148f50 (diff)
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: Stefan Ringel <stefan.ringel@arcor.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/tm6000/tm6000-dvb.c69
1 files changed, 49 insertions, 20 deletions
diff --git a/drivers/staging/tm6000/tm6000-dvb.c b/drivers/staging/tm6000/tm6000-dvb.c
index e6a802e9c48a..261e66acbe46 100644
--- a/drivers/staging/tm6000/tm6000-dvb.c
+++ b/drivers/staging/tm6000/tm6000-dvb.c
@@ -28,6 +28,7 @@
28#include <media/tuner.h> 28#include <media/tuner.h>
29 29
30#include "tuner-xc2028.h" 30#include "tuner-xc2028.h"
31#include "xc5000.h"
31 32
32static void inline print_err_status (struct tm6000_core *dev, 33static void inline print_err_status (struct tm6000_core *dev,
33 int packet, int status) 34 int packet, int status)
@@ -257,27 +258,55 @@ int tm6000_dvb_register(struct tm6000_core *dev)
257 dvb->adapter.priv = dev; 258 dvb->adapter.priv = dev;
258 259
259 if (dvb->frontend) { 260 if (dvb->frontend) {
260 struct xc2028_config cfg = { 261 switch (dev->tuner_type) {
261 .i2c_adap = &dev->i2c_adap, 262 case TUNER_XC2028: {
262 .i2c_addr = dev->tuner_addr, 263 struct xc2028_config cfg = {
263 }; 264 .i2c_adap = &dev->i2c_adap,
264 265 .i2c_addr = dev->tuner_addr,
265 dvb->frontend->callback = tm6000_tuner_callback; 266 };
266 ret = dvb_register_frontend(&dvb->adapter, dvb->frontend); 267
267 if (ret < 0) { 268 dvb->frontend->callback = tm6000_tuner_callback;
268 printk(KERN_ERR 269 ret = dvb_register_frontend(&dvb->adapter, dvb->frontend);
269 "tm6000: couldn't register frontend\n"); 270 if (ret < 0) {
270 goto adapter_err; 271 printk(KERN_ERR
272 "tm6000: couldn't register frontend\n");
273 goto adapter_err;
274 }
275
276 if (!dvb_attach(xc2028_attach, dvb->frontend, &cfg)) {
277 printk(KERN_ERR "tm6000: couldn't register "
278 "frontend (xc3028)\n");
279 ret = -EINVAL;
280 goto frontend_err;
281 }
282 printk(KERN_INFO "tm6000: XC2028/3028 asked to be "
283 "attached to frontend!\n");
284 break;
285 }
286 case TUNER_XC5000: {
287 struct xc5000_config cfg = {
288 .i2c_address = dev->tuner_addr,
289 };
290
291 dvb->frontend->callback = tm6000_xc5000_callback;
292 ret = dvb_register_frontend(&dvb->adapter, dvb->frontend);
293 if (ret < 0) {
294 printk(KERN_ERR
295 "tm6000: couldn't register frontend\n");
296 goto adapter_err;
297 }
298
299 if (!dvb_attach(xc5000_attach, dvb->frontend, &dev->i2c_adap, &cfg)) {
300 printk(KERN_ERR "tm6000: couldn't register "
301 "frontend (xc5000)\n");
302 ret = -EINVAL;
303 goto frontend_err;
304 }
305 printk(KERN_INFO "tm6000: XC5000 asked to be "
306 "attached to frontend!\n");
307 break;
308 }
271 } 309 }
272
273 if (!dvb_attach(xc2028_attach, dvb->frontend, &cfg)) {
274 printk(KERN_ERR "tm6000: couldn't register "
275 "frontend (xc3028)\n");
276 ret = -EINVAL;
277 goto frontend_err;
278 }
279 printk(KERN_INFO "tm6000: XC2028/3028 asked to be "
280 "attached to frontend!\n");
281 } else { 310 } else {
282 printk(KERN_ERR "tm6000: no frontend found\n"); 311 printk(KERN_ERR "tm6000: no frontend found\n");
283 } 312 }