Skip to content

Commit

Permalink
Input: qt2160 - fix qt2160_write() implementation
Browse files Browse the repository at this point in the history
The previous implementation of qt2160_write() didn't work properly because
the value was actually not written to the device. Probably nobody detected
this because the only write that was issued was the one related to auto
calibration.

In order to fix the problem use a similar aproach as qt1070 instead.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Javier Martin authored and Dmitry Torokhov committed Oct 25, 2012
1 parent e52278a commit a6e8c0a
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions drivers/input/keyboard/qt2160.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,23 +207,14 @@ static int __devinit qt2160_read(struct i2c_client *client, u8 reg)

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;
}
int ret;

error = i2c_smbus_write_byte(client, data);
if (error) {
ret = i2c_smbus_write_byte_data(client, reg, data);
if (ret < 0)
dev_err(&client->dev,
"couldn't write data. Returned %d\n", error);
return error;
}
"couldn't write data. Returned %d\n", ret);

return error;
return ret;
}


Expand Down

0 comments on commit a6e8c0a

Please sign in to comment.