aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-cards.c
diff options
context:
space:
mode:
authorSascha Sommer <saschasommer@freenet.de>2007-11-04 06:06:48 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:01:56 -0500
commitfad7b958e753e18ff443786360f7846da50a3085 (patch)
tree7bb5af47b1c5b43269826983a16d72dbf959ecea /drivers/media/video/em28xx/em28xx-cards.c
parentf1f32849d65ab1eacfedbabb624876ac06c1af9f (diff)
V4L/DVB (6545): em28xx: autodetect Cinergy 200 USB and VGear PocketTV
Adds autodetection support for the Cinergy200 USB and the VGear PocketTV. Whenever a usb device with generic empia em2800 usb ids is detected the device gets scanned for connected i2c devices. If the device list matches an em2800 device in the device list the model id gets changed accordingly. Signed-off-by: Sascha Sommer <saschasommer@freenet.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-cards.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index ae6634156e7..fd7a8a5fba6 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -402,6 +402,11 @@ static struct em28xx_hash_table em28xx_hash [] = {
402 { 0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF }, 402 { 0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF },
403}; 403};
404 404
405static struct em28xx_hash_table em28xx_i2c_hash[] = {
406 { 0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC },
407 { 0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC },
408};
409
405/* Since em28xx_pre_card_setup() requires a proper dev->model, 410/* Since em28xx_pre_card_setup() requires a proper dev->model,
406 * this won't work for boards with generic PCI IDs 411 * this won't work for boards with generic PCI IDs
407 */ 412 */
@@ -498,6 +503,30 @@ static int em28xx_hint_board(struct em28xx *dev)
498 return 0; 503 return 0;
499 } 504 }
500 } 505 }
506
507 /* user did not request i2c scanning => do it now */
508 if (!dev->i2c_hash)
509 em28xx_do_i2c_scan(dev);
510
511 for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) {
512 if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
513 dev->model = em28xx_i2c_hash[i].model;
514 dev->tuner_type = em28xx_i2c_hash[i].tuner;
515 em28xx_errdev("Your board has no unique USB ID.\n");
516 em28xx_errdev("A hint were successfully done, "
517 "based on i2c devicelist hash.\n");
518 em28xx_errdev("This method is not 100%% failproof.\n");
519 em28xx_errdev("If the board were missdetected, "
520 "please email this log to:\n");
521 em28xx_errdev("\tV4L Mailing List "
522 " <video4linux-list@redhat.com>\n");
523 em28xx_errdev("Board detected as %s\n",
524 em28xx_boards[dev->model].name);
525
526 return 0;
527 }
528 }
529
501 em28xx_errdev("Your board has no unique USB ID and thus need a " 530 em28xx_errdev("Your board has no unique USB ID and thus need a "
502 "hint to be detected.\n"); 531 "hint to be detected.\n");
503 em28xx_errdev("You may try to use card=<n> insmod option to " 532 em28xx_errdev("You may try to use card=<n> insmod option to "
@@ -505,6 +534,7 @@ static int em28xx_hint_board(struct em28xx *dev)
505 em28xx_errdev("Please send an email with this log to:\n"); 534 em28xx_errdev("Please send an email with this log to:\n");
506 em28xx_errdev("\tV4L Mailing List <video4linux-list@redhat.com>\n"); 535 em28xx_errdev("\tV4L Mailing List <video4linux-list@redhat.com>\n");
507 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash); 536 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash);
537 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash);
508 538
509 em28xx_errdev("Here is a list of valid choices for the card=<n>" 539 em28xx_errdev("Here is a list of valid choices for the card=<n>"
510 " insmod option:\n"); 540 " insmod option:\n");