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 8/8] qt2160: add hardware reset
Date: Tue, 9 Nov 2010 13:47:37 +1100 [thread overview]
Message-ID: <1289270857-4372-1-git-send-email-jasaw81@gmail.com> (raw)
In-Reply-To: <1289268911-32322-8-git-send-email-jasaw81@gmail.com>
Use hardware reset if defined, fall back on soft reset.
Signed-off-by: Joo Aun Saw <jasaw81@gmail.com>
---
drivers/input/keyboard/qt2160.c | 8 +++++++-
include/linux/input/qt2160.h | 2 ++
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c
index d2ce573..d4a8033 100755
--- a/drivers/input/keyboard/qt2160.c
+++ b/drivers/input/keyboard/qt2160.c
@@ -284,7 +284,13 @@ static int __devinit qt2160_configure_device(struct i2c_client *client,
int error = 0;
/* perform software reset and wait for at least 32ms */
- i2c_smbus_write_byte_data(client, QT2160_CMD_RESET, 0xFF);
+ if (pdata->setrst) {
+ pdata->setrst(pdata->data, 0);
+ udelay(10);
+ pdata->setrst(pdata->data, 1);
+ } else {
+ i2c_smbus_write_byte_data(client, QT2160_CMD_RESET, 0xFF);
+ }
msleep(200);
/* perform dummy write to reset I2C state */
diff --git a/include/linux/input/qt2160.h b/include/linux/input/qt2160.h
index dad11bb..1b4b58d 100755
--- a/include/linux/input/qt2160.h
+++ b/include/linux/input/qt2160.h
@@ -10,6 +10,7 @@
* @data: private data for lowlevel IO abstraction routines
* @getchange: return 0 when CHANGE pin is active/low; return 1 when CHANGE pin
* is deactivated/high
+ * @setrst: 0 activates RESET pin; 1 deactivates RESET pin
* @slider_length: number of keys to use as slider, max 8 keys, min 2 keys
* @slider_axis: absolute axis type, value 0 is ABS_X
* @keycodes: key codes for keys that are part of the slider are ignored; slider
@@ -26,6 +27,7 @@
struct qt2160_info {
void *data;
int (*getchange) (void *data);
+ void (*setrst) (void *data, int state);
unsigned char slider_length;
unsigned int slider_axis;
unsigned short keycodes[QT2160_MAXKEYS];
--
1.7.0.4
prev parent reply other threads:[~2010-11-09 2:47 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 ` [PATCH 5/8] qt2160: fix starting of device calibration jooaun
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 [this message]
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=1289270857-4372-1-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).