From patchwork Sat Nov 6 10:04:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Ringel X-Patchwork-Id: 305452 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 oA6A5EiD001921 for ; Sat, 6 Nov 2010 10:05:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755307Ab0KFKE7 (ORCPT ); Sat, 6 Nov 2010 06:04:59 -0400 Received: from mail-in-09.arcor-online.net ([151.189.21.49]:51786 "EHLO mail-in-09.arcor-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754253Ab0KFKE6 (ORCPT ); Sat, 6 Nov 2010 06:04:58 -0400 Received: from mail-in-11-z2.arcor-online.net (mail-in-11-z2.arcor-online.net [151.189.8.28]) by mx.arcor.de (Postfix) with ESMTP id 51A6219739C; Sat, 6 Nov 2010 11:04:56 +0100 (CET) Received: from mail-in-17.arcor-online.net (mail-in-17.arcor-online.net [151.189.21.57]) by mail-in-11-z2.arcor-online.net (Postfix) with ESMTP id 3C6391CBA9F; Sat, 6 Nov 2010 11:04:56 +0100 (CET) Received: from localhost (dslb-188-103-163-087.pools.arcor-ip.net [188.103.163.87]) (Authenticated sender: stefan.ringel@arcor.de) by mail-in-17.arcor-online.net (Postfix) with ESMTPA id EB49BCC439; Sat, 6 Nov 2010 11:04:55 +0100 (CET) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-17.arcor-online.net EB49BCC439 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arcor.de; s=mail-in; t=1289037896; bh=hx328hw4EnMHhpnkaBrzDCe81fHl8mtEmtG/g5DKXLo=; h=From:To:Cc:Subject:Date:Message-Id; b=ZKmAXgNDA8xpgTv+vtEv/dTTlXap3T7q2JcsBE5lzYslso/lKFyB77UOWzGhR82QU E28zZiQA5iIxmRgt/S7oM9UV3dDxRlfQfxykEi/oDmITYXJr0iO9d8v9zhL5q5y7+/ gkZRQinY+9ITBdYM7Ww2REkF0cHBtHR4D1LiSYiw= From: stefan.ringel@arcor.de To: linux-media@vger.kernel.org Cc: mchehab@redhat.com, root Subject: [PATCH] tm6000: add revision check Date: Sat, 6 Nov 2010 11:04:53 +0100 Message-Id: <1289037893-6907-1-git-send-email-stefan.ringel@arcor.de> X-Mailer: git-send-email 1.7.1 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]); Sat, 06 Nov 2010 10:05:14 +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..efefa6a 100644 --- a/drivers/staging/tm6000/tm6000-core.c +++ b/drivers/staging/tm6000/tm6000-core.c @@ -542,6 +542,25 @@ 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 +582,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;