From patchwork Mon Feb 22 16:21:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Ringel X-Patchwork-Id: 81180 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 o1MGMWog003287 for ; Mon, 22 Feb 2010 16:22:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753934Ab0BVQWa (ORCPT ); Mon, 22 Feb 2010 11:22:30 -0500 Received: from mail-in-05.arcor-online.net ([151.189.21.45]:43494 "EHLO mail-in-05.arcor-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753857Ab0BVQWX (ORCPT ); Mon, 22 Feb 2010 11:22:23 -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 28121332751; Mon, 22 Feb 2010 17:22:22 +0100 (CET) Received: from mail-in-06.arcor-online.net (mail-in-06.arcor-online.net [151.189.21.46]) by mail-in-17-z2.arcor-online.net (Postfix) with ESMTP id 0F35145C94D; Mon, 22 Feb 2010 17:22:22 +0100 (CET) Received: from localhost.localdomain (dslb-188-103-172-103.pools.arcor-ip.net [188.103.172.103]) (Authenticated sender: stefan.ringel@arcor.de) by mail-in-06.arcor-online.net (Postfix) with ESMTPA id 9F2B539A92F; Mon, 22 Feb 2010 17:22:21 +0100 (CET) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-06.arcor-online.net 9F2B539A92F DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arcor.de; s=mail-in; t=1266855741; bh=+PHTAggjxRqRlDYrBGDtqSM3PGn+OOy53/XnKYBMzac=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=Nep+WUXDwh3ZlaOqDe7vXt45OHfFBBgaD8ahoIwa05lVpavvc6ZULvnT9BrRUec4T 70zPBdzhtA92ojMQYTv1GWNs4skWN+uH5TEGK7pbGFnTuYHAPEwjKFSwfwUiIg5zMc AmtRxrDLCKvw2JN/JYZGwUBNrsWsfAnkWFpxbNBM= From: stefan.ringel@arcor.de To: linux-media@vger.kernel.org Cc: mchehab@redhat.com, dheitmueller@kernellabs.com, Stefan Ringel Subject: [PATCH 2/3] tm6000: bugfix reading problems with demodulator zl10353 Date: Mon, 22 Feb 2010 17:21:32 +0100 Message-Id: <1266855693-5554-2-git-send-email-stefan.ringel@arcor.de> X-Mailer: git-send-email 1.6.6.1 In-Reply-To: <1266855693-5554-1-git-send-email-stefan.ringel@arcor.de> References: <1266855693-5554-1-git-send-email-stefan.ringel@arcor.de> 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]); Mon, 22 Feb 2010 16:22:32 +0000 (UTC) diff --git a/drivers/staging/tm6000/tm6000-i2c.c b/drivers/staging/tm6000/tm6000-i2c.c index 2222b39..89297b0 100644 --- a/drivers/staging/tm6000/tm6000-i2c.c +++ b/drivers/staging/tm6000/tm6000-i2c.c @@ -54,9 +54,20 @@ int tm6000_i2c_send_regs(struct tm6000_core *dev, unsigned char addr, __u8 reg, int tm6000_i2c_recv_regs(struct tm6000_core *dev, unsigned char addr, __u8 reg, char *buf, int len) { int rc; + u8 b[2]; + if ((dev->caps.has_zl10353) && (dev->demod_addr << 1 == addr) && (reg % 2 == 0)) { + reg -= 1; + len += 1; + + rc = tm6000_read_write_usb(dev, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, + REQ_16_SET_GET_I2C_WR1_RDN, addr | reg << 8, 0, b, len); + + *buf = b[1]; + } else { rc = tm6000_read_write_usb(dev, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, REQ_16_SET_GET_I2C_WR1_RDN, addr | reg << 8, 0, buf, len); + } return rc; }