summaryrefslogtreecommitdiff
path: root/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@m1k.net>2005-11-08 21:35:32 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-09 07:56:03 -0800
commitc0b11b914de27e0e82b5311cf9b498a1b008b591 (patch)
tree3eb9ff604ca727f5a86d3b592a01c528b99de454 /drivers/media/dvb/b2c2/flexcop-fe-tuner.c
parentf7b67195ea571b8540ac79daf27f5932ec40c098 (diff)
[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 <rtjacob@earthlink.net> Signed-off-by: Michael Krufky <mkrufky@m1k.net> Cc: Johannes Stezenbach <js@linuxtv.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/dvb/b2c2/flexcop-fe-tuner.c')
-rw-r--r--drivers/media/dvb/b2c2/flexcop-fe-tuner.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
index bf5651b98bbb..a35330315f65 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;