From patchwork Tue Nov 9 16:50:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Ringel X-Patchwork-Id: 311572 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA9Gp2ID015764 for ; Tue, 9 Nov 2010 16:51:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753301Ab0KIQui (ORCPT ); Tue, 9 Nov 2010 11:50:38 -0500 Received: from mail-in-01.arcor-online.net ([151.189.21.41]:55283 "EHLO mail-in-01.arcor-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752463Ab0KIQud (ORCPT ); Tue, 9 Nov 2010 11:50:33 -0500 Received: from mail-in-17-z2.arcor-online.net (mail-in-17-z2.arcor-online.net [151.189.8.34]) by mx.arcor.de (Postfix) with ESMTP id 403AE5A72B; Tue, 9 Nov 2010 17:50:32 +0100 (CET) Received: from mail-in-14.arcor-online.net (mail-in-14.arcor-online.net [151.189.21.54]) by mail-in-17-z2.arcor-online.net (Postfix) with ESMTP id 340D4366387; Tue, 9 Nov 2010 17:50:32 +0100 (CET) Received: from linux-rwzd.site (dslb-188-103-163-087.pools.arcor-ip.net [188.103.163.87]) (Authenticated sender: stefan.ringel@arcor.de) by mail-in-14.arcor-online.net (Postfix) with ESMTPA id AB3429D983; Tue, 9 Nov 2010 17:50:31 +0100 (CET) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-14.arcor-online.net AB3429D983 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arcor.de; s=mail-in; t=1289321432; bh=J9p/Zhf85EIQMJXUnc4rFaJGz5VU/xwH3F52BsH/9Wg=; h=From:To:Cc:Subject:Date:Message-Id; b=RtwS+XgHvfJFpdISSwHkGZ8Pq9PTjeIM444t7ZPhlVI9BlgVSoeeuOohGVq2OnVLB XlQe1h0O52YDxJmNCLwKv+yntdxg9UNn481tqlC1oWvKCimHq9Sr9K2A225Uxl57rl YjVRJFJU0ZA4GKEgsLgXA/xQnxar89EL4pnaGHCg= From: stefan.ringel@arcor.de To: linux-media@vger.kernel.org Cc: mchehab@redhat.com, Stefan Ringel Subject: [PATCH v2] tm6000: add revision check Date: Tue, 9 Nov 2010 17:50:28 +0100 Message-Id: <1289321428-6332-1-git-send-email-stefan.ringel@arcor.de> X-Mailer: git-send-email 1.7.2.2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 09 Nov 2010 16:51:03 +0000 (UTC) diff --git a/drivers/staging/tm6000/tm6000-cards.c b/drivers/staging/tm6000/tm6000-cards.c index 664e603..1c9374a 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) printk(KERN_ERR "Error %i doing tuner reset\n", rc); return rc; } - msleep(10); - - if (!i) { - rc = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0); - if (rc >= 0) - printk(KERN_DEBUG "board=0x%08x\n", rc); - } } } else { 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 df3f187..121dc46 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) int board, rc = 0, i, size; struct reg_init *tab; + /* Check board revision */ + board = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0); + if (board >= 0) { + switch (board & 0xff) { + case 0xf3: + printk(KERN_INFO "Found tm6000\n"); + if (dev->dev_type != TM6000) + dev->dev_type = TM6000; + break; + case 0xf4: + printk(KERN_INFO "Found tm6010\n"); + if (dev->dev_type != TM6010) + dev->dev_type = TM6010; + break; + default: + printk(KERN_INFO "Unknown board version = 0x%08x\n", board); + } + } else + printk(KERN_ERR "Error %i while retrieving board version\n", board); + if (dev->dev_type == TM6010) { tab = tm6010_init_tab; size = ARRAY_SIZE(tm6010_init_tab); @@ -563,13 +583,6 @@ int tm6000_init(struct tm6000_core *dev) msleep(5); /* Just to be conservative */ - /* Check board version - maybe 10Moons specific */ - board = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0); - if (board >= 0) - printk(KERN_INFO "Board version = 0x%08x\n", board); - else - printk(KERN_ERR "Error %i while retrieving board version\n", board); - rc = tm6000_cards_setup(dev); return rc;