Skip to content

Commit ec6184b

Browse files
committed
Input: psmouse - limit protocols that we try on passthrough ports
PS/2 protocol is slow, and using it with pass-through port (where we encapsulate PS/2 into PS/2) is slower yet so it takes quite a bit of time to do full protocol discovery for device attached to a pass-through port. However, so far we have not see anything but trackpoints or basic PS/2 mice on pass-through ports, so let's limit protocols that we probe there to Trackpoint, IntelliMouse Explorer, IntelliMouse, and bare PS/2 protocol, and avoid other extended protocols, such as Synaptics, ALPS, etc. Reviewed-by: Hans de Goede <[email protected]> Reviewed-by: Pali Rohár <[email protected]> Tested-by: Marcin Sochacki <[email protected]> Tested-by: Till <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent c378b51 commit ec6184b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/input/mouse/psmouse-base.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ struct psmouse_protocol {
119119
enum psmouse_type type;
120120
bool maxproto;
121121
bool ignore_parity; /* Protocol should ignore parity errors from KBC */
122+
bool try_passthru; /* Try protocol also on passthrough ports */
122123
const char *name;
123124
const char *alias;
124125
int (*detect)(struct psmouse *, bool);
@@ -691,6 +692,7 @@ static const struct psmouse_protocol psmouse_protocols[] = {
691692
.maxproto = true,
692693
.ignore_parity = true,
693694
.detect = ps2bare_detect,
695+
.try_passthru = true,
694696
},
695697
#ifdef CONFIG_MOUSE_PS2_LOGIPS2PP
696698
{
@@ -728,6 +730,7 @@ static const struct psmouse_protocol psmouse_protocols[] = {
728730
.maxproto = true,
729731
.ignore_parity = true,
730732
.detect = intellimouse_detect,
733+
.try_passthru = true,
731734
},
732735
{
733736
.type = PSMOUSE_IMEX,
@@ -736,6 +739,7 @@ static const struct psmouse_protocol psmouse_protocols[] = {
736739
.maxproto = true,
737740
.ignore_parity = true,
738741
.detect = im_explorer_detect,
742+
.try_passthru = true,
739743
},
740744
#ifdef CONFIG_MOUSE_PS2_SYNAPTICS
741745
{
@@ -777,6 +781,7 @@ static const struct psmouse_protocol psmouse_protocols[] = {
777781
.name = "TPPS/2",
778782
.alias = "trackpoint",
779783
.detect = trackpoint_detect,
784+
.try_passthru = true,
780785
},
781786
#endif
782787
#ifdef CONFIG_MOUSE_PS2_TOUCHKIT
@@ -933,6 +938,11 @@ static bool psmouse_try_protocol(struct psmouse *psmouse,
933938
if (!proto)
934939
return false;
935940

941+
if (psmouse->ps2dev.serio->id.type == SERIO_PS_PSTHRU &&
942+
!proto->try_passthru) {
943+
return false;
944+
}
945+
936946
if (set_properties)
937947
psmouse_apply_defaults(psmouse);
938948

0 commit comments

Comments
 (0)