aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/sentelic.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/mouse/sentelic.c')
-rw-r--r--drivers/input/mouse/sentelic.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c
index 84e2fc04d11b..f84cbd97c884 100644
--- a/drivers/input/mouse/sentelic.c
+++ b/drivers/input/mouse/sentelic.c
@@ -92,7 +92,8 @@ static int fsp_reg_read(struct psmouse *psmouse, int reg_addr, int *reg_val)
92 */ 92 */
93 ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE); 93 ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE);
94 psmouse_set_state(psmouse, PSMOUSE_CMD_MODE); 94 psmouse_set_state(psmouse, PSMOUSE_CMD_MODE);
95 mutex_lock(&ps2dev->cmd_mutex); 95
96 ps2_begin_command(ps2dev);
96 97
97 if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0) 98 if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0)
98 goto out; 99 goto out;
@@ -126,7 +127,7 @@ static int fsp_reg_read(struct psmouse *psmouse, int reg_addr, int *reg_val)
126 rc = 0; 127 rc = 0;
127 128
128 out: 129 out:
129 mutex_unlock(&ps2dev->cmd_mutex); 130 ps2_end_command(ps2dev);
130 ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE); 131 ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE);
131 psmouse_set_state(psmouse, PSMOUSE_ACTIVATED); 132 psmouse_set_state(psmouse, PSMOUSE_ACTIVATED);
132 dev_dbg(&ps2dev->serio->dev, "READ REG: 0x%02x is 0x%02x (rc = %d)\n", 133 dev_dbg(&ps2dev->serio->dev, "READ REG: 0x%02x is 0x%02x (rc = %d)\n",
@@ -140,7 +141,7 @@ static int fsp_reg_write(struct psmouse *psmouse, int reg_addr, int reg_val)
140 unsigned char v; 141 unsigned char v;
141 int rc = -1; 142 int rc = -1;
142 143
143 mutex_lock(&ps2dev->cmd_mutex); 144 ps2_begin_command(ps2dev);
144 145
145 if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0) 146 if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0)
146 goto out; 147 goto out;
@@ -179,7 +180,7 @@ static int fsp_reg_write(struct psmouse *psmouse, int reg_addr, int reg_val)
179 rc = 0; 180 rc = 0;
180 181
181 out: 182 out:
182 mutex_unlock(&ps2dev->cmd_mutex); 183 ps2_end_command(ps2dev);
183 dev_dbg(&ps2dev->serio->dev, "WRITE REG: 0x%02x to 0x%02x (rc = %d)\n", 184 dev_dbg(&ps2dev->serio->dev, "WRITE REG: 0x%02x to 0x%02x (rc = %d)\n",
184 reg_addr, reg_val, rc); 185 reg_addr, reg_val, rc);
185 return rc; 186 return rc;
@@ -214,7 +215,8 @@ static int fsp_page_reg_read(struct psmouse *psmouse, int *reg_val)
214 215
215 ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE); 216 ps2_command(ps2dev, NULL, PSMOUSE_CMD_DISABLE);
216 psmouse_set_state(psmouse, PSMOUSE_CMD_MODE); 217 psmouse_set_state(psmouse, PSMOUSE_CMD_MODE);
217 mutex_lock(&ps2dev->cmd_mutex); 218
219 ps2_begin_command(ps2dev);
218 220
219 if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0) 221 if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0)
220 goto out; 222 goto out;
@@ -236,7 +238,7 @@ static int fsp_page_reg_read(struct psmouse *psmouse, int *reg_val)
236 rc = 0; 238 rc = 0;
237 239
238 out: 240 out:
239 mutex_unlock(&ps2dev->cmd_mutex); 241 ps2_end_command(ps2dev);
240 ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE); 242 ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE);
241 psmouse_set_state(psmouse, PSMOUSE_ACTIVATED); 243 psmouse_set_state(psmouse, PSMOUSE_ACTIVATED);
242 dev_dbg(&ps2dev->serio->dev, "READ PAGE REG: 0x%02x (rc = %d)\n", 244 dev_dbg(&ps2dev->serio->dev, "READ PAGE REG: 0x%02x (rc = %d)\n",
@@ -250,7 +252,7 @@ static int fsp_page_reg_write(struct psmouse *psmouse, int reg_val)
250 unsigned char v; 252 unsigned char v;
251 int rc = -1; 253 int rc = -1;
252 254
253 mutex_lock(&ps2dev->cmd_mutex); 255 ps2_begin_command(ps2dev);
254 256
255 if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0) 257 if (ps2_sendbyte(ps2dev, 0xf3, FSP_CMD_TIMEOUT) < 0)
256 goto out; 258 goto out;
@@ -275,7 +277,7 @@ static int fsp_page_reg_write(struct psmouse *psmouse, int reg_val)
275 rc = 0; 277 rc = 0;
276 278
277 out: 279 out:
278 mutex_unlock(&ps2dev->cmd_mutex); 280 ps2_end_command(ps2dev);
279 dev_dbg(&ps2dev->serio->dev, "WRITE PAGE REG: to 0x%02x (rc = %d)\n", 281 dev_dbg(&ps2dev->serio->dev, "WRITE PAGE REG: to 0x%02x (rc = %d)\n",
280 reg_val, rc); 282 reg_val, rc);
281 return rc; 283 return rc;