From: jooaun <jasaw81@gmail.com>
To: dmitry.torokhov@gmail.com
Cc: linux-input@vger.kernel.org, raphaelpereira@gmail.com,
jooaun <jasaw81@gmail.com>
Subject: [PATCH 5/8] qt2160: fix starting of device calibration
Date: Tue, 9 Nov 2010 13:15:08 +1100 [thread overview]
Message-ID: <1289268911-32322-5-git-send-email-jasaw81@gmail.com> (raw)
In-Reply-To: <1289268911-32322-1-git-send-email-jasaw81@gmail.com>
Writing of calibration command and non-zero data value must be performed in one I2C transaction.
Signed-off-by: Joo Aun Saw <jasaw81@gmail.com>
---
drivers/input/keyboard/qt2160.c | 23 +----------------------
1 files changed, 1 insertions(+), 22 deletions(-)
diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c
index 0d662e2..7647849 100755
--- a/drivers/input/keyboard/qt2160.c
+++ b/drivers/input/keyboard/qt2160.c
@@ -264,27 +264,6 @@ static int __devinit qt2160_read(struct i2c_client *client, u8 reg)
return ret;
}
-static int __devinit qt2160_write(struct i2c_client *client, u8 reg, u8 data)
-{
- int error;
-
- error = i2c_smbus_write_byte(client, reg);
- if (error) {
- dev_err(&client->dev,
- "couldn't send request. Returned %d\n", error);
- return error;
- }
-
- error = i2c_smbus_write_byte(client, data);
- if (error) {
- dev_err(&client->dev,
- "couldn't write data. Returned %d\n", error);
- return error;
- }
-
- return error;
-}
-
static int __devinit qt2160_configure_device(struct i2c_client *client,
struct qt2160_data *qt2160)
{
@@ -489,7 +468,7 @@ static int __devinit qt2160_probe(struct i2c_client *client,
}
/* Calibrate device */
- error = qt2160_write(client, QT2160_CMD_CALIBRATE, 1);
+ error = i2c_smbus_write_byte_data(client, QT2160_CMD_CALIBRATE, 1);
if (error) {
dev_err(&client->dev, "failed to calibrate device\n");
goto err_free_mem;
--
1.7.0.4
next prev parent reply other threads:[~2010-11-09 2:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-09 2:15 [PATCH 1/8] qt2160: add slider support jooaun
2010-11-09 2:15 ` [PATCH 2/8] qt2160: configurable key sensitivity jooaun
2010-11-09 2:43 ` jooaun
2010-11-09 2:15 ` [PATCH 3/8] qt2160: add PM support jooaun
2010-11-09 2:15 ` [PATCH 4/8] qt2160: add configurable power mode jooaun
2010-11-09 2:15 ` jooaun [this message]
2010-11-09 2:15 ` [PATCH 6/8] qt2160: only read device when Change pin is active jooaun
2010-11-09 2:45 ` jooaun
2010-11-09 2:15 ` [PATCH 7/8] qt2160: optional interrupt flag jooaun
2010-11-09 2:46 ` jooaun
2010-11-09 2:15 ` [PATCH 8/8] qt2160: add hardware reset jooaun
2010-11-09 2:47 ` jooaun
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=1289268911-32322-5-git-send-email-jasaw81@gmail.com \
--to=jasaw81@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=raphaelpereira@gmail.com \
/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).