diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-04-01 02:57:53 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-06 20:44:24 -0400 |
commit | e6574f2fbecdb8af807169d345c10131ae060a88 (patch) | |
tree | 9923d1065397b9796a476cac238bacbdf1d820d1 /drivers/media/video/em28xx/em28xx-cards.c | |
parent | 868f985c2fb85b5f32785bb55a349d180a30f3d3 (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/em28xx/em28xx-cards.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-cards.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index e7fc2d5b129e..7c70738479dd 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -1958,44 +1958,46 @@ void em28xx_card_setup(struct em28xx *dev) | |||
1958 | 1958 | ||
1959 | /* request some modules */ | 1959 | /* request some modules */ |
1960 | if (dev->board.has_msp34xx) | 1960 | if (dev->board.has_msp34xx) |
1961 | v4l2_i2c_new_probed_subdev(&dev->i2c_adap, "msp3400", | 1961 | v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
1962 | "msp3400", msp3400_addrs); | 1962 | "msp3400", "msp3400", msp3400_addrs); |
1963 | 1963 | ||
1964 | if (dev->board.decoder == EM28XX_SAA711X) | 1964 | if (dev->board.decoder == EM28XX_SAA711X) |
1965 | v4l2_i2c_new_probed_subdev(&dev->i2c_adap, "saa7115", | 1965 | v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
1966 | "saa7115_auto", saa711x_addrs); | 1966 | "saa7115", "saa7115_auto", saa711x_addrs); |
1967 | 1967 | ||
1968 | if (dev->board.decoder == EM28XX_TVP5150) | 1968 | if (dev->board.decoder == EM28XX_TVP5150) |
1969 | v4l2_i2c_new_probed_subdev(&dev->i2c_adap, "tvp5150", | 1969 | v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
1970 | "tvp5150", tvp5150_addrs); | 1970 | "tvp5150", "tvp5150", tvp5150_addrs); |
1971 | 1971 | ||
1972 | if (dev->board.adecoder == EM28XX_TVAUDIO) | 1972 | if (dev->board.adecoder == EM28XX_TVAUDIO) |
1973 | v4l2_i2c_new_subdev(&dev->i2c_adap, "tvaudio", | 1973 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
1974 | "tvaudio", dev->board.tvaudio_addr); | 1974 | "tvaudio", "tvaudio", dev->board.tvaudio_addr); |
1975 | 1975 | ||
1976 | if (dev->board.tuner_type != TUNER_ABSENT) { | 1976 | if (dev->board.tuner_type != TUNER_ABSENT) { |
1977 | int has_demod = (dev->tda9887_conf & TDA9887_PRESENT); | 1977 | int has_demod = (dev->tda9887_conf & TDA9887_PRESENT); |
1978 | 1978 | ||
1979 | if (dev->board.radio.type) | 1979 | if (dev->board.radio.type) |
1980 | v4l2_i2c_new_subdev(&dev->i2c_adap, "tuner", "tuner", | 1980 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
1981 | dev->board.radio_addr); | 1981 | "tuner", "tuner", dev->board.radio_addr); |
1982 | 1982 | ||
1983 | if (has_demod) | 1983 | if (has_demod) |
1984 | v4l2_i2c_new_probed_subdev(&dev->i2c_adap, "tuner", | 1984 | v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, |
1985 | "tuner", v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); | 1985 | &dev->i2c_adap, "tuner", "tuner", |
1986 | v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); | ||
1986 | if (dev->tuner_addr == 0) { | 1987 | if (dev->tuner_addr == 0) { |
1987 | enum v4l2_i2c_tuner_type type = | 1988 | enum v4l2_i2c_tuner_type type = |
1988 | has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV; | 1989 | has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV; |
1989 | struct v4l2_subdev *sd; | 1990 | struct v4l2_subdev *sd; |
1990 | 1991 | ||
1991 | sd = v4l2_i2c_new_probed_subdev(&dev->i2c_adap, "tuner", | 1992 | sd = v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, |
1992 | "tuner", v4l2_i2c_tuner_addrs(type)); | 1993 | &dev->i2c_adap, "tuner", "tuner", |
1994 | v4l2_i2c_tuner_addrs(type)); | ||
1993 | 1995 | ||
1994 | if (sd) | 1996 | if (sd) |
1995 | dev->tuner_addr = v4l2_i2c_subdev_addr(sd); | 1997 | dev->tuner_addr = v4l2_i2c_subdev_addr(sd); |
1996 | } else { | 1998 | } else { |
1997 | v4l2_i2c_new_subdev(&dev->i2c_adap, "tuner", | 1999 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
1998 | "tuner", dev->tuner_addr); | 2000 | "tuner", "tuner", dev->tuner_addr); |
1999 | } | 2001 | } |
2000 | } | 2002 | } |
2001 | 2003 | ||