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

Commit c0b11b91 authored by Michael Krufky's avatar Michael Krufky Committed by Linus Torvalds
Browse files

[PATCH] dvb: Add support for Air2PC/AirStar 2 ATSC 3rd generation (HD5000)



Added support for Air2PC/AirStar 2 ATSC 3rd generation (HD5000)

Signed-off-by: default avatarTaylor Jacob <rtjacob@earthlink.net>
Signed-off-by: default avatarMichael Krufky <mkrufky@m1k.net>
Cc: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f7b67195
Loading
Loading
Loading
Loading
+53 −0
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@
#include "bcm3510.h"
#include "stv0297.h"
#include "mt312.h"
#include "lgdt330x.h"
#include "dvb-pll.h"

/* lnb control */

@@ -295,6 +297,52 @@ static int flexcop_fe_request_firmware(struct dvb_frontend* fe, const struct fir
	return request_firmware(fw, name, fc->dev);
}

static int lgdt3303_pll_set(struct dvb_frontend* fe,
                            struct dvb_frontend_parameters* params)
{
	struct flexcop_device *fc = fe->dvb->priv;
	u8 buf[4];
	struct i2c_msg msg =
		{ .addr = 0x61, .flags = 0, .buf = buf, .len = 4 };
	int err;

	dvb_pll_configure(&dvb_pll_tdvs_tua6034,buf, params->frequency, 0);
	dprintk(1, "%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n",
			__FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]);
	if ((err = i2c_transfer(&fc->i2c_adap, &msg, 1)) != 1) {
		printk(KERN_WARNING "lgdt3303: %s error "
			   "(addr %02x <- %02x, err = %i)\n",
			   __FUNCTION__, buf[0], buf[1], err);
		if (err < 0)
			return err;
		else
			return -EREMOTEIO;
	}

	buf[0] = 0x86 | 0x18;
	buf[1] = 0x50;
	msg.len = 2;
	if ((err = i2c_transfer(&fc->i2c_adap, &msg, 1)) != 1) {
		printk(KERN_WARNING "lgdt3303: %s error "
			   "(addr %02x <- %02x, err = %i)\n",
			   __FUNCTION__, buf[0], buf[1], err);
		if (err < 0)
			return err;
		else
			return -EREMOTEIO;
	}

        return 0;
}

static struct lgdt330x_config air2pc_atsc_hd5000_config = {
	.demod_address       = 0x59,
	.demod_chip          = LGDT3303,
	.serial_mpeg         = 0x04,
	.pll_set             = lgdt3303_pll_set,
	.clock_polarity_flip = 1,
};

static struct nxt2002_config samsung_tbmv_config = {
	.demod_address    = 0x0a,
	.request_firmware = flexcop_fe_request_firmware,
@@ -457,6 +505,11 @@ int flexcop_frontend_init(struct flexcop_device *fc)
		fc->dev_type          = FC_AIR_ATSC2;
		info("found the nxt2002 at i2c address: 0x%02x",samsung_tbmv_config.demod_address);
	} else
	/* try the air atsc 3nd generation (lgdt3303) */
	if ((fc->fe = lgdt330x_attach(&air2pc_atsc_hd5000_config, &fc->i2c_adap)) != NULL) {
		fc->dev_type          = FC_AIR_ATSC3;
		info("found the lgdt3303 at i2c address: 0x%02x",air2pc_atsc_hd5000_config.demod_address);
	} else
	/* try the air atsc 1nd generation (bcm3510)/panasonic ct10s */
	if ((fc->fe = bcm3510_attach(&air2pc_atsc_first_gen_config, &fc->i2c_adap)) != NULL) {
		fc->dev_type          = FC_AIR_ATSC1;
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ const char *flexcop_device_names[] = {
	"Sky2PC/SkyStar 2 DVB-S",
	"Sky2PC/SkyStar 2 DVB-S (old version)",
	"Cable2PC/CableStar 2 DVB-C",
	"Air2PC/AirStar 2 ATSC 3rd generation (HD5000)",
};

const char *flexcop_bus_names[] = {
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ typedef enum {
	FC_SKY,
	FC_SKY_OLD,
	FC_CABLE,
	FC_AIR_ATSC3,
} flexcop_device_type_t;

typedef enum {
+1 −0
Original line number Diff line number Diff line
@@ -193,6 +193,7 @@ static void flexcop_reset(struct flexcop_device *fc)
	v204 = fc->read_ibi_reg(fc,misc_204);
	v204.misc_204.Per_reset_sig = 0;
	fc->write_ibi_reg(fc,misc_204,v204);
	msleep(1);
	v204.misc_204.Per_reset_sig = 1;
	fc->write_ibi_reg(fc,misc_204,v204);
}
+1 −1
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ struct dvb_pll_desc dvb_pll_tua6034 = {
EXPORT_SYMBOL(dvb_pll_tua6034);

/* Infineon TUA6034
 * used in LG Innotek TDVS-H062F
 * used in LG TDVS H061F and LG TDVS H062F
 */
struct dvb_pll_desc dvb_pll_tdvs_tua6034 = {
	.name  = "LG/Infineon TUA6034",
Loading