aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/b2c2/flexcop-fe-tuner.c')
-rw-r--r--drivers/media/dvb/b2c2/flexcop-fe-tuner.c54
1 files changed, 53 insertions, 1 deletions
diff --git a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
index 47e28b0ee951..a35330315f65 100644
--- a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
+++ b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
@@ -13,6 +13,8 @@
13#include "bcm3510.h" 13#include "bcm3510.h"
14#include "stv0297.h" 14#include "stv0297.h"
15#include "mt312.h" 15#include "mt312.h"
16#include "lgdt330x.h"
17#include "dvb-pll.h"
16 18
17/* lnb control */ 19/* lnb control */
18 20
@@ -234,7 +236,6 @@ static struct stv0299_config samsung_tbmu24112_config = {
234 .inittab = samsung_tbmu24112_inittab, 236 .inittab = samsung_tbmu24112_inittab,
235 .mclk = 88000000UL, 237 .mclk = 88000000UL,
236 .invert = 0, 238 .invert = 0,
237 .enhanced_tuning = 0,
238 .skip_reinit = 0, 239 .skip_reinit = 0,
239 .lock_output = STV0229_LOCKOUTPUT_LK, 240 .lock_output = STV0229_LOCKOUTPUT_LK,
240 .volt13_op0_op1 = STV0299_VOLT13_OP1, 241 .volt13_op0_op1 = STV0299_VOLT13_OP1,
@@ -296,6 +297,52 @@ static int flexcop_fe_request_firmware(struct dvb_frontend* fe, const struct fir
296 return request_firmware(fw, name, fc->dev); 297 return request_firmware(fw, name, fc->dev);
297} 298}
298 299
300static int lgdt3303_pll_set(struct dvb_frontend* fe,
301 struct dvb_frontend_parameters* params)
302{
303 struct flexcop_device *fc = fe->dvb->priv;
304 u8 buf[4];
305 struct i2c_msg msg =
306 { .addr = 0x61, .flags = 0, .buf = buf, .len = 4 };
307 int err;
308
309 dvb_pll_configure(&dvb_pll_tdvs_tua6034,buf, params->frequency, 0);
310 dprintk(1, "%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n",
311 __FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]);
312 if ((err = i2c_transfer(&fc->i2c_adap, &msg, 1)) != 1) {
313 printk(KERN_WARNING "lgdt3303: %s error "
314 "(addr %02x <- %02x, err = %i)\n",
315 __FUNCTION__, buf[0], buf[1], err);
316 if (err < 0)
317 return err;
318 else
319 return -EREMOTEIO;
320 }
321
322 buf[0] = 0x86 | 0x18;
323 buf[1] = 0x50;
324 msg.len = 2;
325 if ((err = i2c_transfer(&fc->i2c_adap, &msg, 1)) != 1) {
326 printk(KERN_WARNING "lgdt3303: %s error "
327 "(addr %02x <- %02x, err = %i)\n",
328 __FUNCTION__, buf[0], buf[1], err);
329 if (err < 0)
330 return err;
331 else
332 return -EREMOTEIO;
333 }
334
335 return 0;
336}
337
338static struct lgdt330x_config air2pc_atsc_hd5000_config = {
339 .demod_address = 0x59,
340 .demod_chip = LGDT3303,
341 .serial_mpeg = 0x04,
342 .pll_set = lgdt3303_pll_set,
343 .clock_polarity_flip = 1,
344};
345
299static struct nxt2002_config samsung_tbmv_config = { 346static struct nxt2002_config samsung_tbmv_config = {
300 .demod_address = 0x0a, 347 .demod_address = 0x0a,
301 .request_firmware = flexcop_fe_request_firmware, 348 .request_firmware = flexcop_fe_request_firmware,
@@ -458,6 +505,11 @@ int flexcop_frontend_init(struct flexcop_device *fc)
458 fc->dev_type = FC_AIR_ATSC2; 505 fc->dev_type = FC_AIR_ATSC2;
459 info("found the nxt2002 at i2c address: 0x%02x",samsung_tbmv_config.demod_address); 506 info("found the nxt2002 at i2c address: 0x%02x",samsung_tbmv_config.demod_address);
460 } else 507 } else
508 /* try the air atsc 3nd generation (lgdt3303) */
509 if ((fc->fe = lgdt330x_attach(&air2pc_atsc_hd5000_config, &fc->i2c_adap)) != NULL) {
510 fc->dev_type = FC_AIR_ATSC3;
511 info("found the lgdt3303 at i2c address: 0x%02x",air2pc_atsc_hd5000_config.demod_address);
512 } else
461 /* try the air atsc 1nd generation (bcm3510)/panasonic ct10s */ 513 /* try the air atsc 1nd generation (bcm3510)/panasonic ct10s */
462 if ((fc->fe = bcm3510_attach(&air2pc_atsc_first_gen_config, &fc->i2c_adap)) != NULL) { 514 if ((fc->fe = bcm3510_attach(&air2pc_atsc_first_gen_config, &fc->i2c_adap)) != NULL) {
463 fc->dev_type = FC_AIR_ATSC1; 515 fc->dev_type = FC_AIR_ATSC1;