diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-12-30 16:42:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-12-30 16:42:41 -0500 |
commit | c63c4edcc8cf0f1ed2c6a1c9ba7a56bc50aa8199 (patch) | |
tree | 1b056ba1685657554b19065b2a4f926d5c84f72a | |
parent | d65616a92c9fab8fc3caa120d18b7be7b6285914 (diff) | |
parent | 6ccbcf2cb41131f8d56ef0723bf3f7c1f8486076 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: sentelic - fix retrieving number of buttons
Input: sentelic - release mutex upon register write failure
-rw-r--r-- | drivers/input/mouse/sentelic.c | 8 | ||||
-rw-r--r-- | drivers/input/mouse/sentelic.h | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c index c5b12d2e955a..86d6f39178b0 100644 --- a/drivers/input/mouse/sentelic.c +++ b/drivers/input/mouse/sentelic.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * Finger Sensing Pad PS/2 mouse driver. | 2 | * Finger Sensing Pad PS/2 mouse driver. |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2007 Asia Vital Components Co., Ltd. | 4 | * Copyright (C) 2005-2007 Asia Vital Components Co., Ltd. |
5 | * Copyright (C) 2005-2010 Tai-hwa Liang, Sentelic Corporation. | 5 | * Copyright (C) 2005-2011 Tai-hwa Liang, Sentelic Corporation. |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or | 7 | * This program is free software; you can redistribute it and/or |
8 | * modify it under the terms of the GNU General Public License | 8 | * modify it under the terms of the GNU General Public License |
@@ -162,7 +162,7 @@ static int fsp_reg_write(struct psmouse *psmouse, int reg_addr, int reg_val) | |||
162 | ps2_sendbyte(ps2dev, v, FSP_CMD_TIMEOUT2); | 162 | ps2_sendbyte(ps2dev, v, FSP_CMD_TIMEOUT2); |
163 | 163 | ||
164 | if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0) | 164 | if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0) |
165 | return -1; | 165 | goto out; |
166 | 166 | ||
167 | if ((v = fsp_test_invert_cmd(reg_val)) != reg_val) { | 167 | if ((v = fsp_test_invert_cmd(reg_val)) != reg_val) { |
168 | /* inversion is required */ | 168 | /* inversion is required */ |
@@ -261,7 +261,7 @@ static int fsp_page_reg_write(struct psmouse *psmouse, int reg_val) | |||
261 | ps2_sendbyte(ps2dev, 0x88, FSP_CMD_TIMEOUT2); | 261 | ps2_sendbyte(ps2dev, 0x88, FSP_CMD_TIMEOUT2); |
262 | 262 | ||
263 | if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0) | 263 | if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0) |
264 | return -1; | 264 | goto out; |
265 | 265 | ||
266 | if ((v = fsp_test_invert_cmd(reg_val)) != reg_val) { | 266 | if ((v = fsp_test_invert_cmd(reg_val)) != reg_val) { |
267 | ps2_sendbyte(ps2dev, 0x47, FSP_CMD_TIMEOUT2); | 267 | ps2_sendbyte(ps2dev, 0x47, FSP_CMD_TIMEOUT2); |
@@ -309,7 +309,7 @@ static int fsp_get_buttons(struct psmouse *psmouse, int *btn) | |||
309 | }; | 309 | }; |
310 | int val; | 310 | int val; |
311 | 311 | ||
312 | if (fsp_reg_read(psmouse, FSP_REG_TMOD_STATUS1, &val) == -1) | 312 | if (fsp_reg_read(psmouse, FSP_REG_TMOD_STATUS, &val) == -1) |
313 | return -EIO; | 313 | return -EIO; |
314 | 314 | ||
315 | *btn = buttons[(val & 0x30) >> 4]; | 315 | *btn = buttons[(val & 0x30) >> 4]; |
diff --git a/drivers/input/mouse/sentelic.h b/drivers/input/mouse/sentelic.h index ed1395ac7b8b..2e4af24f8c15 100644 --- a/drivers/input/mouse/sentelic.h +++ b/drivers/input/mouse/sentelic.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * Finger Sensing Pad PS/2 mouse driver. | 2 | * Finger Sensing Pad PS/2 mouse driver. |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2007 Asia Vital Components Co., Ltd. | 4 | * Copyright (C) 2005-2007 Asia Vital Components Co., Ltd. |
5 | * Copyright (C) 2005-2009 Tai-hwa Liang, Sentelic Corporation. | 5 | * Copyright (C) 2005-2011 Tai-hwa Liang, Sentelic Corporation. |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or | 7 | * This program is free software; you can redistribute it and/or |
8 | * modify it under the terms of the GNU General Public License | 8 | * modify it under the terms of the GNU General Public License |
@@ -33,6 +33,7 @@ | |||
33 | /* Finger-sensing Pad control registers */ | 33 | /* Finger-sensing Pad control registers */ |
34 | #define FSP_REG_SYSCTL1 0x10 | 34 | #define FSP_REG_SYSCTL1 0x10 |
35 | #define FSP_BIT_EN_REG_CLK BIT(5) | 35 | #define FSP_BIT_EN_REG_CLK BIT(5) |
36 | #define FSP_REG_TMOD_STATUS 0x20 | ||
36 | #define FSP_REG_OPC_QDOWN 0x31 | 37 | #define FSP_REG_OPC_QDOWN 0x31 |
37 | #define FSP_BIT_EN_OPC_TAG BIT(7) | 38 | #define FSP_BIT_EN_OPC_TAG BIT(7) |
38 | #define FSP_REG_OPTZ_XLO 0x34 | 39 | #define FSP_REG_OPTZ_XLO 0x34 |