linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: linux-input@vger.kernel.org, Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: uclinux-dist-devel@blackfin.uclinux.org,
	Michael Hennerich <michael.hennerich@analog.com>
Subject: [PATCH] input: ad7879: use i2c_smbus_read_i2c_block_data() to lower overhead
Date: Tue,  9 Mar 2010 10:00:58 -0500	[thread overview]
Message-ID: <1268146858-15902-1-git-send-email-vapier@gentoo.org> (raw)

From: Michael Hennerich <michael.hennerich@analog.com>

Avoid additional addressing overhead incurred by word_data transfers.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/input/touchscreen/ad7879-i2c.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

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;
 }
 
-- 
1.7.0.2


                 reply	other threads:[~2010-03-09 14:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1268146858-15902-1-git-send-email-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).