aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-06-28 16:51:08 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-07-18 13:24:26 -0400
commitac7dc84584310a836d13236767d71545f5b695b3 (patch)
tree1bf10e72f0fdb8abdfb03e2f9d16fc5081b5a4a9 /drivers
parent27cb786f4ec5fe85e9e2deffa4d33eed2f588cb0 (diff)
V4L/DVB (5805): Bttv: Fix problems with probing for non-existent tuners
The bttv driver has code to detect if a tda9887 is present, that was previous used to auto-load the tda9887 driver. Now there is no tda9887 driver, so the code is pointless; it just figures out if it should load the driver and then does nothing. For cards that are defined as having no tuner, the init code would still do i2c probes for various tuner devices and auto-load the tuner module. That can be skipped for cards that don't need it. The code is made to understand that in addition to 'UNSET', 'TUNER_ABSENT' also means no tuner. The tuner into printk()s are also made nicer. Levels are added, INFO or WARNING, depending on the meaning. For cards with no tuner, or no tuner defined, a more informative message is printed. Card has no tuner, before patch: bttv0: tuner type=-1 or bttv0: tuner type=4 After patch: bttv0: tuner absent Card has a tuner, but the type isn't defined, before patch: bttv0: tuner type=-1 After patch: bttv0: tuner type unset [<- also warning now, as the tuner won't work right] Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/bt8xx/bttv-cards.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index 2d61ed6fb0b5..e6cdc9989e12 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -3370,10 +3370,9 @@ void __devinit bttv_init_card1(struct bttv *btv)
3370/* initialization part two -- after registering i2c bus */ 3370/* initialization part two -- after registering i2c bus */
3371void __devinit bttv_init_card2(struct bttv *btv) 3371void __devinit bttv_init_card2(struct bttv *btv)
3372{ 3372{
3373 int tda9887;
3374 int addr=ADDR_UNSET; 3373 int addr=ADDR_UNSET;
3375 3374
3376 btv->tuner_type = -1; 3375 btv->tuner_type = UNSET;
3377 3376
3378 if (BTTV_BOARD_UNKNOWN == btv->c.type) { 3377 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
3379 bttv_readee(btv,eeprom_data,0xa0); 3378 bttv_readee(btv,eeprom_data,0xa0);
@@ -3521,7 +3520,15 @@ void __devinit bttv_init_card2(struct bttv *btv)
3521 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type; 3520 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
3522 if (UNSET != tuner[btv->c.nr]) 3521 if (UNSET != tuner[btv->c.nr])
3523 btv->tuner_type = tuner[btv->c.nr]; 3522 btv->tuner_type = tuner[btv->c.nr];
3524 printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type); 3523
3524 if (btv->tuner_type == TUNER_ABSENT ||
3525 bttv_tvcards[btv->c.type].tuner == UNSET)
3526 printk(KERN_INFO "bttv%d: tuner absent\n", btv->c.nr);
3527 else if(btv->tuner_type == UNSET)
3528 printk(KERN_WARNING "bttv%d: tuner type unset\n", btv->c.nr);
3529 else
3530 printk(KERN_INFO "bttv%d: tuner type=%d\n", btv->c.nr,
3531 btv->tuner_type);
3525 3532
3526 if (btv->tuner_type != UNSET) { 3533 if (btv->tuner_type != UNSET) {
3527 struct tuner_setup tun_setup; 3534 struct tuner_setup tun_setup;
@@ -3563,6 +3570,9 @@ void __devinit bttv_init_card2(struct bttv *btv)
3563 if (!autoload) 3570 if (!autoload)
3564 return; 3571 return;
3565 3572
3573 if (bttv_tvcards[btv->c.type].tuner == UNSET)
3574 return; /* no tuner or related drivers to load */
3575
3566 /* try to detect audio/fader chips */ 3576 /* try to detect audio/fader chips */
3567 if (!bttv_tvcards[btv->c.type].no_msp34xx && 3577 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
3568 bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx") >=0) 3578 bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx") >=0)
@@ -3583,17 +3593,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
3583 if (bttv_tvcards[btv->c.type].needs_tvaudio) 3593 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3584 request_module("tvaudio"); 3594 request_module("tvaudio");
3585 3595
3586 /* tuner modules */ 3596 if (btv->tuner_type != UNSET && btv->tuner_type != TUNER_ABSENT)
3587 tda9887 = 0;
3588 if (btv->tda9887_conf)
3589 tda9887 = 1;
3590 if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb &&
3591 bttv_I2CRead(btv, I2C_ADDR_TDA9887, "TDA9887") >=0)
3592 tda9887 = 1;
3593 /* Hybrid DVB card, DOES have a tda9887 */
3594 if (btv->c.type == BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE)
3595 tda9887 = 1;
3596 if (btv->tuner_type != UNSET)
3597 request_module("tuner"); 3597 request_module("tuner");
3598} 3598}
3599 3599