Skip to content

Commit c164c14

Browse files
committed
Input: ALPS - fix max coordinates for v5 and v7 protocols
Commit 3296f71 ("Input: ALPS - consolidate setting protocol parameters") inadvertently moved call to alps_dolphin_get_device_area() from v5 to v7 protocol, causing both protocols report incorrect maximum values for X and Y axes which resulted in crash in Synaptics X driver. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=94801 Reported-by: Santiago Gala <sgala@apache.org> Reported-by: Pali Rohár <pali.rohar@gmail.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent a736775 commit c164c14

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/input/mouse/alps.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2281,10 +2281,12 @@ static int alps_set_protocol(struct psmouse *psmouse,
22812281
priv->set_abs_params = alps_set_abs_params_mt;
22822282
priv->nibble_commands = alps_v3_nibble_commands;
22832283
priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
2284-
priv->x_max = 1360;
2285-
priv->y_max = 660;
22862284
priv->x_bits = 23;
22872285
priv->y_bits = 12;
2286+
2287+
if (alps_dolphin_get_device_area(psmouse, priv))
2288+
return -EIO;
2289+
22882290
break;
22892291

22902292
case ALPS_PROTO_V6:
@@ -2303,9 +2305,8 @@ static int alps_set_protocol(struct psmouse *psmouse,
23032305
priv->set_abs_params = alps_set_abs_params_mt;
23042306
priv->nibble_commands = alps_v3_nibble_commands;
23052307
priv->addr_command = PSMOUSE_CMD_RESET_WRAP;
2306-
2307-
if (alps_dolphin_get_device_area(psmouse, priv))
2308-
return -EIO;
2308+
priv->x_max = 0xfff;
2309+
priv->y_max = 0x7ff;
23092310

23102311
if (priv->fw_ver[1] != 0xba)
23112312
priv->flags |= ALPS_BUTTONPAD;

0 commit comments

Comments
 (0)