diff mbox

[8/8] qt2160: add hardware reset

Message ID 1289270857-4372-1-git-send-email-jasaw81@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

jooaun Nov. 9, 2010, 2:47 a.m. UTC
None
diff mbox

Patch

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];