diff options
Diffstat (limited to 'drivers/media/video/bt8xx/bttv-cards.c')
-rw-r--r-- | drivers/media/video/bt8xx/bttv-cards.c | 70 |
1 files changed, 27 insertions, 43 deletions
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c index b9c3ba51fb8..fdb4adff3d2 100644 --- a/drivers/media/video/bt8xx/bttv-cards.c +++ b/drivers/media/video/bt8xx/bttv-cards.c | |||
@@ -3324,17 +3324,6 @@ void __devinit bttv_init_card1(struct bttv *btv) | |||
3324 | /* initialization part two -- after registering i2c bus */ | 3324 | /* initialization part two -- after registering i2c bus */ |
3325 | void __devinit bttv_init_card2(struct bttv *btv) | 3325 | void __devinit bttv_init_card2(struct bttv *btv) |
3326 | { | 3326 | { |
3327 | static const unsigned short tvaudio_addrs[] = { | ||
3328 | I2C_ADDR_TDA8425 >> 1, | ||
3329 | I2C_ADDR_TEA6300 >> 1, | ||
3330 | I2C_ADDR_TEA6420 >> 1, | ||
3331 | I2C_ADDR_TDA9840 >> 1, | ||
3332 | I2C_ADDR_TDA985x_L >> 1, | ||
3333 | I2C_ADDR_TDA985x_H >> 1, | ||
3334 | I2C_ADDR_TDA9874 >> 1, | ||
3335 | I2C_ADDR_PIC16C54 >> 1, | ||
3336 | I2C_CLIENT_END | ||
3337 | }; | ||
3338 | int addr=ADDR_UNSET; | 3327 | int addr=ADDR_UNSET; |
3339 | 3328 | ||
3340 | btv->tuner_type = UNSET; | 3329 | btv->tuner_type = UNSET; |
@@ -3512,12 +3501,15 @@ void __devinit bttv_init_card2(struct bttv *btv) | |||
3512 | 3501 | ||
3513 | /* Load tuner module before issuing tuner config call! */ | 3502 | /* Load tuner module before issuing tuner config call! */ |
3514 | if (bttv_tvcards[btv->c.type].has_radio) | 3503 | if (bttv_tvcards[btv->c.type].has_radio) |
3515 | v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, | 3504 | v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev, |
3516 | "tuner", "tuner", v4l2_i2c_tuner_addrs(ADDRS_RADIO)); | 3505 | &btv->c.i2c_adap, "tuner", "tuner", |
3517 | v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, "tuner", | 3506 | v4l2_i2c_tuner_addrs(ADDRS_RADIO)); |
3518 | "tuner", v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); | 3507 | v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev, |
3519 | v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, "tuner", | 3508 | &btv->c.i2c_adap, "tuner", "tuner", |
3520 | "tuner", v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD)); | 3509 | v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); |
3510 | v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev, | ||
3511 | &btv->c.i2c_adap, "tuner", "tuner", | ||
3512 | v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD)); | ||
3521 | 3513 | ||
3522 | tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV; | 3514 | tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV; |
3523 | tun_setup.type = btv->tuner_type; | 3515 | tun_setup.type = btv->tuner_type; |
@@ -3570,8 +3562,8 @@ void __devinit bttv_init_card2(struct bttv *btv) | |||
3570 | }; | 3562 | }; |
3571 | struct v4l2_subdev *sd; | 3563 | struct v4l2_subdev *sd; |
3572 | 3564 | ||
3573 | sd = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, | 3565 | sd = v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev, |
3574 | "saa6588", "saa6588", addrs); | 3566 | &btv->c.i2c_adap, "saa6588", "saa6588", addrs); |
3575 | btv->has_saa6588 = (sd != NULL); | 3567 | btv->has_saa6588 = (sd != NULL); |
3576 | } | 3568 | } |
3577 | 3569 | ||
@@ -3595,8 +3587,8 @@ void __devinit bttv_init_card2(struct bttv *btv) | |||
3595 | I2C_CLIENT_END | 3587 | I2C_CLIENT_END |
3596 | }; | 3588 | }; |
3597 | 3589 | ||
3598 | btv->sd_msp34xx = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, | 3590 | btv->sd_msp34xx = v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev, |
3599 | "msp3400", "msp3400", addrs); | 3591 | &btv->c.i2c_adap, "msp3400", "msp3400", addrs); |
3600 | if (btv->sd_msp34xx) | 3592 | if (btv->sd_msp34xx) |
3601 | return; | 3593 | return; |
3602 | goto no_audio; | 3594 | goto no_audio; |
@@ -3609,16 +3601,16 @@ void __devinit bttv_init_card2(struct bttv *btv) | |||
3609 | I2C_CLIENT_END | 3601 | I2C_CLIENT_END |
3610 | }; | 3602 | }; |
3611 | 3603 | ||
3612 | if (v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, | 3604 | if (v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev, |
3613 | "tda7432", "tda7432", addrs)) | 3605 | &btv->c.i2c_adap, "tda7432", "tda7432", addrs)) |
3614 | return; | 3606 | return; |
3615 | goto no_audio; | 3607 | goto no_audio; |
3616 | } | 3608 | } |
3617 | 3609 | ||
3618 | case 3: { | 3610 | case 3: { |
3619 | /* The user specified that we should probe for tvaudio */ | 3611 | /* The user specified that we should probe for tvaudio */ |
3620 | btv->sd_tvaudio = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, | 3612 | btv->sd_tvaudio = v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev, |
3621 | "tvaudio", "tvaudio", tvaudio_addrs); | 3613 | &btv->c.i2c_adap, "tvaudio", "tvaudio", tvaudio_addrs()); |
3622 | if (btv->sd_tvaudio) | 3614 | if (btv->sd_tvaudio) |
3623 | return; | 3615 | return; |
3624 | goto no_audio; | 3616 | goto no_audio; |
@@ -3637,21 +3629,13 @@ void __devinit bttv_init_card2(struct bttv *btv) | |||
3637 | it really is a msp3400, so it will return NULL when the device | 3629 | it really is a msp3400, so it will return NULL when the device |
3638 | found is really something else (e.g. a tea6300). */ | 3630 | found is really something else (e.g. a tea6300). */ |
3639 | if (!bttv_tvcards[btv->c.type].no_msp34xx) { | 3631 | if (!bttv_tvcards[btv->c.type].no_msp34xx) { |
3640 | static const unsigned short addrs[] = { | 3632 | btv->sd_msp34xx = v4l2_i2c_new_probed_subdev_addr(&btv->c.v4l2_dev, |
3641 | I2C_ADDR_MSP3400 >> 1, | 3633 | &btv->c.i2c_adap, "msp3400", "msp3400", |
3642 | I2C_CLIENT_END | 3634 | I2C_ADDR_MSP3400 >> 1); |
3643 | }; | ||
3644 | |||
3645 | btv->sd_msp34xx = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, | ||
3646 | "msp3400", "msp3400", addrs); | ||
3647 | } else if (bttv_tvcards[btv->c.type].msp34xx_alt) { | 3635 | } else if (bttv_tvcards[btv->c.type].msp34xx_alt) { |
3648 | static const unsigned short addrs[] = { | 3636 | btv->sd_msp34xx = v4l2_i2c_new_probed_subdev_addr(&btv->c.v4l2_dev, |
3649 | I2C_ADDR_MSP3400_ALT >> 1, | 3637 | &btv->c.i2c_adap, "msp3400", "msp3400", |
3650 | I2C_CLIENT_END | 3638 | I2C_ADDR_MSP3400_ALT >> 1); |
3651 | }; | ||
3652 | |||
3653 | btv->sd_msp34xx = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, | ||
3654 | "msp3400", "msp3400", addrs); | ||
3655 | } | 3639 | } |
3656 | 3640 | ||
3657 | /* If we found a msp34xx, then we're done. */ | 3641 | /* If we found a msp34xx, then we're done. */ |
@@ -3665,14 +3649,14 @@ void __devinit bttv_init_card2(struct bttv *btv) | |||
3665 | I2C_CLIENT_END | 3649 | I2C_CLIENT_END |
3666 | }; | 3650 | }; |
3667 | 3651 | ||
3668 | if (v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, | 3652 | if (v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev, |
3669 | "tda7432", "tda7432", addrs)) | 3653 | &btv->c.i2c_adap, "tda7432", "tda7432", addrs)) |
3670 | return; | 3654 | return; |
3671 | } | 3655 | } |
3672 | 3656 | ||
3673 | /* Now see if we can find one of the tvaudio devices. */ | 3657 | /* Now see if we can find one of the tvaudio devices. */ |
3674 | btv->sd_tvaudio = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, | 3658 | btv->sd_tvaudio = v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev, |
3675 | "tvaudio", "tvaudio", tvaudio_addrs); | 3659 | &btv->c.i2c_adap, "tvaudio", "tvaudio", tvaudio_addrs()); |
3676 | if (btv->sd_tvaudio) | 3660 | if (btv->sd_tvaudio) |
3677 | return; | 3661 | return; |
3678 | 3662 | ||