Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e2d9820 authored by Stefan Ringel's avatar Stefan Ringel Committed by Mauro Carvalho Chehab
Browse files

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: default avatarStefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent dcf5d3aa
Loading
Loading
Loading
Loading
+49 −20
Original line number Diff line number Diff line
@@ -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,6 +258,8 @@ int tm6000_dvb_register(struct tm6000_core *dev)
	dvb->adapter.priv = dev;

	if (dvb->frontend) {
		switch (dev->tuner_type) {
		case TUNER_XC2028: {
			struct xc2028_config cfg = {
				.i2c_adap = &dev->i2c_adap,
				.i2c_addr = dev->tuner_addr,
@@ -278,6 +281,32 @@ int tm6000_dvb_register(struct tm6000_core *dev)
			}
			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;
			}
		}
	} else {
		printk(KERN_ERR "tm6000: no frontend found\n");
	}