diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-08-10 01:49:08 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-18 23:19:24 -0400 |
commit | 53dacb15705901e14b03dcba27e40364fedd9d09 (patch) | |
tree | ca3b4111465aca9d58024ace0f0072ee7952c11e /drivers/media/video/em28xx | |
parent | 0da2808ca27ab7f65346d4d191569c669db8f628 (diff) |
V4L/DVB (12540): v4l: simplify v4l2_i2c_new_subdev and friends
Rewrite v4l2_i2c_new_subdev as a simplified version of v4l2_i2c_new_subdev_cfg
and remove v4l2_i2c_new_probed_subdev and v4l2_i2c_new_probed_subdev_addr.
This simplifies this API substantially.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-cards.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index 8a5ce818170a..bdb249bd9d5d 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -2372,55 +2372,55 @@ void em28xx_card_setup(struct em28xx *dev) | |||
2372 | 2372 | ||
2373 | /* request some modules */ | 2373 | /* request some modules */ |
2374 | if (dev->board.has_msp34xx) | 2374 | if (dev->board.has_msp34xx) |
2375 | v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 2375 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
2376 | "msp3400", "msp3400", msp3400_addrs); | 2376 | "msp3400", "msp3400", 0, msp3400_addrs); |
2377 | 2377 | ||
2378 | if (dev->board.decoder == EM28XX_SAA711X) | 2378 | if (dev->board.decoder == EM28XX_SAA711X) |
2379 | v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 2379 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
2380 | "saa7115", "saa7115_auto", saa711x_addrs); | 2380 | "saa7115", "saa7115_auto", 0, saa711x_addrs); |
2381 | 2381 | ||
2382 | if (dev->board.decoder == EM28XX_TVP5150) | 2382 | if (dev->board.decoder == EM28XX_TVP5150) |
2383 | v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 2383 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
2384 | "tvp5150", "tvp5150", tvp5150_addrs); | 2384 | "tvp5150", "tvp5150", 0, tvp5150_addrs); |
2385 | 2385 | ||
2386 | if (dev->em28xx_sensor == EM28XX_MT9V011) { | 2386 | if (dev->em28xx_sensor == EM28XX_MT9V011) { |
2387 | struct v4l2_subdev *sd; | 2387 | struct v4l2_subdev *sd; |
2388 | 2388 | ||
2389 | sd = v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, | 2389 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, |
2390 | &dev->i2c_adap, "mt9v011", "mt9v011", mt9v011_addrs); | 2390 | &dev->i2c_adap, "mt9v011", "mt9v011", 0, mt9v011_addrs); |
2391 | v4l2_subdev_call(sd, core, s_config, 0, &dev->sensor_xtal); | 2391 | v4l2_subdev_call(sd, core, s_config, 0, &dev->sensor_xtal); |
2392 | } | 2392 | } |
2393 | 2393 | ||
2394 | 2394 | ||
2395 | if (dev->board.adecoder == EM28XX_TVAUDIO) | 2395 | if (dev->board.adecoder == EM28XX_TVAUDIO) |
2396 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 2396 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
2397 | "tvaudio", "tvaudio", dev->board.tvaudio_addr); | 2397 | "tvaudio", "tvaudio", dev->board.tvaudio_addr, NULL); |
2398 | 2398 | ||
2399 | if (dev->board.tuner_type != TUNER_ABSENT) { | 2399 | if (dev->board.tuner_type != TUNER_ABSENT) { |
2400 | int has_demod = (dev->tda9887_conf & TDA9887_PRESENT); | 2400 | int has_demod = (dev->tda9887_conf & TDA9887_PRESENT); |
2401 | 2401 | ||
2402 | if (dev->board.radio.type) | 2402 | if (dev->board.radio.type) |
2403 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 2403 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
2404 | "tuner", "tuner", dev->board.radio_addr); | 2404 | "tuner", "tuner", dev->board.radio_addr, NULL); |
2405 | 2405 | ||
2406 | if (has_demod) | 2406 | if (has_demod) |
2407 | v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, | 2407 | v4l2_i2c_new_subdev(&dev->v4l2_dev, |
2408 | &dev->i2c_adap, "tuner", "tuner", | 2408 | &dev->i2c_adap, "tuner", "tuner", |
2409 | v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); | 2409 | 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); |
2410 | if (dev->tuner_addr == 0) { | 2410 | if (dev->tuner_addr == 0) { |
2411 | enum v4l2_i2c_tuner_type type = | 2411 | enum v4l2_i2c_tuner_type type = |
2412 | has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV; | 2412 | has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV; |
2413 | struct v4l2_subdev *sd; | 2413 | struct v4l2_subdev *sd; |
2414 | 2414 | ||
2415 | sd = v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, | 2415 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, |
2416 | &dev->i2c_adap, "tuner", "tuner", | 2416 | &dev->i2c_adap, "tuner", "tuner", |
2417 | v4l2_i2c_tuner_addrs(type)); | 2417 | 0, v4l2_i2c_tuner_addrs(type)); |
2418 | 2418 | ||
2419 | if (sd) | 2419 | if (sd) |
2420 | dev->tuner_addr = v4l2_i2c_subdev_addr(sd); | 2420 | dev->tuner_addr = v4l2_i2c_subdev_addr(sd); |
2421 | } else { | 2421 | } else { |
2422 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 2422 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
2423 | "tuner", "tuner", dev->tuner_addr); | 2423 | "tuner", "tuner", dev->tuner_addr, NULL); |
2424 | } | 2424 | } |
2425 | } | 2425 | } |
2426 | 2426 | ||