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

Commit be183dc3 authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab
Browse files

[media] au0828-dvb: attach tuner based on dev->board.tuner_type on hvr950q



We can tell from the eeprom whether we have a xc5000a or xc5000c.
Attach the correct tuner based on this information.

Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 409328a4
Loading
Loading
Loading
Loading
+23 −4
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@
#include <linux/device.h>
#include <linux/device.h>
#include <linux/suspend.h>
#include <linux/suspend.h>
#include <media/v4l2-common.h>
#include <media/v4l2-common.h>
#include <media/tuner.h>


#include "au0828.h"
#include "au0828.h"
#include "au8522.h"
#include "au8522.h"
@@ -79,9 +80,16 @@ static struct au8522_config hauppauge_woodbury_config = {
	.vsb_if        = AU8522_IF_3_25MHZ,
	.vsb_if        = AU8522_IF_3_25MHZ,
};
};


static struct xc5000_config hauppauge_hvr950q_tunerconfig = {
static struct xc5000_config hauppauge_xc5000a_config = {
	.i2c_address      = 0x61,
	.i2c_address      = 0x61,
	.if_khz           = 6000,
	.if_khz           = 6000,
	.chip_id          = XC5000A,
};

static struct xc5000_config hauppauge_xc5000c_config = {
	.i2c_address      = 0x61,
	.if_khz           = 6000,
	.chip_id          = XC5000C,
};
};


static struct mxl5007t_config mxl5007t_hvr950q_config = {
static struct mxl5007t_config mxl5007t_hvr950q_config = {
@@ -383,8 +391,19 @@ int au0828_dvb_register(struct au0828_dev *dev)
				&hauppauge_hvr950q_config,
				&hauppauge_hvr950q_config,
				&dev->i2c_adap);
				&dev->i2c_adap);
		if (dvb->frontend != NULL)
		if (dvb->frontend != NULL)
			dvb_attach(xc5000_attach, dvb->frontend, &dev->i2c_adap,
			switch (dev->board.tuner_type) {
				   &hauppauge_hvr950q_tunerconfig);
			default:
			case TUNER_XC5000:
				dvb_attach(xc5000_attach, dvb->frontend,
					   &dev->i2c_adap,
					   &hauppauge_xc5000a_config);
				break;
			case TUNER_XC5000C:
				dvb_attach(xc5000_attach, dvb->frontend,
					   &dev->i2c_adap,
					   &hauppauge_xc5000c_config);
				break;
			}
		break;
		break;
	case AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL:
	case AU0828_BOARD_HAUPPAUGE_HVR950Q_MXL:
		dvb->frontend = dvb_attach(au8522_attach,
		dvb->frontend = dvb_attach(au8522_attach,
@@ -411,7 +430,7 @@ int au0828_dvb_register(struct au0828_dev *dev)
		if (dvb->frontend != NULL) {
		if (dvb->frontend != NULL) {
			dvb_attach(xc5000_attach, dvb->frontend,
			dvb_attach(xc5000_attach, dvb->frontend,
				&dev->i2c_adap,
				&dev->i2c_adap,
				&hauppauge_hvr950q_tunerconfig);
				&hauppauge_xc5000a_config);
		}
		}
		break;
		break;
	default:
	default: