From patchwork Fri Jun 25 08:22:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 108011 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5P8MJ3F031730 for ; Fri, 25 Jun 2010 08:22:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752844Ab0FYIWi (ORCPT ); Fri, 25 Jun 2010 04:22:38 -0400 Received: from mail-px0-f174.google.com ([209.85.212.174]:44354 "EHLO mail-px0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751750Ab0FYIWh (ORCPT ); Fri, 25 Jun 2010 04:22:37 -0400 Received: by mail-px0-f174.google.com with SMTP id 8so593923pxi.19 for ; Fri, 25 Jun 2010 01:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:subject:to:cc:date :message-id:in-reply-to:references:user-agent:mime-version :content-type:content-transfer-encoding; bh=DrIuY9PS/bfa+IayS05bYHBu0H6+LLI5d0n3cXWalb8=; b=iGvxSHCLp3diwbO++wiHZ6bVhNadQxYHtJoSb23H8d8xg5kCJsSOZ/7+YoVJE3bB0t 0lHLPm37sAtaPCyHO84AnMECuC2D91r6t/XCLaNk/2DY3lSN82dmvhJgJoqw7eVmW1cy E0guczFIodquYM9x3sZXiIB2mZlbyiiULel/k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:subject:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; b=RqG2lVp7J2ItjsUx2zZ8cG6Vp4+LW0j8SmAk88x0VNstZeymxMorN+2nBN9pKKIyN3 ptwfX+Cd15WS7CjSOElpxD46afePZrkuBPbhFq2rEmPSpkIVDEG2uAX6+k8tGLGEfvmG lF3Lh5zEeLughRgWs6tlXl+qCEEu0tcQELq+M= Received: by 10.142.9.15 with SMTP id 15mr368219wfi.235.1277454157632; Fri, 25 Jun 2010 01:22:37 -0700 (PDT) Received: from mailhub.coreip.homeip.net (c-24-6-153-206.hsd1.ca.comcast.net [24.6.153.206]) by mx.google.com with ESMTPS id n2sm174455wfl.1.2010.06.25.01.22.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 25 Jun 2010 01:22:37 -0700 (PDT) From: Dmitry Torokhov Subject: [PATCH 4/4] Input: ad7879 - use i2c_smbus_read_i2c_block_data() to lower overhead To: Mike Frysinger , Michael Hennerich Cc: linux-input@vger.kernel.org Date: Fri, 25 Jun 2010 01:22:34 -0700 Message-ID: <20100625082234.8617.98489.stgit@localhost.localdomain> In-Reply-To: <20100625081847.8617.31150.stgit@localhost.localdomain> References: <20100625081847.8617.31150.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@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, 25 Jun 2010 08:22:39 +0000 (UTC) diff --git a/drivers/input/touchscreen/ad7879-i2c.c b/drivers/input/touchscreen/ad7879-i2c.c index f75f753..79e3857 100644 --- a/drivers/input/touchscreen/ad7879-i2c.c +++ b/drivers/input/touchscreen/ad7879-i2c.c @@ -51,10 +51,13 @@ static int ad7879_i2c_read(struct device *dev, u8 reg) static int ad7879_i2c_multi_read(struct device *dev, u8 first_reg, u8 count, u16 *buf) { + struct i2c_client *client = to_i2c_client(dev); u8 idx; + i2c_smbus_read_i2c_block_data(client, first_reg, count * 2, (u8 *)buf); + for (idx = 0; idx < count; ++idx) - buf[idx] = ad7879_i2c_read(dev, first_reg + idx); + buf[idx] = swab16(buf[idx]); return 0; }