diff options
author | Stefan Ringel <stefan.ringel@arcor.de> | 2010-11-09 11:50:28 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-12-29 05:16:44 -0500 |
commit | c1937f8e3490fedec2c75383df07cd8a7154c545 (patch) | |
tree | e7498d5734d2b0d8b55013dd9225a1d8aceb2e7c /drivers | |
parent | 101b25b55ec48354bc40b9102b4f7922c9ad9eae (diff) |
[media] tm6000: add revision check
adding chip revision check
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/tm6000/tm6000-cards.c | 7 | ||||
-rw-r--r-- | drivers/staging/tm6000/tm6000-core.c | 27 |
2 files changed, 20 insertions, 14 deletions
diff --git a/drivers/staging/tm6000/tm6000-cards.c b/drivers/staging/tm6000/tm6000-cards.c index b143258f094a..5a7946c6de50 100644 --- a/drivers/staging/tm6000/tm6000-cards.c +++ b/drivers/staging/tm6000/tm6000-cards.c | |||
@@ -521,13 +521,6 @@ int tm6000_cards_setup(struct tm6000_core *dev) | |||
521 | printk(KERN_ERR "Error %i doing tuner reset\n", rc); | 521 | printk(KERN_ERR "Error %i doing tuner reset\n", rc); |
522 | return rc; | 522 | return rc; |
523 | } | 523 | } |
524 | msleep(10); | ||
525 | |||
526 | if (!i) { | ||
527 | rc = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0); | ||
528 | if (rc >= 0) | ||
529 | printk(KERN_DEBUG "board=0x%08x\n", rc); | ||
530 | } | ||
531 | } | 524 | } |
532 | } else { | 525 | } else { |
533 | printk(KERN_ERR "Tuner reset is not configured\n"); | 526 | printk(KERN_ERR "Tuner reset is not configured\n"); |
diff --git a/drivers/staging/tm6000/tm6000-core.c b/drivers/staging/tm6000/tm6000-core.c index 40a0206e2432..8c897d79ce7a 100644 --- a/drivers/staging/tm6000/tm6000-core.c +++ b/drivers/staging/tm6000/tm6000-core.c | |||
@@ -542,6 +542,26 @@ int tm6000_init(struct tm6000_core *dev) | |||
542 | int board, rc = 0, i, size; | 542 | int board, rc = 0, i, size; |
543 | struct reg_init *tab; | 543 | struct reg_init *tab; |
544 | 544 | ||
545 | /* Check board revision */ | ||
546 | board = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0); | ||
547 | if (board >= 0) { | ||
548 | switch (board & 0xff) { | ||
549 | case 0xf3: | ||
550 | printk(KERN_INFO "Found tm6000\n"); | ||
551 | if (dev->dev_type != TM6000) | ||
552 | dev->dev_type = TM6000; | ||
553 | break; | ||
554 | case 0xf4: | ||
555 | printk(KERN_INFO "Found tm6010\n"); | ||
556 | if (dev->dev_type != TM6010) | ||
557 | dev->dev_type = TM6010; | ||
558 | break; | ||
559 | default: | ||
560 | printk(KERN_INFO "Unknown board version = 0x%08x\n", board); | ||
561 | } | ||
562 | } else | ||
563 | printk(KERN_ERR "Error %i while retrieving board version\n", board); | ||
564 | |||
545 | if (dev->dev_type == TM6010) { | 565 | if (dev->dev_type == TM6010) { |
546 | tab = tm6010_init_tab; | 566 | tab = tm6010_init_tab; |
547 | size = ARRAY_SIZE(tm6010_init_tab); | 567 | size = ARRAY_SIZE(tm6010_init_tab); |
@@ -563,13 +583,6 @@ int tm6000_init(struct tm6000_core *dev) | |||
563 | 583 | ||
564 | msleep(5); /* Just to be conservative */ | 584 | msleep(5); /* Just to be conservative */ |
565 | 585 | ||
566 | /* Check board version - maybe 10Moons specific */ | ||
567 | board = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0); | ||
568 | if (board >= 0) | ||
569 | printk(KERN_INFO "Board version = 0x%08x\n", board); | ||
570 | else | ||
571 | printk(KERN_ERR "Error %i while retrieving board version\n", board); | ||
572 | |||
573 | rc = tm6000_cards_setup(dev); | 586 | rc = tm6000_cards_setup(dev); |
574 | 587 | ||
575 | return rc; | 588 | return rc; |