aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-04-01 02:57:53 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-04-06 20:44:24 -0400
commite6574f2fbecdb8af807169d345c10131ae060a88 (patch)
tree9923d1065397b9796a476cac238bacbdf1d820d1 /drivers/media/video/bt8xx
parent868f985c2fb85b5f32785bb55a349d180a30f3d3 (diff)
V4L/DVB (11373): v4l2-common: add explicit v4l2_device pointer as first arg to new_(probed)_subdev
The functions v4l2_i2c_new_subdev and v4l2_i2c_new_probed_subdev relied on i2c_get_adapdata to return the v4l2_device. However, this is not always possible on embedded platforms. So modify the API to pass the v4l2_device pointer explicitly. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/bt8xx')
-rw-r--r--drivers/media/video/bt8xx/bttv-cards.c47
1 files changed, 25 insertions, 22 deletions
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index b9c3ba51fb86..ced777084ca0 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -3512,12 +3512,15 @@ void __devinit bttv_init_card2(struct bttv *btv)
3512 3512
3513 /* Load tuner module before issuing tuner config call! */ 3513 /* Load tuner module before issuing tuner config call! */
3514 if (bttv_tvcards[btv->c.type].has_radio) 3514 if (bttv_tvcards[btv->c.type].has_radio)
3515 v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, 3515 v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3516 "tuner", "tuner", v4l2_i2c_tuner_addrs(ADDRS_RADIO)); 3516 &btv->c.i2c_adap, "tuner", "tuner",
3517 v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, "tuner", 3517 v4l2_i2c_tuner_addrs(ADDRS_RADIO));
3518 "tuner", v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); 3518 v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3519 v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, "tuner", 3519 &btv->c.i2c_adap, "tuner", "tuner",
3520 "tuner", v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD)); 3520 v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
3521 v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3522 &btv->c.i2c_adap, "tuner", "tuner",
3523 v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD));
3521 3524
3522 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV; 3525 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
3523 tun_setup.type = btv->tuner_type; 3526 tun_setup.type = btv->tuner_type;
@@ -3570,8 +3573,8 @@ void __devinit bttv_init_card2(struct bttv *btv)
3570 }; 3573 };
3571 struct v4l2_subdev *sd; 3574 struct v4l2_subdev *sd;
3572 3575
3573 sd = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, 3576 sd = v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3574 "saa6588", "saa6588", addrs); 3577 &btv->c.i2c_adap, "saa6588", "saa6588", addrs);
3575 btv->has_saa6588 = (sd != NULL); 3578 btv->has_saa6588 = (sd != NULL);
3576 } 3579 }
3577 3580
@@ -3595,8 +3598,8 @@ void __devinit bttv_init_card2(struct bttv *btv)
3595 I2C_CLIENT_END 3598 I2C_CLIENT_END
3596 }; 3599 };
3597 3600
3598 btv->sd_msp34xx = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, 3601 btv->sd_msp34xx = v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3599 "msp3400", "msp3400", addrs); 3602 &btv->c.i2c_adap, "msp3400", "msp3400", addrs);
3600 if (btv->sd_msp34xx) 3603 if (btv->sd_msp34xx)
3601 return; 3604 return;
3602 goto no_audio; 3605 goto no_audio;
@@ -3609,16 +3612,16 @@ void __devinit bttv_init_card2(struct bttv *btv)
3609 I2C_CLIENT_END 3612 I2C_CLIENT_END
3610 }; 3613 };
3611 3614
3612 if (v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, 3615 if (v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3613 "tda7432", "tda7432", addrs)) 3616 &btv->c.i2c_adap, "tda7432", "tda7432", addrs))
3614 return; 3617 return;
3615 goto no_audio; 3618 goto no_audio;
3616 } 3619 }
3617 3620
3618 case 3: { 3621 case 3: {
3619 /* The user specified that we should probe for tvaudio */ 3622 /* The user specified that we should probe for tvaudio */
3620 btv->sd_tvaudio = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, 3623 btv->sd_tvaudio = v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3621 "tvaudio", "tvaudio", tvaudio_addrs); 3624 &btv->c.i2c_adap, "tvaudio", "tvaudio", tvaudio_addrs);
3622 if (btv->sd_tvaudio) 3625 if (btv->sd_tvaudio)
3623 return; 3626 return;
3624 goto no_audio; 3627 goto no_audio;
@@ -3642,16 +3645,16 @@ void __devinit bttv_init_card2(struct bttv *btv)
3642 I2C_CLIENT_END 3645 I2C_CLIENT_END
3643 }; 3646 };
3644 3647
3645 btv->sd_msp34xx = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, 3648 btv->sd_msp34xx = v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3646 "msp3400", "msp3400", addrs); 3649 &btv->c.i2c_adap, "msp3400", "msp3400", addrs);
3647 } else if (bttv_tvcards[btv->c.type].msp34xx_alt) { 3650 } else if (bttv_tvcards[btv->c.type].msp34xx_alt) {
3648 static const unsigned short addrs[] = { 3651 static const unsigned short addrs[] = {
3649 I2C_ADDR_MSP3400_ALT >> 1, 3652 I2C_ADDR_MSP3400_ALT >> 1,
3650 I2C_CLIENT_END 3653 I2C_CLIENT_END
3651 }; 3654 };
3652 3655
3653 btv->sd_msp34xx = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, 3656 btv->sd_msp34xx = v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3654 "msp3400", "msp3400", addrs); 3657 &btv->c.i2c_adap, "msp3400", "msp3400", addrs);
3655 } 3658 }
3656 3659
3657 /* If we found a msp34xx, then we're done. */ 3660 /* If we found a msp34xx, then we're done. */
@@ -3665,14 +3668,14 @@ void __devinit bttv_init_card2(struct bttv *btv)
3665 I2C_CLIENT_END 3668 I2C_CLIENT_END
3666 }; 3669 };
3667 3670
3668 if (v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, 3671 if (v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3669 "tda7432", "tda7432", addrs)) 3672 &btv->c.i2c_adap, "tda7432", "tda7432", addrs))
3670 return; 3673 return;
3671 } 3674 }
3672 3675
3673 /* Now see if we can find one of the tvaudio devices. */ 3676 /* Now see if we can find one of the tvaudio devices. */
3674 btv->sd_tvaudio = v4l2_i2c_new_probed_subdev(&btv->c.i2c_adap, 3677 btv->sd_tvaudio = v4l2_i2c_new_probed_subdev(&btv->c.v4l2_dev,
3675 "tvaudio", "tvaudio", tvaudio_addrs); 3678 &btv->c.i2c_adap, "tvaudio", "tvaudio", tvaudio_addrs);
3676 if (btv->sd_tvaudio) 3679 if (btv->sd_tvaudio)
3677 return; 3680 return;
3678 3681