Writing of calibration command and non-zero data value must be performed in one I2C transaction. Signed-off-by: Joo Aun Saw <jasaw81@xxxxxxxxx> --- 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 -- 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