From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Mike Frysinger <vapier@gentoo.org>,
Michael Hennerich <michael.hennerich@analog.com>
Cc: linux-input@vger.kernel.org
Subject: [PATCH 4/4] Input: ad7879 - use i2c_smbus_read_i2c_block_data() to lower overhead
Date: Fri, 25 Jun 2010 01:22:34 -0700 [thread overview]
Message-ID: <20100625082234.8617.98489.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100625081847.8617.31150.stgit@localhost.localdomain>
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>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/touchscreen/ad7879-i2c.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
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;
}
next prev parent reply other threads:[~2010-06-25 8:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-25 8:22 [PATCH 0/4] Current ad7879 patches Dmitry Torokhov
2010-06-25 8:22 ` [PATCH 1/4] Input: ad7879 - use threaded IRQ Dmitry Torokhov
2010-06-25 8:22 ` [PATCH 2/4] Input: ad7879 - split bus logic out Dmitry Torokhov
2010-06-29 6:08 ` Mike Frysinger
2010-06-25 8:22 ` [PATCH 3/4] Input: ad7879 - add open and close methods Dmitry Torokhov
2010-06-25 8:22 ` Dmitry Torokhov [this message]
2010-06-29 12:10 ` [PATCH 0/4] Current ad7879 patches Hennerich, Michael
2010-06-30 8:03 ` Dmitry Torokhov
2010-06-30 8:40 ` Hennerich, Michael
2010-06-30 9:07 ` Dmitry Torokhov
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=20100625082234.8617.98489.stgit@localhost.localdomain \
--to=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=michael.hennerich@analog.com \
--cc=vapier@gentoo.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).