Use hardware reset if defined, fall back on soft reset. Signed-off-by: Joo Aun Saw <jasaw81@xxxxxxxxx> --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html