aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
authorJavier Martin <javier.martin@vista-silicon.com>2012-10-25 02:55:01 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-10-25 03:13:47 -0400
commita6e8c0a25377e27958b11b20e1927885ae7c9857 (patch)
tree2e9df4f9062c14f087fcf6192f5df1f692d66440 /drivers/input/keyboard
parente52278a36898dc93aa1991a3ac976c1c7c55e2ed (diff)
Input: qt2160 - fix qt2160_write() implementation
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>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/qt2160.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c
index e7a5e36e1203..73ea4b04d4fb 100644
--- a/drivers/input/keyboard/qt2160.c
+++ b/drivers/input/keyboard/qt2160.c
@@ -207,23 +207,14 @@ static int __devinit qt2160_read(struct i2c_client *client, u8 reg)
207 207
208static int __devinit qt2160_write(struct i2c_client *client, u8 reg, u8 data) 208static int __devinit qt2160_write(struct i2c_client *client, u8 reg, u8 data)
209{ 209{
210 int error; 210 int ret;
211
212 error = i2c_smbus_write_byte(client, reg);
213 if (error) {
214 dev_err(&client->dev,
215 "couldn't send request. Returned %d\n", error);
216 return error;
217 }
218 211
219 error = i2c_smbus_write_byte(client, data); 212 ret = i2c_smbus_write_byte_data(client, reg, data);
220 if (error) { 213 if (ret < 0)
221 dev_err(&client->dev, 214 dev_err(&client->dev,
222 "couldn't write data. Returned %d\n", error); 215 "couldn't write data. Returned %d\n", ret);
223 return error;
224 }
225 216
226 return error; 217 return ret;
227} 218}
228 219
229 220