aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHartmut Hackmann <hartmut.hackmann@t-online.de>2008-04-22 13:46:08 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:07:52 -0400
commit7bff4b4d3ad2b9ff42b4087f409076035af1d165 (patch)
treecfa75f91fbd30b8b36f70d7056639ee031d2a7ed /drivers/media
parent5823b3a63c7661272ea7fef7635955e2a50d17eb (diff)
V4L/DVB (7393): tda827x: fixed support of tuners with LNA
Tuner refactoring broke support of tuners with LNA configurations 1 and 2 for both, analog TV and DVB-T. Additionally, this patch initializes the saa713x gpios defined by the gpiomask at driver init to avoid undefined stated at dvb. Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/frontends/tda1004x.h1
-rw-r--r--drivers/media/dvb/frontends/tda827x.c163
-rw-r--r--drivers/media/dvb/frontends/tda827x.h4
-rw-r--r--drivers/media/video/saa7134/saa7134-cards.c13
-rw-r--r--drivers/media/video/saa7134/saa7134-core.c6
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c160
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c7
-rw-r--r--drivers/media/video/tda8290.c9
-rw-r--r--drivers/media/video/tda8290.h2
-rw-r--r--drivers/media/video/tuner-core.c2
10 files changed, 172 insertions, 195 deletions
diff --git a/drivers/media/dvb/frontends/tda1004x.h b/drivers/media/dvb/frontends/tda1004x.h
index abae8435014..ebb2c5f5a26 100644
--- a/drivers/media/dvb/frontends/tda1004x.h
+++ b/drivers/media/dvb/frontends/tda1004x.h
@@ -94,7 +94,6 @@ struct tda1004x_config
94 94
95 /* slave address and configuration of the tuner */ 95 /* slave address and configuration of the tuner */
96 u8 tuner_address; 96 u8 tuner_address;
97 u8 tuner_config;
98 u8 antenna_switch; 97 u8 antenna_switch;
99 98
100 /* if the board uses another I2c Bridge (tda8290), its address */ 99 /* if the board uses another I2c Bridge (tda8290), its address */
diff --git a/drivers/media/dvb/frontends/tda827x.c b/drivers/media/dvb/frontends/tda827x.c
index 967ac8b28ef..d30d2c9094d 100644
--- a/drivers/media/dvb/frontends/tda827x.c
+++ b/drivers/media/dvb/frontends/tda827x.c
@@ -142,7 +142,7 @@ static int tda827xo_set_params(struct dvb_frontend *fe,
142 int i, tuner_freq, if_freq; 142 int i, tuner_freq, if_freq;
143 u32 N; 143 u32 N;
144 144
145 dprintk("%s:\n", __FUNCTION__); 145 dprintk("%s:\n", __func__);
146 switch (params->u.ofdm.bandwidth) { 146 switch (params->u.ofdm.bandwidth) {
147 case BANDWIDTH_6_MHZ: 147 case BANDWIDTH_6_MHZ:
148 if_freq = 4000000; 148 if_freq = 4000000;
@@ -186,7 +186,7 @@ static int tda827xo_set_params(struct dvb_frontend *fe,
186 fe->ops.i2c_gate_ctrl(fe, 1); 186 fe->ops.i2c_gate_ctrl(fe, 1);
187 if (i2c_transfer(priv->i2c_adap, &msg, 1) != 1) { 187 if (i2c_transfer(priv->i2c_adap, &msg, 1) != 1) {
188 printk("%s: could not write to tuner at addr: 0x%02x\n", 188 printk("%s: could not write to tuner at addr: 0x%02x\n",
189 __FUNCTION__, priv->i2c_addr << 1); 189 __func__, priv->i2c_addr << 1);
190 return -EIO; 190 return -EIO;
191 } 191 }
192 msleep(500); 192 msleep(500);
@@ -212,7 +212,7 @@ static int tda827xo_sleep(struct dvb_frontend *fe)
212 struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0, 212 struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0,
213 .buf = buf, .len = sizeof(buf) }; 213 .buf = buf, .len = sizeof(buf) };
214 214
215 dprintk("%s:\n", __FUNCTION__); 215 dprintk("%s:\n", __func__);
216 if (fe->ops.i2c_gate_ctrl) 216 if (fe->ops.i2c_gate_ctrl)
217 fe->ops.i2c_gate_ctrl(fe, 1); 217 fe->ops.i2c_gate_ctrl(fe, 1);
218 i2c_transfer(priv->i2c_adap, &msg, 1); 218 i2c_transfer(priv->i2c_adap, &msg, 1);
@@ -389,6 +389,79 @@ static struct tda827xa_data tda827xa_analog[] = {
389 { .lomax = 0, .svco = 0, .spd = 0, .scr = 0, .sbs = 0, .gc3 = 0} 389 { .lomax = 0, .svco = 0, .spd = 0, .scr = 0, .sbs = 0, .gc3 = 0}
390}; 390};
391 391
392static int tda827xa_sleep(struct dvb_frontend *fe)
393{
394 struct tda827x_priv *priv = fe->tuner_priv;
395 static u8 buf[] = { 0x30, 0x90 };
396 struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0,
397 .buf = buf, .len = sizeof(buf) };
398
399 dprintk("%s:\n", __func__);
400 if (fe->ops.i2c_gate_ctrl)
401 fe->ops.i2c_gate_ctrl(fe, 1);
402
403 i2c_transfer(priv->i2c_adap, &msg, 1);
404
405 if (fe->ops.i2c_gate_ctrl)
406 fe->ops.i2c_gate_ctrl(fe, 0);
407
408 if (priv->cfg && priv->cfg->sleep)
409 priv->cfg->sleep(fe);
410
411 return 0;
412}
413
414static void tda827xa_lna_gain(struct dvb_frontend *fe, int high,
415 struct analog_parameters *params)
416{
417 struct tda827x_priv *priv = fe->tuner_priv;
418 unsigned char buf[] = {0x22, 0x01};
419 int arg;
420 int gp_func;
421 struct i2c_msg msg = { .addr = priv->cfg->switch_addr, .flags = 0,
422 .buf = buf, .len = sizeof(buf) };
423
424 if (NULL == priv->cfg) {
425 dprintk("tda827x_config not defined, cannot set LNA gain!\n");
426 return;
427 }
428 if (priv->cfg->config) {
429 if (high)
430 dprintk("setting LNA to high gain\n");
431 else
432 dprintk("setting LNA to low gain\n");
433 }
434 switch (priv->cfg->config) {
435 case 0: /* no LNA */
436 break;
437 case 1: /* switch is GPIO 0 of tda8290 */
438 case 2:
439 if (params == NULL) {
440 gp_func = 0;
441 arg = 0;
442 } else {
443 /* turn Vsync on */
444 gp_func = 1;
445 if (params->std & V4L2_STD_MN)
446 arg = 1;
447 else
448 arg = 0;
449 }
450 if (priv->cfg->tuner_callback)
451 priv->cfg->tuner_callback(priv->i2c_adap->algo_data,
452 gp_func, arg);
453 buf[1] = high ? 0 : 1;
454 if (priv->cfg->config == 2)
455 buf[1] = high ? 1 : 0;
456 i2c_transfer(priv->i2c_adap, &msg, 1);
457 break;
458 case 3: /* switch with GPIO of saa713x */
459 if (priv->cfg->tuner_callback)
460 priv->cfg->tuner_callback(priv->i2c_adap->algo_data, 0, high);
461 break;
462 }
463}
464
392static int tda827xa_set_params(struct dvb_frontend *fe, 465static int tda827xa_set_params(struct dvb_frontend *fe,
393 struct dvb_frontend_parameters *params) 466 struct dvb_frontend_parameters *params)
394{ 467{
@@ -401,9 +474,9 @@ static int tda827xa_set_params(struct dvb_frontend *fe,
401 int i, tuner_freq, if_freq; 474 int i, tuner_freq, if_freq;
402 u32 N; 475 u32 N;
403 476
404 dprintk("%s:\n", __FUNCTION__); 477 dprintk("%s:\n", __func__);
405 if (priv->cfg && priv->cfg->lna_gain) 478
406 priv->cfg->lna_gain(fe, 1); 479 tda827xa_lna_gain(fe, 1, NULL);
407 msleep(20); 480 msleep(20);
408 481
409 switch (params->u.ofdm.bandwidth) { 482 switch (params->u.ofdm.bandwidth) {
@@ -444,7 +517,7 @@ static int tda827xa_set_params(struct dvb_frontend *fe,
444 fe->ops.i2c_gate_ctrl(fe, 1); 517 fe->ops.i2c_gate_ctrl(fe, 1);
445 if (i2c_transfer(priv->i2c_adap, &msg, 1) != 1) { 518 if (i2c_transfer(priv->i2c_adap, &msg, 1) != 1) {
446 printk("%s: could not write to tuner at addr: 0x%02x\n", 519 printk("%s: could not write to tuner at addr: 0x%02x\n",
447 __FUNCTION__, priv->i2c_addr << 1); 520 __func__, priv->i2c_addr << 1);
448 return -EIO; 521 return -EIO;
449 } 522 }
450 buf[0] = 0x90; 523 buf[0] = 0x90;
@@ -474,8 +547,7 @@ static int tda827xa_set_params(struct dvb_frontend *fe,
474 buf[1] >>= 4; 547 buf[1] >>= 4;
475 dprintk("tda8275a AGC2 gain is: %d\n", buf[1]); 548 dprintk("tda8275a AGC2 gain is: %d\n", buf[1]);
476 if ((buf[1]) < 2) { 549 if ((buf[1]) < 2) {
477 if (priv->cfg && priv->cfg->lna_gain) 550 tda827xa_lna_gain(fe, 0, NULL);
478 priv->cfg->lna_gain(fe, 0);
479 buf[0] = 0x60; 551 buf[0] = 0x60;
480 buf[1] = 0x0c; 552 buf[1] = 0x0c;
481 if (fe->ops.i2c_gate_ctrl) 553 if (fe->ops.i2c_gate_ctrl)
@@ -523,73 +595,6 @@ static int tda827xa_set_params(struct dvb_frontend *fe,
523 return 0; 595 return 0;
524} 596}
525 597
526static int tda827xa_sleep(struct dvb_frontend *fe)
527{
528 struct tda827x_priv *priv = fe->tuner_priv;
529 static u8 buf[] = { 0x30, 0x90 };
530 struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0,
531 .buf = buf, .len = sizeof(buf) };
532
533 dprintk("%s:\n", __FUNCTION__);
534 if (fe->ops.i2c_gate_ctrl)
535 fe->ops.i2c_gate_ctrl(fe, 1);
536
537 i2c_transfer(priv->i2c_adap, &msg, 1);
538
539 if (fe->ops.i2c_gate_ctrl)
540 fe->ops.i2c_gate_ctrl(fe, 0);
541
542 if (priv->cfg && priv->cfg->sleep)
543 priv->cfg->sleep(fe);
544
545 return 0;
546}
547
548/* ------------------------------------------------------------------ */
549
550static void tda827xa_lna_gain(struct dvb_frontend *fe, int high,
551 struct analog_parameters *params)
552{
553 struct tda827x_priv *priv = fe->tuner_priv;
554 unsigned char buf[] = {0x22, 0x01};
555 int arg;
556 struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0,
557 .buf = buf, .len = sizeof(buf) };
558
559 if (NULL == priv->cfg) {
560 dprintk("tda827x_config not defined, cannot set LNA gain!\n");
561 return;
562 }
563
564 if (priv->cfg->config) {
565 if (high)
566 dprintk("setting LNA to high gain\n");
567 else
568 dprintk("setting LNA to low gain\n");
569 }
570 switch (*priv->cfg->config) {
571 case 0: /* no LNA */
572 break;
573 case 1: /* switch is GPIO 0 of tda8290 */
574 case 2:
575 /* turn Vsync on */
576 if (params->std & V4L2_STD_MN)
577 arg = 1;
578 else
579 arg = 0;
580 if (priv->cfg->tuner_callback)
581 priv->cfg->tuner_callback(priv, 1, arg);
582 buf[1] = high ? 0 : 1;
583 if (*priv->cfg->config == 2)
584 buf[1] = high ? 1 : 0;
585 i2c_transfer(priv->i2c_adap, &msg, 1);
586 break;
587 case 3: /* switch with GPIO of saa713x */
588 if (priv->cfg->tuner_callback)
589 priv->cfg->tuner_callback(priv, 0, high);
590 break;
591 }
592}
593 598
594static int tda827xa_set_analog_params(struct dvb_frontend *fe, 599static int tda827xa_set_analog_params(struct dvb_frontend *fe,
595 struct analog_parameters *params) 600 struct analog_parameters *params)
@@ -724,7 +729,7 @@ static int tda827x_get_bandwidth(struct dvb_frontend *fe, u32 *bandwidth)
724static int tda827x_init(struct dvb_frontend *fe) 729static int tda827x_init(struct dvb_frontend *fe)
725{ 730{
726 struct tda827x_priv *priv = fe->tuner_priv; 731 struct tda827x_priv *priv = fe->tuner_priv;
727 dprintk("%s:\n", __FUNCTION__); 732 dprintk("%s:\n", __func__);
728 if (priv->cfg && priv->cfg->init) 733 if (priv->cfg && priv->cfg->init)
729 priv->cfg->init(fe); 734 priv->cfg->init(fe);
730 735
@@ -792,7 +797,7 @@ static int tda827x_probe_version(struct dvb_frontend *fe)
792 fe->ops.i2c_gate_ctrl(fe, 1); 797 fe->ops.i2c_gate_ctrl(fe, 1);
793 if (i2c_transfer(priv->i2c_adap, &msg, 1) != 1) { 798 if (i2c_transfer(priv->i2c_adap, &msg, 1) != 1) {
794 printk("%s: could not read from tuner at addr: 0x%02x\n", 799 printk("%s: could not read from tuner at addr: 0x%02x\n",
795 __FUNCTION__, msg.addr << 1); 800 __func__, msg.addr << 1);
796 return -EIO; 801 return -EIO;
797 } 802 }
798 if ((data & 0x3c) == 0) { 803 if ((data & 0x3c) == 0) {
@@ -816,7 +821,7 @@ struct dvb_frontend *tda827x_attach(struct dvb_frontend *fe, int addr,
816{ 821{
817 struct tda827x_priv *priv = NULL; 822 struct tda827x_priv *priv = NULL;
818 823
819 dprintk("%s:\n", __FUNCTION__); 824 dprintk("%s:\n", __func__);
820 priv = kzalloc(sizeof(struct tda827x_priv), GFP_KERNEL); 825 priv = kzalloc(sizeof(struct tda827x_priv), GFP_KERNEL);
821 if (priv == NULL) 826 if (priv == NULL)
822 return NULL; 827 return NULL;
diff --git a/drivers/media/dvb/frontends/tda827x.h b/drivers/media/dvb/frontends/tda827x.h
index 92eb65b4012..cd3032f985c 100644
--- a/drivers/media/dvb/frontends/tda827x.h
+++ b/drivers/media/dvb/frontends/tda827x.h
@@ -30,12 +30,12 @@
30struct tda827x_config 30struct tda827x_config
31{ 31{
32 /* saa7134 - provided callbacks */ 32 /* saa7134 - provided callbacks */
33 void (*lna_gain) (struct dvb_frontend *fe, int high);
34 int (*init) (struct dvb_frontend *fe); 33 int (*init) (struct dvb_frontend *fe);
35 int (*sleep) (struct dvb_frontend *fe); 34 int (*sleep) (struct dvb_frontend *fe);
36 35
37 /* interface to tda829x driver */ 36 /* interface to tda829x driver */
38 unsigned int *config; 37 unsigned int config;
38 int switch_addr;
39 int (*tuner_callback) (void *dev, int command, int arg); 39 int (*tuner_callback) (void *dev, int command, int arg);
40 40
41 void (*agcf)(struct dvb_frontend *fe); 41 void (*agcf)(struct dvb_frontend *fe);
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index 1b6c7d697f0..bab8498046c 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -5260,12 +5260,13 @@ int saa7134_tuner_callback(void *priv, int command, int arg)
5260{ 5260{
5261 struct i2c_algo_bit_data *i2c_algo = priv; 5261 struct i2c_algo_bit_data *i2c_algo = priv;
5262 struct saa7134_dev *dev = i2c_algo->data; 5262 struct saa7134_dev *dev = i2c_algo->data;
5263 5263 if (dev != NULL) {
5264 switch (dev->tuner_type) { 5264 switch (dev->tuner_type) {
5265 case TUNER_PHILIPS_TDA8290: 5265 case TUNER_PHILIPS_TDA8290:
5266 return saa7134_tda8290_callback(dev, command, arg); 5266 return saa7134_tda8290_callback(dev, command, arg);
5267 case TUNER_XC2028: 5267 case TUNER_XC2028:
5268 return saa7134_xc2028_callback(dev, command, arg); 5268 return saa7134_xc2028_callback(dev, command, arg);
5269 }
5269 } 5270 }
5270 return -EINVAL; 5271 return -EINVAL;
5271} 5272}
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index ed96ce775a9..599273894f3 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -864,6 +864,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
864 struct saa7134_dev *dev; 864 struct saa7134_dev *dev;
865 struct saa7134_mpeg_ops *mops; 865 struct saa7134_mpeg_ops *mops;
866 int err; 866 int err;
867 int mask;
867 868
868 dev = kzalloc(sizeof(*dev),GFP_KERNEL); 869 dev = kzalloc(sizeof(*dev),GFP_KERNEL);
869 if (NULL == dev) 870 if (NULL == dev)
@@ -1061,6 +1062,11 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
1061 if (TUNER_ABSENT != dev->tuner_type) 1062 if (TUNER_ABSENT != dev->tuner_type)
1062 saa7134_i2c_call_clients(dev, TUNER_SET_STANDBY, NULL); 1063 saa7134_i2c_call_clients(dev, TUNER_SET_STANDBY, NULL);
1063 1064
1065 if (card(dev).gpiomask != 0) {
1066 mask = card(dev).gpiomask;
1067 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, mask, mask);
1068 saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, mask, 0);
1069 }
1064 return 0; 1070 return 0;
1065 1071
1066 fail4: 1072 fail4:
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 8e55c7572b4..f95f5f2fbf7 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -439,8 +439,6 @@ static struct tda1004x_config philips_europa_config = {
439 .request_firmware = philips_tda1004x_request_firmware 439 .request_firmware = philips_tda1004x_request_firmware
440}; 440};
441 441
442/* ------------------------------------------------------------------ */
443
444static struct tda1004x_config medion_cardbus = { 442static struct tda1004x_config medion_cardbus = {
445 .demod_address = 0x08, 443 .demod_address = 0x08,
446 .invert = 1, 444 .invert = 1,
@@ -456,47 +454,6 @@ static struct tda1004x_config medion_cardbus = {
456 * tda 1004x based cards with philips silicon tuner 454 * tda 1004x based cards with philips silicon tuner
457 */ 455 */
458 456
459static void philips_tda827x_lna_gain(struct dvb_frontend *fe, int high)
460{
461 struct saa7134_dev *dev = fe->dvb->priv;
462 struct tda1004x_state *state = fe->demodulator_priv;
463 u8 addr = state->config->i2c_gate;
464 u8 config = state->config->tuner_config;
465 u8 GP00_CF[] = {0x20, 0x01};
466 u8 GP00_LEV[] = {0x22, 0x00};
467
468 struct i2c_msg msg = {.addr = addr,.flags = 0,.buf = GP00_CF, .len = 2};
469 if (config) {
470 if (high) {
471 dprintk("setting LNA to high gain\n");
472 } else {
473 dprintk("setting LNA to low gain\n");
474 }
475 }
476 switch (config) {
477 case 0: /* no LNA */
478 break;
479 case 1: /* switch is GPIO 0 of tda8290 */
480 case 2:
481 /* turn Vsync off */
482 saa7134_set_gpio(dev, 22, 0);
483 GP00_LEV[1] = high ? 0 : 1;
484 if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) {
485 wprintk("could not access tda8290 at addr: 0x%02x\n",
486 addr << 1);
487 return;
488 }
489 msg.buf = GP00_LEV;
490 if (config == 2)
491 GP00_LEV[1] = high ? 1 : 0;
492 i2c_transfer(&dev->i2c_adap, &msg, 1);
493 break;
494 case 3: /* switch with GPIO of saa713x */
495 saa7134_set_gpio(dev, 22, high);
496 break;
497 }
498}
499
500static int tda8290_i2c_gate_ctrl( struct dvb_frontend* fe, int enable) 457static int tda8290_i2c_gate_ctrl( struct dvb_frontend* fe, int enable)
501{ 458{
502 struct tda1004x_state *state = fe->demodulator_priv; 459 struct tda1004x_state *state = fe->demodulator_priv;
@@ -519,8 +476,6 @@ static int tda8290_i2c_gate_ctrl( struct dvb_frontend* fe, int enable)
519 return 0; 476 return 0;
520} 477}
521 478
522/* ------------------------------------------------------------------ */
523
524static int philips_tda827x_tuner_init(struct dvb_frontend *fe) 479static int philips_tda827x_tuner_init(struct dvb_frontend *fe)
525{ 480{
526 struct saa7134_dev *dev = fe->dvb->priv; 481 struct saa7134_dev *dev = fe->dvb->priv;
@@ -555,28 +510,57 @@ static int philips_tda827x_tuner_sleep(struct dvb_frontend *fe)
555 return 0; 510 return 0;
556} 511}
557 512
558static struct tda827x_config tda827x_cfg = { 513static void configure_tda827x_fe(struct saa7134_dev *dev, struct tda1004x_config *cdec_conf,
559 .lna_gain = philips_tda827x_lna_gain, 514 struct tda827x_config *tuner_conf)
560 .init = philips_tda827x_tuner_init,
561 .sleep = philips_tda827x_tuner_sleep
562};
563
564static void configure_tda827x_fe(struct saa7134_dev *dev, struct tda1004x_config *tda_conf)
565{ 515{
566 dev->dvb.frontend = dvb_attach(tda10046_attach, tda_conf, &dev->i2c_adap); 516 dev->dvb.frontend = dvb_attach(tda10046_attach, cdec_conf, &dev->i2c_adap);
567 if (dev->dvb.frontend) { 517 if (dev->dvb.frontend) {
568 if (tda_conf->i2c_gate) 518 if (cdec_conf->i2c_gate)
569 dev->dvb.frontend->ops.i2c_gate_ctrl = tda8290_i2c_gate_ctrl; 519 dev->dvb.frontend->ops.i2c_gate_ctrl = tda8290_i2c_gate_ctrl;
570 if (dvb_attach(tda827x_attach, dev->dvb.frontend, tda_conf->tuner_address, 520 if (dvb_attach(tda827x_attach, dev->dvb.frontend, cdec_conf->tuner_address,
571 &dev->i2c_adap,&tda827x_cfg) == NULL) { 521 &dev->i2c_adap, tuner_conf) == NULL) {
572 wprintk("no tda827x tuner found at addr: %02x\n", 522 wprintk("no tda827x tuner found at addr: %02x\n",
573 tda_conf->tuner_address); 523 cdec_conf->tuner_address);
574 } 524 }
575 } 525 }
576} 526}
577 527
578/* ------------------------------------------------------------------ */ 528/* ------------------------------------------------------------------ */
579 529
530static struct tda827x_config tda827x_cfg_0 = {
531 .tuner_callback = saa7134_tuner_callback,
532 .init = philips_tda827x_tuner_init,
533 .sleep = philips_tda827x_tuner_sleep,
534 .config = 0,
535 .switch_addr = 0
536};
537
538static struct tda827x_config tda827x_cfg_1 = {
539 .tuner_callback = saa7134_tuner_callback,
540 .init = philips_tda827x_tuner_init,
541 .sleep = philips_tda827x_tuner_sleep,
542 .config = 1,
543 .switch_addr = 0x4b
544};
545
546static struct tda827x_config tda827x_cfg_2 = {
547 .tuner_callback = saa7134_tuner_callback,
548 .init = philips_tda827x_tuner_init,
549 .sleep = philips_tda827x_tuner_sleep,
550 .config = 2,
551 .switch_addr = 0x4b
552};
553
554static struct tda827x_config tda827x_cfg_2_sw42 = {
555 .tuner_callback = saa7134_tuner_callback,
556 .init = philips_tda827x_tuner_init,
557 .sleep = philips_tda827x_tuner_sleep,
558 .config = 2,
559 .switch_addr = 0x42
560};
561
562/* ------------------------------------------------------------------ */
563
580static struct tda1004x_config tda827x_lifeview_config = { 564static struct tda1004x_config tda827x_lifeview_config = {
581 .demod_address = 0x08, 565 .demod_address = 0x08,
582 .invert = 1, 566 .invert = 1,
@@ -599,7 +583,6 @@ static struct tda1004x_config philips_tiger_config = {
599 .if_freq = TDA10046_FREQ_045, 583 .if_freq = TDA10046_FREQ_045,
600 .i2c_gate = 0x4b, 584 .i2c_gate = 0x4b,
601 .tuner_address = 0x61, 585 .tuner_address = 0x61,
602 .tuner_config = 0,
603 .antenna_switch= 1, 586 .antenna_switch= 1,
604 .request_firmware = philips_tda1004x_request_firmware 587 .request_firmware = philips_tda1004x_request_firmware
605}; 588};
@@ -614,7 +597,6 @@ static struct tda1004x_config cinergy_ht_config = {
614 .if_freq = TDA10046_FREQ_045, 597 .if_freq = TDA10046_FREQ_045,
615 .i2c_gate = 0x4b, 598 .i2c_gate = 0x4b,
616 .tuner_address = 0x61, 599 .tuner_address = 0x61,
617 .tuner_config = 0,
618 .request_firmware = philips_tda1004x_request_firmware 600 .request_firmware = philips_tda1004x_request_firmware
619}; 601};
620 602
@@ -628,7 +610,6 @@ static struct tda1004x_config cinergy_ht_pci_config = {
628 .if_freq = TDA10046_FREQ_045, 610 .if_freq = TDA10046_FREQ_045,
629 .i2c_gate = 0x4b, 611 .i2c_gate = 0x4b,
630 .tuner_address = 0x60, 612 .tuner_address = 0x60,
631 .tuner_config = 0,
632 .request_firmware = philips_tda1004x_request_firmware 613 .request_firmware = philips_tda1004x_request_firmware
633}; 614};
634 615
@@ -642,7 +623,6 @@ static struct tda1004x_config philips_tiger_s_config = {
642 .if_freq = TDA10046_FREQ_045, 623 .if_freq = TDA10046_FREQ_045,
643 .i2c_gate = 0x4b, 624 .i2c_gate = 0x4b,
644 .tuner_address = 0x61, 625 .tuner_address = 0x61,
645 .tuner_config = 2,
646 .antenna_switch= 1, 626 .antenna_switch= 1,
647 .request_firmware = philips_tda1004x_request_firmware 627 .request_firmware = philips_tda1004x_request_firmware
648}; 628};
@@ -657,7 +637,6 @@ static struct tda1004x_config pinnacle_pctv_310i_config = {
657 .if_freq = TDA10046_FREQ_045, 637 .if_freq = TDA10046_FREQ_045,
658 .i2c_gate = 0x4b, 638 .i2c_gate = 0x4b,
659 .tuner_address = 0x61, 639 .tuner_address = 0x61,
660 .tuner_config = 1,
661 .request_firmware = philips_tda1004x_request_firmware 640 .request_firmware = philips_tda1004x_request_firmware
662}; 641};
663 642
@@ -671,7 +650,6 @@ static struct tda1004x_config hauppauge_hvr_1110_config = {
671 .if_freq = TDA10046_FREQ_045, 650 .if_freq = TDA10046_FREQ_045,
672 .i2c_gate = 0x4b, 651 .i2c_gate = 0x4b,
673 .tuner_address = 0x61, 652 .tuner_address = 0x61,
674 .tuner_config = 1,
675 .request_firmware = philips_tda1004x_request_firmware 653 .request_firmware = philips_tda1004x_request_firmware
676}; 654};
677 655
@@ -685,7 +663,6 @@ static struct tda1004x_config asus_p7131_dual_config = {
685 .if_freq = TDA10046_FREQ_045, 663 .if_freq = TDA10046_FREQ_045,
686 .i2c_gate = 0x4b, 664 .i2c_gate = 0x4b,
687 .tuner_address = 0x61, 665 .tuner_address = 0x61,
688 .tuner_config = 0,
689 .antenna_switch= 2, 666 .antenna_switch= 2,
690 .request_firmware = philips_tda1004x_request_firmware 667 .request_firmware = philips_tda1004x_request_firmware
691}; 668};
@@ -724,7 +701,6 @@ static struct tda1004x_config md8800_dvbt_config = {
724 .if_freq = TDA10046_FREQ_045, 701 .if_freq = TDA10046_FREQ_045,
725 .i2c_gate = 0x4b, 702 .i2c_gate = 0x4b,
726 .tuner_address = 0x60, 703 .tuner_address = 0x60,
727 .tuner_config = 0,
728 .request_firmware = philips_tda1004x_request_firmware 704 .request_firmware = philips_tda1004x_request_firmware
729}; 705};
730 706
@@ -738,7 +714,6 @@ static struct tda1004x_config asus_p7131_4871_config = {
738 .if_freq = TDA10046_FREQ_045, 714 .if_freq = TDA10046_FREQ_045,
739 .i2c_gate = 0x4b, 715 .i2c_gate = 0x4b,
740 .tuner_address = 0x61, 716 .tuner_address = 0x61,
741 .tuner_config = 2,
742 .antenna_switch= 2, 717 .antenna_switch= 2,
743 .request_firmware = philips_tda1004x_request_firmware 718 .request_firmware = philips_tda1004x_request_firmware
744}; 719};
@@ -753,7 +728,6 @@ static struct tda1004x_config asus_p7131_hybrid_lna_config = {
753 .if_freq = TDA10046_FREQ_045, 728 .if_freq = TDA10046_FREQ_045,
754 .i2c_gate = 0x4b, 729 .i2c_gate = 0x4b,
755 .tuner_address = 0x61, 730 .tuner_address = 0x61,
756 .tuner_config = 2,
757 .antenna_switch= 2, 731 .antenna_switch= 2,
758 .request_firmware = philips_tda1004x_request_firmware 732 .request_firmware = philips_tda1004x_request_firmware
759}; 733};
@@ -768,7 +742,6 @@ static struct tda1004x_config kworld_dvb_t_210_config = {
768 .if_freq = TDA10046_FREQ_045, 742 .if_freq = TDA10046_FREQ_045,
769 .i2c_gate = 0x4b, 743 .i2c_gate = 0x4b,
770 .tuner_address = 0x61, 744 .tuner_address = 0x61,
771 .tuner_config = 2,
772 .antenna_switch= 1, 745 .antenna_switch= 1,
773 .request_firmware = philips_tda1004x_request_firmware 746 .request_firmware = philips_tda1004x_request_firmware
774}; 747};
@@ -783,7 +756,6 @@ static struct tda1004x_config avermedia_super_007_config = {
783 .if_freq = TDA10046_FREQ_045, 756 .if_freq = TDA10046_FREQ_045,
784 .i2c_gate = 0x4b, 757 .i2c_gate = 0x4b,
785 .tuner_address = 0x60, 758 .tuner_address = 0x60,
786 .tuner_config = 0,
787 .antenna_switch= 1, 759 .antenna_switch= 1,
788 .request_firmware = philips_tda1004x_request_firmware 760 .request_firmware = philips_tda1004x_request_firmware
789}; 761};
@@ -798,7 +770,6 @@ static struct tda1004x_config twinhan_dtv_dvb_3056_config = {
798 .if_freq = TDA10046_FREQ_045, 770 .if_freq = TDA10046_FREQ_045,
799 .i2c_gate = 0x42, 771 .i2c_gate = 0x42,
800 .tuner_address = 0x61, 772 .tuner_address = 0x61,
801 .tuner_config = 2,
802 .antenna_switch = 1, 773 .antenna_switch = 1,
803 .request_firmware = philips_tda1004x_request_firmware 774 .request_firmware = philips_tda1004x_request_firmware
804}; 775};
@@ -826,9 +797,10 @@ static int ads_duo_tuner_sleep(struct dvb_frontend *fe)
826} 797}
827 798
828static struct tda827x_config ads_duo_cfg = { 799static struct tda827x_config ads_duo_cfg = {
829 .lna_gain = philips_tda827x_lna_gain, 800 .tuner_callback = saa7134_tuner_callback,
830 .init = ads_duo_tuner_init, 801 .init = ads_duo_tuner_init,
831 .sleep = ads_duo_tuner_sleep 802 .sleep = ads_duo_tuner_sleep,
803 .config = 0
832}; 804};
833 805
834static struct tda1004x_config ads_tech_duo_config = { 806static struct tda1004x_config ads_tech_duo_config = {
@@ -981,7 +953,7 @@ static int dvb_init(struct saa7134_dev *dev)
981 break; 953 break;
982 case SAA7134_BOARD_FLYDVBTDUO: 954 case SAA7134_BOARD_FLYDVBTDUO:
983 case SAA7134_BOARD_FLYDVBT_DUO_CARDBUS: 955 case SAA7134_BOARD_FLYDVBT_DUO_CARDBUS:
984 configure_tda827x_fe(dev, &tda827x_lifeview_config); 956 configure_tda827x_fe(dev, &tda827x_lifeview_config, &tda827x_cfg_0);
985 break; 957 break;
986 case SAA7134_BOARD_PHILIPS_EUROPA: 958 case SAA7134_BOARD_PHILIPS_EUROPA:
987 case SAA7134_BOARD_VIDEOMATE_DVBT_300: 959 case SAA7134_BOARD_VIDEOMATE_DVBT_300:
@@ -1006,27 +978,27 @@ static int dvb_init(struct saa7134_dev *dev)
1006 } 978 }
1007 break; 979 break;
1008 case SAA7134_BOARD_KWORLD_DVBT_210: 980 case SAA7134_BOARD_KWORLD_DVBT_210:
1009 configure_tda827x_fe(dev, &kworld_dvb_t_210_config); 981 configure_tda827x_fe(dev, &kworld_dvb_t_210_config, &tda827x_cfg_2);
1010 break; 982 break;
1011 case SAA7134_BOARD_PHILIPS_TIGER: 983 case SAA7134_BOARD_PHILIPS_TIGER:
1012 configure_tda827x_fe(dev, &philips_tiger_config); 984 configure_tda827x_fe(dev, &philips_tiger_config, &tda827x_cfg_0);
1013 break; 985 break;
1014 case SAA7134_BOARD_PINNACLE_PCTV_310i: 986 case SAA7134_BOARD_PINNACLE_PCTV_310i:
1015 configure_tda827x_fe(dev, &pinnacle_pctv_310i_config); 987 configure_tda827x_fe(dev, &pinnacle_pctv_310i_config, &tda827x_cfg_1);
1016 break; 988 break;
1017 case SAA7134_BOARD_HAUPPAUGE_HVR1110: 989 case SAA7134_BOARD_HAUPPAUGE_HVR1110:
1018 configure_tda827x_fe(dev, &hauppauge_hvr_1110_config); 990 configure_tda827x_fe(dev, &hauppauge_hvr_1110_config, &tda827x_cfg_1);
1019 break; 991 break;
1020 case SAA7134_BOARD_ASUSTeK_P7131_DUAL: 992 case SAA7134_BOARD_ASUSTeK_P7131_DUAL:
1021 configure_tda827x_fe(dev, &asus_p7131_dual_config); 993 configure_tda827x_fe(dev, &asus_p7131_dual_config, &tda827x_cfg_0);
1022 break; 994 break;
1023 case SAA7134_BOARD_FLYDVBT_LR301: 995 case SAA7134_BOARD_FLYDVBT_LR301:
1024 configure_tda827x_fe(dev, &tda827x_lifeview_config); 996 configure_tda827x_fe(dev, &tda827x_lifeview_config, &tda827x_cfg_0);
1025 break; 997 break;
1026 case SAA7134_BOARD_FLYDVB_TRIO: 998 case SAA7134_BOARD_FLYDVB_TRIO:
1027 if(! use_frontend) { /* terrestrial */ 999 if(! use_frontend) { /* terrestrial */
1028 configure_tda827x_fe(dev, &lifeview_trio_config); 1000 configure_tda827x_fe(dev, &lifeview_trio_config, &tda827x_cfg_0);
1029 } else { /* satellite */ 1001 } else { /* satellite */
1030 dev->dvb.frontend = dvb_attach(tda10086_attach, &flydvbs, &dev->i2c_adap); 1002 dev->dvb.frontend = dvb_attach(tda10086_attach, &flydvbs, &dev->i2c_adap);
1031 if (dev->dvb.frontend) { 1003 if (dev->dvb.frontend) {
1032 if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x63, 1004 if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x63,
@@ -1047,19 +1019,19 @@ static int dvb_init(struct saa7134_dev *dev)
1047 &dev->i2c_adap); 1019 &dev->i2c_adap);
1048 if (dev->dvb.frontend) { 1020 if (dev->dvb.frontend) {
1049 if (dvb_attach(tda827x_attach,dev->dvb.frontend, 1021 if (dvb_attach(tda827x_attach,dev->dvb.frontend,
1050 ads_tech_duo_config.tuner_address, 1022 ads_tech_duo_config.tuner_address, &dev->i2c_adap,
1051 &dev->i2c_adap,&ads_duo_cfg) == NULL) { 1023 &ads_duo_cfg) == NULL) {
1052 wprintk("no tda827x tuner found at addr: %02x\n", 1024 wprintk("no tda827x tuner found at addr: %02x\n",
1053 ads_tech_duo_config.tuner_address); 1025 ads_tech_duo_config.tuner_address);
1054 } 1026 }
1055 } 1027 }
1056 break; 1028 break;
1057 case SAA7134_BOARD_TEVION_DVBT_220RF: 1029 case SAA7134_BOARD_TEVION_DVBT_220RF:
1058 configure_tda827x_fe(dev, &tevion_dvbt220rf_config); 1030 configure_tda827x_fe(dev, &tevion_dvbt220rf_config, &tda827x_cfg_0);
1059 break; 1031 break;
1060 case SAA7134_BOARD_MEDION_MD8800_QUADRO: 1032 case SAA7134_BOARD_MEDION_MD8800_QUADRO:
1061 if (!use_frontend) { /* terrestrial */ 1033 if (!use_frontend) { /* terrestrial */
1062 configure_tda827x_fe(dev, &md8800_dvbt_config); 1034 configure_tda827x_fe(dev, &md8800_dvbt_config, &tda827x_cfg_0);
1063 } else { /* satellite */ 1035 } else { /* satellite */
1064 dev->dvb.frontend = dvb_attach(tda10086_attach, 1036 dev->dvb.frontend = dvb_attach(tda10086_attach,
1065 &flydvbs, &dev->i2c_adap); 1037 &flydvbs, &dev->i2c_adap);
@@ -1148,25 +1120,25 @@ static int dvb_init(struct saa7134_dev *dev)
1148 } 1120 }
1149 break; 1121 break;
1150 case SAA7134_BOARD_CINERGY_HT_PCMCIA: 1122 case SAA7134_BOARD_CINERGY_HT_PCMCIA:
1151 configure_tda827x_fe(dev, &cinergy_ht_config); 1123 configure_tda827x_fe(dev, &cinergy_ht_config, &tda827x_cfg_0);
1152 break; 1124 break;
1153 case SAA7134_BOARD_CINERGY_HT_PCI: 1125 case SAA7134_BOARD_CINERGY_HT_PCI:
1154 configure_tda827x_fe(dev, &cinergy_ht_pci_config); 1126 configure_tda827x_fe(dev, &cinergy_ht_pci_config, &tda827x_cfg_0);
1155 break; 1127 break;
1156 case SAA7134_BOARD_PHILIPS_TIGER_S: 1128 case SAA7134_BOARD_PHILIPS_TIGER_S:
1157 configure_tda827x_fe(dev, &philips_tiger_s_config); 1129 configure_tda827x_fe(dev, &philips_tiger_s_config, &tda827x_cfg_2);
1158 break; 1130 break;
1159 case SAA7134_BOARD_ASUS_P7131_4871: 1131 case SAA7134_BOARD_ASUS_P7131_4871:
1160 configure_tda827x_fe(dev, &asus_p7131_4871_config); 1132 configure_tda827x_fe(dev, &asus_p7131_4871_config, &tda827x_cfg_2);
1161 break; 1133 break;
1162 case SAA7134_BOARD_ASUSTeK_P7131_HYBRID_LNA: 1134 case SAA7134_BOARD_ASUSTeK_P7131_HYBRID_LNA:
1163 configure_tda827x_fe(dev, &asus_p7131_hybrid_lna_config); 1135 configure_tda827x_fe(dev, &asus_p7131_hybrid_lna_config, &tda827x_cfg_2);
1164 break; 1136 break;
1165 case SAA7134_BOARD_AVERMEDIA_SUPER_007: 1137 case SAA7134_BOARD_AVERMEDIA_SUPER_007:
1166 configure_tda827x_fe(dev, &avermedia_super_007_config); 1138 configure_tda827x_fe(dev, &avermedia_super_007_config, &tda827x_cfg_0);
1167 break; 1139 break;
1168 case SAA7134_BOARD_TWINHAN_DTV_DVB_3056: 1140 case SAA7134_BOARD_TWINHAN_DTV_DVB_3056:
1169 configure_tda827x_fe(dev, &twinhan_dtv_dvb_3056_config); 1141 configure_tda827x_fe(dev, &twinhan_dtv_dvb_3056_config, &tda827x_cfg_2_sw42);
1170 break; 1142 break;
1171 case SAA7134_BOARD_PHILIPS_SNAKE: 1143 case SAA7134_BOARD_PHILIPS_SNAKE:
1172 dev->dvb.frontend = dvb_attach(tda10086_attach, &flydvbs, 1144 dev->dvb.frontend = dvb_attach(tda10086_attach, &flydvbs,
@@ -1181,10 +1153,10 @@ static int dvb_init(struct saa7134_dev *dev)
1181 } 1153 }
1182 break; 1154 break;
1183 case SAA7134_BOARD_CREATIX_CTX953: 1155 case SAA7134_BOARD_CREATIX_CTX953:
1184 configure_tda827x_fe(dev, &md8800_dvbt_config); 1156 configure_tda827x_fe(dev, &md8800_dvbt_config, &tda827x_cfg_0);
1185 break; 1157 break;
1186 case SAA7134_BOARD_MSI_TVANYWHERE_AD11: 1158 case SAA7134_BOARD_MSI_TVANYWHERE_AD11:
1187 configure_tda827x_fe(dev, &philips_tiger_s_config); 1159 configure_tda827x_fe(dev, &philips_tiger_s_config, &tda827x_cfg_2);
1188 break; 1160 break;
1189 case SAA7134_BOARD_AVERMEDIA_CARDBUS_506: 1161 case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
1190 dev->dvb.frontend = dvb_attach(mt352_attach, 1162 dev->dvb.frontend = dvb_attach(mt352_attach,
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index ecc5243da57..a0baf2d0ba7 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -626,13 +626,8 @@ void saa7134_set_tvnorm_hw(struct saa7134_dev *dev)
626{ 626{
627 saa7134_set_decoder(dev); 627 saa7134_set_decoder(dev);
628 628
629 if (card_in(dev, dev->ctl_input).tv) { 629 if (card_in(dev, dev->ctl_input).tv)
630 if ((card(dev).tuner_type == TUNER_PHILIPS_TDA8290)
631 && ((card(dev).tuner_config == 1)
632 || (card(dev).tuner_config == 2)))
633 saa7134_set_gpio(dev, 22, 5);
634 saa7134_i2c_call_clients(dev, VIDIOC_S_STD, &dev->tvnorm->id); 630 saa7134_i2c_call_clients(dev, VIDIOC_S_STD, &dev->tvnorm->id);
635 }
636} 631}
637 632
638static void set_h_prescale(struct saa7134_dev *dev, int task, int prescale) 633static void set_h_prescale(struct saa7134_dev *dev, int task, int prescale)
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c
index 6f2449ab46a..89afb19c946 100644
--- a/drivers/media/video/tda8290.c
+++ b/drivers/media/video/tda8290.c
@@ -172,7 +172,7 @@ static void tda8290_set_params(struct dvb_frontend *fe,
172 set_audio(fe, params); 172 set_audio(fe, params);
173 173
174 if (priv->cfg.config) 174 if (priv->cfg.config)
175 tuner_dbg("tda827xa config is 0x%02x\n", *priv->cfg.config); 175 tuner_dbg("tda827xa config is 0x%02x\n", priv->cfg.config);
176 tuner_i2c_xfer_send(&priv->i2c_props, easy_mode, 2); 176 tuner_i2c_xfer_send(&priv->i2c_props, easy_mode, 2);
177 tuner_i2c_xfer_send(&priv->i2c_props, agc_out_on, 2); 177 tuner_i2c_xfer_send(&priv->i2c_props, agc_out_on, 2);
178 tuner_i2c_xfer_send(&priv->i2c_props, soft_reset, 2); 178 tuner_i2c_xfer_send(&priv->i2c_props, soft_reset, 2);
@@ -442,8 +442,7 @@ static void tda8290_init_if(struct dvb_frontend *fe)
442 unsigned char set_GP00_CF[] = { 0x20, 0x01 }; 442 unsigned char set_GP00_CF[] = { 0x20, 0x01 };
443 unsigned char set_GP01_CF[] = { 0x20, 0x0B }; 443 unsigned char set_GP01_CF[] = { 0x20, 0x0B };
444 444
445 if ((priv->cfg.config) && 445 if ((priv->cfg.config == 1) || (priv->cfg.config == 2))
446 ((*priv->cfg.config == 1) || (*priv->cfg.config == 2)))
447 tuner_i2c_xfer_send(&priv->i2c_props, set_GP00_CF, 2); 446 tuner_i2c_xfer_send(&priv->i2c_props, set_GP00_CF, 2);
448 else 447 else
449 tuner_i2c_xfer_send(&priv->i2c_props, set_GP01_CF, 2); 448 tuner_i2c_xfer_send(&priv->i2c_props, set_GP01_CF, 2);
@@ -588,8 +587,8 @@ static int tda829x_find_tuner(struct dvb_frontend *fe)
588 else 587 else
589 priv->ver |= TDA8275A; 588 priv->ver |= TDA8275A;
590 589
591 tda827x_attach(fe, priv->tda827x_addr, 590 tda827x_attach(fe, priv->tda827x_addr, priv->i2c_props.adap, &priv->cfg);
592 priv->i2c_props.adap, &priv->cfg); 591 priv->cfg.switch_addr = priv->i2c_props.addr;
593 } 592 }
594 if (fe->ops.tuner_ops.init) 593 if (fe->ops.tuner_ops.init)
595 fe->ops.tuner_ops.init(fe); 594 fe->ops.tuner_ops.init(fe);
diff --git a/drivers/media/video/tda8290.h b/drivers/media/video/tda8290.h
index dc8ef310b7b..9dd8b73eb8c 100644
--- a/drivers/media/video/tda8290.h
+++ b/drivers/media/video/tda8290.h
@@ -21,7 +21,7 @@
21#include "dvb_frontend.h" 21#include "dvb_frontend.h"
22 22
23struct tda829x_config { 23struct tda829x_config {
24 unsigned int *lna_cfg; 24 unsigned int lna_cfg;
25 int (*tuner_callback) (void *dev, int command, int arg); 25 int (*tuner_callback) (void *dev, int command, int arg);
26 26
27 unsigned int probe_tuner:1; 27 unsigned int probe_tuner:1;
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 335a971298a..4b936b809d7 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -320,7 +320,7 @@ static void tuner_i2c_address_check(struct tuner *t)
320static void attach_tda829x(struct tuner *t) 320static void attach_tda829x(struct tuner *t)
321{ 321{
322 struct tda829x_config cfg = { 322 struct tda829x_config cfg = {
323 .lna_cfg = &t->config, 323 .lna_cfg = t->config,
324 .tuner_callback = t->tuner_callback, 324 .tuner_callback = t->tuner_callback,
325 }; 325 };
326 tda829x_attach(&t->fe, t->i2c->adapter, t->i2c->addr, &cfg); 326 tda829x_attach(&t->fe, t->i2c->adapter, t->i2c->addr, &cfg);