aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio/libps2.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-14 20:56:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-14 20:56:51 -0400
commit133309a89e7430f907ebe85e78906ee12c311727 (patch)
treedaa96e6e82b63c0ef1538dcbb455d13595a1c83d /drivers/input/serio/libps2.c
parent5489375d481c8456c8259b48e107d03b05309d1d (diff)
parentfc8e1ead9314cf0e0f1922e661428b93d3a50d88 (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: (52 commits) Input: bcm5974 - silence uninitialized variables warnings Input: wistron_btns - add keymap for AOpen 1557 Input: psmouse - use boolean type Input: i8042 - use platform_driver_probe Input: i8042 - use boolean type where it makes sense Input: i8042 - try disabling and re-enabling AUX port at close Input: pxa27x_keypad - allow modifying keymap from userspace Input: sunkbd - fix formatting Input: i8042 - bypass AUX IRQ delivery test on laptops Input: wacom_w8001 - simplify querying logic Input: atkbd - allow setting force-release bitmap via sysfs Input: w90p910_keypad - move a dereference below a NULL test Input: add twl4030_keypad driver Input: matrix-keypad - add function to build device keymap Input: tosakbd - fix cleaning up KEY_STROBEs after error Input: joydev - validate axis/button maps before clobbering current ones Input: xpad - add USB ID for the drumkit controller from Rock Band Input: w90p910_keypad - rename driver name to match platform Input: add new driver for Sentelic Finger Sensing Pad Input: psmouse - allow defining read-only attributes ...
Diffstat (limited to 'drivers/input/serio/libps2.c')
-rw-r--r--drivers/input/serio/libps2.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c
index be5bbbb8ae4e..3a95b508bf27 100644
--- a/drivers/input/serio/libps2.c
+++ b/drivers/input/serio/libps2.c
@@ -161,7 +161,7 @@ static int ps2_adjust_timeout(struct ps2dev *ps2dev, int command, int timeout)
161 * ps2_command() can only be called from a process context 161 * ps2_command() can only be called from a process context
162 */ 162 */
163 163
164int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command) 164int __ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command)
165{ 165{
166 int timeout; 166 int timeout;
167 int send = (command >> 12) & 0xf; 167 int send = (command >> 12) & 0xf;
@@ -179,8 +179,6 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command)
179 return -1; 179 return -1;
180 } 180 }
181 181
182 mutex_lock(&ps2dev->cmd_mutex);
183
184 serio_pause_rx(ps2dev->serio); 182 serio_pause_rx(ps2dev->serio);
185 ps2dev->flags = command == PS2_CMD_GETID ? PS2_FLAG_WAITID : 0; 183 ps2dev->flags = command == PS2_CMD_GETID ? PS2_FLAG_WAITID : 0;
186 ps2dev->cmdcnt = receive; 184 ps2dev->cmdcnt = receive;
@@ -231,7 +229,18 @@ int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command)
231 ps2dev->flags = 0; 229 ps2dev->flags = 0;
232 serio_continue_rx(ps2dev->serio); 230 serio_continue_rx(ps2dev->serio);
233 231
232 return rc;
233}
234EXPORT_SYMBOL(__ps2_command);
235
236int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command)
237{
238 int rc;
239
240 mutex_lock(&ps2dev->cmd_mutex);
241 rc = __ps2_command(ps2dev, param, command);
234 mutex_unlock(&ps2dev->cmd_mutex); 242 mutex_unlock(&ps2dev->cmd_mutex);
243
235 return rc; 244 return rc;
236} 245}
237EXPORT_SYMBOL(ps2_command); 246EXPORT_SYMBOL(ps2_command);