From patchwork Tue Mar 9 15:00:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 84319 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 o29Ev9NG009586 for ; Tue, 9 Mar 2010 14:57:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752311Ab0CIO5n (ORCPT ); Tue, 9 Mar 2010 09:57:43 -0500 Received: from smtp.gentoo.org ([140.211.166.183]:49619 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752226Ab0CIO5m (ORCPT ); Tue, 9 Mar 2010 09:57:42 -0500 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id E7B891B4040; Tue, 9 Mar 2010 14:57:41 +0000 (UTC) From: Mike Frysinger To: linux-input@vger.kernel.org, Dmitry Torokhov Cc: uclinux-dist-devel@blackfin.uclinux.org, Michael Hennerich Subject: [PATCH] input: ad7879: use i2c_smbus_read_i2c_block_data() to lower overhead Date: Tue, 9 Mar 2010 10:00:58 -0500 Message-Id: <1268146858-15902-1-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 1.7.0.2 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]); Tue, 09 Mar 2010 14:57:43 +0000 (UTC) diff --git a/drivers/input/touchscreen/ad7879-i2c.c b/drivers/input/touchscreen/ad7879-i2c.c index 3742ca1..50ed9e4 100644 --- a/drivers/input/touchscreen/ad7879-i2c.c +++ b/drivers/input/touchscreen/ad7879-i2c.c @@ -41,8 +41,12 @@ static int ad7879_i2c_read(void *client, u8 reg) static int ad7879_i2c_multi_read(void *client, u8 first_reg, u8 count, u16 *buf) { 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(client, first_reg + idx); + buf[idx] = swab16(buf[idx]); + return 0; }