aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tda8290.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/tda8290.c')
-rw-r--r--drivers/media/video/tda8290.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c
index 55bc89a6f069..0ebb5b525e57 100644
--- a/drivers/media/video/tda8290.c
+++ b/drivers/media/video/tda8290.c
@@ -32,8 +32,6 @@ static int debug;
32module_param(debug, int, 0644); 32module_param(debug, int, 0644);
33MODULE_PARM_DESC(debug, "enable verbose debug messages"); 33MODULE_PARM_DESC(debug, "enable verbose debug messages");
34 34
35#define PREFIX "tda8290"
36
37/* ---------------------------------------------------------------------- */ 35/* ---------------------------------------------------------------------- */
38 36
39struct tda8290_priv { 37struct tda8290_priv {
@@ -174,7 +172,7 @@ static void tda8290_set_params(struct dvb_frontend *fe,
174 set_audio(fe, params); 172 set_audio(fe, params);
175 173
176 if (priv->cfg.config) 174 if (priv->cfg.config)
177 tuner_dbg("tda827xa config is 0x%02x\n", *priv->cfg.config); 175 tuner_dbg("tda827xa config is 0x%02x\n", priv->cfg.config);
178 tuner_i2c_xfer_send(&priv->i2c_props, easy_mode, 2); 176 tuner_i2c_xfer_send(&priv->i2c_props, easy_mode, 2);
179 tuner_i2c_xfer_send(&priv->i2c_props, agc_out_on, 2); 177 tuner_i2c_xfer_send(&priv->i2c_props, agc_out_on, 2);
180 tuner_i2c_xfer_send(&priv->i2c_props, soft_reset, 2); 178 tuner_i2c_xfer_send(&priv->i2c_props, soft_reset, 2);
@@ -365,7 +363,7 @@ static void tda8295_set_params(struct dvb_frontend *fe,
365 363
366 set_audio(fe, params); 364 set_audio(fe, params);
367 365
368 tuner_dbg("%s: freq = %d\n", __FUNCTION__, params->frequency); 366 tuner_dbg("%s: freq = %d\n", __func__, params->frequency);
369 367
370 tda8295_power(fe, 1); 368 tda8295_power(fe, 1);
371 tda8295_agc1_out(fe, 1); 369 tda8295_agc1_out(fe, 1);
@@ -444,8 +442,7 @@ static void tda8290_init_if(struct dvb_frontend *fe)
444 unsigned char set_GP00_CF[] = { 0x20, 0x01 }; 442 unsigned char set_GP00_CF[] = { 0x20, 0x01 };
445 unsigned char set_GP01_CF[] = { 0x20, 0x0B }; 443 unsigned char set_GP01_CF[] = { 0x20, 0x0B };
446 444
447 if ((priv->cfg.config) && 445 if ((priv->cfg.config == 1) || (priv->cfg.config == 2))
448 ((*priv->cfg.config == 1) || (*priv->cfg.config == 2)))
449 tuner_i2c_xfer_send(&priv->i2c_props, set_GP00_CF, 2); 446 tuner_i2c_xfer_send(&priv->i2c_props, set_GP00_CF, 2);
450 else 447 else
451 tuner_i2c_xfer_send(&priv->i2c_props, set_GP01_CF, 2); 448 tuner_i2c_xfer_send(&priv->i2c_props, set_GP01_CF, 2);
@@ -590,8 +587,8 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
590 else 587 else
591 priv->ver |= TDA8275A; 588 priv->ver |= TDA8275A;
592 589
593 tda827x_attach(fe, priv->tda827x_addr, 590 tda827x_attach(fe, priv->tda827x_addr, priv->i2c_props.adap, &priv->cfg);
594 priv->i2c_props.adap, &priv->cfg); 591 priv->cfg.switch_addr = priv->i2c_props.addr;
595 } 592 }
596 if (fe->ops.tuner_ops.init) 593 if (fe->ops.tuner_ops.init)
597 fe->ops.tuner_ops.init(fe); 594 fe->ops.tuner_ops.init(fe);
@@ -616,7 +613,7 @@ static int tda8290_probe(struct tuner_i2c_props *i2c_props)
616 if (tda8290_id[1] == TDA8290_ID) { 613 if (tda8290_id[1] == TDA8290_ID) {
617 if (debug) 614 if (debug)
618 printk(KERN_DEBUG "%s: tda8290 detected @ %d-%04x\n", 615 printk(KERN_DEBUG "%s: tda8290 detected @ %d-%04x\n",
619 __FUNCTION__, i2c_adapter_id(i2c_props->adap), 616 __func__, i2c_adapter_id(i2c_props->adap),
620 i2c_props->addr); 617 i2c_props->addr);
621 return 0; 618 return 0;
622 } 619 }
@@ -636,7 +633,7 @@ static int tda8295_probe(struct tuner_i2c_props *i2c_props)
636 if (tda8295_id[1] == TDA8295_ID) { 633 if (tda8295_id[1] == TDA8295_ID) {
637 if (debug) 634 if (debug)
638 printk(KERN_DEBUG "%s: tda8295 detected @ %d-%04x\n", 635 printk(KERN_DEBUG "%s: tda8295 detected @ %d-%04x\n",
639 __FUNCTION__, i2c_adapter_id(i2c_props->adap), 636 __func__, i2c_adapter_id(i2c_props->adap),
640 i2c_props->addr); 637 i2c_props->addr);
641 return 0; 638 return 0;
642 } 639 }
@@ -674,6 +671,7 @@ struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe,
674 671
675 priv->i2c_props.addr = i2c_addr; 672 priv->i2c_props.addr = i2c_addr;
676 priv->i2c_props.adap = i2c_adap; 673 priv->i2c_props.adap = i2c_adap;
674 priv->i2c_props.name = "tda829x";
677 if (cfg) { 675 if (cfg) {
678 priv->cfg.config = cfg->lna_cfg; 676 priv->cfg.config = cfg->lna_cfg;
679 priv->cfg.tuner_callback = cfg->tuner_callback; 677 priv->cfg.tuner_callback = cfg->tuner_callback;