aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorKevin Cernekee <cernekee@gmail.com>2013-02-14 01:23:04 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-02-14 12:18:06 -0500
commit50e8b2162feb851f5af1372ba996640ad8d66fc9 (patch)
treee1f9e6729d10be5ea5a21c883060e6d17c4a7d36 /drivers/input
parent24af5cb95f1b93c6c72a73113494ace4bcbee5a2 (diff)
Input: ALPS - move {addr,nibble}_command settings into alps_set_defaults()
This allows alps_identify() to override these settings based on the device characteristics, if it is ever necessary. Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Tested-by: Dave Turvene <dturvene@dahetral.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/mouse/alps.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index fe45687cf65a..2221a00b25d3 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -1190,14 +1190,10 @@ static int alps_absolute_mode_v3(struct psmouse *psmouse)
1190 1190
1191static int alps_hw_init_v3(struct psmouse *psmouse) 1191static int alps_hw_init_v3(struct psmouse *psmouse)
1192{ 1192{
1193 struct alps_data *priv = psmouse->private;
1194 struct ps2dev *ps2dev = &psmouse->ps2dev; 1193 struct ps2dev *ps2dev = &psmouse->ps2dev;
1195 int reg_val; 1194 int reg_val;
1196 unsigned char param[4]; 1195 unsigned char param[4];
1197 1196
1198 priv->nibble_commands = alps_v3_nibble_commands;
1199 priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
1200
1201 if (alps_enter_command_mode(psmouse, NULL)) 1197 if (alps_enter_command_mode(psmouse, NULL))
1202 goto error; 1198 goto error;
1203 1199
@@ -1343,13 +1339,9 @@ static int alps_absolute_mode_v4(struct psmouse *psmouse)
1343 1339
1344static int alps_hw_init_v4(struct psmouse *psmouse) 1340static int alps_hw_init_v4(struct psmouse *psmouse)
1345{ 1341{
1346 struct alps_data *priv = psmouse->private;
1347 struct ps2dev *ps2dev = &psmouse->ps2dev; 1342 struct ps2dev *ps2dev = &psmouse->ps2dev;
1348 unsigned char param[4]; 1343 unsigned char param[4];
1349 1344
1350 priv->nibble_commands = alps_v4_nibble_commands;
1351 priv->addr_command = PSMOUSE_CMD_DISABLE;
1352
1353 if (alps_enter_command_mode(psmouse, NULL)) 1345 if (alps_enter_command_mode(psmouse, NULL))
1354 goto error; 1346 goto error;
1355 1347
@@ -1431,11 +1423,15 @@ static void alps_set_defaults(struct alps_data *priv)
1431 priv->hw_init = alps_hw_init_v3; 1423 priv->hw_init = alps_hw_init_v3;
1432 priv->process_packet = alps_process_packet_v3; 1424 priv->process_packet = alps_process_packet_v3;
1433 priv->set_abs_params = alps_set_abs_params_mt; 1425 priv->set_abs_params = alps_set_abs_params_mt;
1426 priv->nibble_commands = alps_v3_nibble_commands;
1427 priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
1434 break; 1428 break;
1435 case ALPS_PROTO_V4: 1429 case ALPS_PROTO_V4:
1436 priv->hw_init = alps_hw_init_v4; 1430 priv->hw_init = alps_hw_init_v4;
1437 priv->process_packet = alps_process_packet_v4; 1431 priv->process_packet = alps_process_packet_v4;
1438 priv->set_abs_params = alps_set_abs_params_mt; 1432 priv->set_abs_params = alps_set_abs_params_mt;
1433 priv->nibble_commands = alps_v4_nibble_commands;
1434 priv->addr_command = PSMOUSE_CMD_DISABLE;
1439 break; 1435 break;
1440 } 1436 }
1441} 1437}