From patchwork Fri Apr 2 16:52:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Ringel X-Patchwork-Id: 90396 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o32GsMK5009116 for ; Fri, 2 Apr 2010 16:54:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754941Ab0DBQyK (ORCPT ); Fri, 2 Apr 2010 12:54:10 -0400 Received: from mail-in-05.arcor-online.net ([151.189.21.45]:54224 "EHLO mail-in-05.arcor-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754615Ab0DBQyG (ORCPT ); Fri, 2 Apr 2010 12:54:06 -0400 Received: from mail-in-14-z2.arcor-online.net (mail-in-14-z2.arcor-online.net [151.189.8.31]) by mx.arcor.de (Postfix) with ESMTP id CA40A3326FF; Fri, 2 Apr 2010 18:54:04 +0200 (CEST) Received: from mail-in-11.arcor-online.net (mail-in-11.arcor-online.net [151.189.21.51]) by mail-in-14-z2.arcor-online.net (Postfix) with ESMTP id 8D2D410153; Fri, 2 Apr 2010 18:54:04 +0200 (CEST) Received: from localhost.localdomain (dslb-188-103-199-168.pools.arcor-ip.net [188.103.199.168]) (Authenticated sender: stefan.ringel@arcor.de) by mail-in-11.arcor-online.net (Postfix) with ESMTPA id C2AB7E3C47; Fri, 2 Apr 2010 18:54:03 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-11.arcor-online.net C2AB7E3C47 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arcor.de; s=mail-in; t=1270227244; bh=qYIkdErwY5i3+WFqx7yZoibuCZ8ukz7dPwYuEIfyS6g=; h=From:To:Cc:Subject:Date:Message-Id; b=brTrPd0v8QTF4FDRefgQnoEwI3BQMQUk85/NFGekK8l0oRsbvkJpLsuoxOojkTukT lbc6Sdlkp+yv3mjZfEq1lW/caEGuRF7iQSSmY7BbRTx/TJmAPtrReTc1qJJc4h6P+v VclREJzTUKptqugLiXSvp/9j3qKEdYaIMDqWrQ7o= From: stefan.ringel@arcor.de To: linux-media@vger.kernel.org Cc: mchehab@redhat.com, dheitmueller@kernellabs.com, Stefan Ringel Subject: [PATCH 1/2] tm6000: request labeling board version check Date: Fri, 2 Apr 2010 18:52:49 +0200 Message-Id: <1270227170-4879-1-git-send-email-stefan.ringel@arcor.de> X-Mailer: git-send-email 1.6.6.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 (demeter.kernel.org [140.211.167.41]); Fri, 02 Apr 2010 16:54:38 +0000 (UTC) diff --git a/drivers/staging/tm6000/tm6000-cards.c b/drivers/staging/tm6000/tm6000-cards.c index 2f0274d..f795a3e 100644 --- a/drivers/staging/tm6000/tm6000-cards.c +++ b/drivers/staging/tm6000/tm6000-cards.c @@ -480,9 +480,9 @@ int tm6000_cards_setup(struct tm6000_core *dev) } if (!i) { - rc = tm6000_get_reg16(dev, 0x40, 0, 0); + rc = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0); if (rc >= 0) - printk(KERN_DEBUG "board=%d\n", rc); + printk(KERN_DEBUG "board=0x%08x\n", rc); } } diff --git a/drivers/staging/tm6000/tm6000-core.c b/drivers/staging/tm6000/tm6000-core.c index d9cade0..0b4dc64 100644 --- a/drivers/staging/tm6000/tm6000-core.c +++ b/drivers/staging/tm6000/tm6000-core.c @@ -139,6 +139,20 @@ int tm6000_get_reg16 (struct tm6000_core *dev, u8 req, u16 value, u16 index) return buf[1]|buf[0]<<8; } +int tm6000_get_reg32 (struct tm6000_core *dev, u8 req, u16 value, u16 index) +{ + int rc; + u8 buf[4]; + + rc=tm6000_read_write_usb (dev, USB_DIR_IN | USB_TYPE_VENDOR, req, + value, index, buf, 4); + + if (rc<0) + return rc; + + return buf[3] | buf[2] << 8 | buf[1] << 16 | buf[0] << 24; +} + void tm6000_set_fourcc_format(struct tm6000_core *dev) { if (dev->dev_type == TM6010) { @@ -455,9 +469,9 @@ int tm6000_init (struct tm6000_core *dev) msleep(5); /* Just to be conservative */ /* Check board version - maybe 10Moons specific */ - board=tm6000_get_reg16 (dev, 0x40, 0, 0); + board=tm6000_get_reg32 (dev, REQ_40_GET_VERSION, 0, 0); if (board >=0) { - printk (KERN_INFO "Board version = 0x%04x\n",board); + printk (KERN_INFO "Board version = 0x%08x\n",board); } else { printk (KERN_ERR "Error %i while retrieving board version\n",board); } diff --git a/drivers/staging/tm6000/tm6000.h b/drivers/staging/tm6000/tm6000.h index 172f7d7..d9d076b 100644 --- a/drivers/staging/tm6000/tm6000.h +++ b/drivers/staging/tm6000/tm6000.h @@ -224,6 +224,7 @@ int tm6000_read_write_usb (struct tm6000_core *dev, u8 reqtype, u8 req, u16 value, u16 index, u8 *buf, u16 len); int tm6000_get_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index); int tm6000_get_reg16(struct tm6000_core *dev, u8 req, u16 value, u16 index); +int tm6000_get_reg32(struct tm6000_core *dev, u8 req, u16 value, u16 index); int tm6000_set_reg (struct tm6000_core *dev, u8 req, u16 value, u16 index); int tm6000_init (struct tm6000_core *dev);