From c0b11b914de27e0e82b5311cf9b498a1b008b591 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Tue, 8 Nov 2005 21:35:32 -0800 Subject: [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: Taylor Jacob Signed-off-by: Michael Krufky Cc: Johannes Stezenbach Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/media/dvb/b2c2/flexcop-fe-tuner.c | 53 +++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'drivers/media/dvb/b2c2/flexcop-fe-tuner.c') diff --git a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c index bf5651b98bb..a35330315f6 100644 --- a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c +++ b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c @@ -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; -- cgit v1.2.3