diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-11-04 06:32:42 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:01:57 -0500 |
commit | d2ba055d3b7ca7694af38a735f00850363ee9417 (patch) | |
tree | 3e14d87aa824f397ba87db66c70b97c450338683 /drivers/media | |
parent | fad7b958e753e18ff443786360f7846da50a3085 (diff) |
V4L/DVB (6546): Add comments for the hint methods
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-cards.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index fd7a8a5fba66..e88bf6700e63 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -397,11 +397,13 @@ struct usb_device_id em28xx_id_table [] = { | |||
397 | }; | 397 | }; |
398 | MODULE_DEVICE_TABLE (usb, em28xx_id_table); | 398 | MODULE_DEVICE_TABLE (usb, em28xx_id_table); |
399 | 399 | ||
400 | static struct em28xx_hash_table em28xx_hash [] = { | 400 | /* EEPROM hash table for devices with generic USB IDs */ |
401 | static struct em28xx_hash_table em28xx_eeprom_hash [] = { | ||
401 | /* P/N: SA 60002070465 Tuner: TVF7533-MF */ | 402 | /* P/N: SA 60002070465 Tuner: TVF7533-MF */ |
402 | { 0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF }, | 403 | { 0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF }, |
403 | }; | 404 | }; |
404 | 405 | ||
406 | /* I2C devicelist hash table for devices with generic USB IDs */ | ||
405 | static struct em28xx_hash_table em28xx_i2c_hash[] = { | 407 | static struct em28xx_hash_table em28xx_i2c_hash[] = { |
406 | { 0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC }, | 408 | { 0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC }, |
407 | { 0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC }, | 409 | { 0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC }, |
@@ -484,10 +486,18 @@ static int em28xx_hint_board(struct em28xx *dev) | |||
484 | { | 486 | { |
485 | int i; | 487 | int i; |
486 | 488 | ||
487 | for (i = 0; i < ARRAY_SIZE(em28xx_hash); i++) { | 489 | /* HINT method: EEPROM |
488 | if (dev->hash == em28xx_hash[i].hash) { | 490 | * |
489 | dev->model = em28xx_hash[i].model; | 491 | * This method works only for boards with eeprom. |
490 | dev->tuner_type = em28xx_hash[i].tuner; | 492 | * Uses a hash of all eeprom bytes. The hash should be |
493 | * unique for a vendor/tuner pair. | ||
494 | * There are a high chance that tuners for different | ||
495 | * video standards produce different hashes. | ||
496 | */ | ||
497 | for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) { | ||
498 | if (dev->hash == em28xx_eeprom_hash[i].hash) { | ||
499 | dev->model = em28xx_eeprom_hash[i].model; | ||
500 | dev->tuner_type = em28xx_eeprom_hash[i].tuner; | ||
491 | 501 | ||
492 | em28xx_errdev("Your board has no unique USB ID.\n"); | 502 | em28xx_errdev("Your board has no unique USB ID.\n"); |
493 | em28xx_errdev("A hint were successfully done, " | 503 | em28xx_errdev("A hint were successfully done, " |
@@ -504,6 +514,15 @@ static int em28xx_hint_board(struct em28xx *dev) | |||
504 | } | 514 | } |
505 | } | 515 | } |
506 | 516 | ||
517 | /* HINT method: I2C attached devices | ||
518 | * | ||
519 | * This method works for all boards. | ||
520 | * Uses a hash of i2c scanned devices. | ||
521 | * Devices with the same i2c attached chips will | ||
522 | * be considered equal. | ||
523 | * This method is less precise than the eeprom one. | ||
524 | */ | ||
525 | |||
507 | /* user did not request i2c scanning => do it now */ | 526 | /* user did not request i2c scanning => do it now */ |
508 | if (!dev->i2c_hash) | 527 | if (!dev->i2c_hash) |
509 | em28xx_do_i2c_scan(dev); | 528 | em28xx_do_i2c_scan(dev); |