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 <hdegoede@redhat.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Marcin Sochacki <msochacki+kernel@gmail.com>
Tested-by: Till <till2.schaefer@uni-dortmund.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
        enum psmouse_type type;
        bool maxproto;
        bool ignore_parity; /* Protocol should ignore parity errors from KBC */
+       bool try_passthru; /* Try protocol also on passthrough ports */
        const char *name;
        const char *alias;
        int (*detect)(struct psmouse *, bool);
                .maxproto       = true,
                .ignore_parity  = true,
                .detect         = ps2bare_detect,
+               .try_passthru   = true,
        },
 #ifdef CONFIG_MOUSE_PS2_LOGIPS2PP
        {
                .maxproto       = true,
                .ignore_parity  = true,
                .detect         = intellimouse_detect,
+               .try_passthru   = true,
        },
        {
                .type           = PSMOUSE_IMEX,
                .maxproto       = true,
                .ignore_parity  = true,
                .detect         = im_explorer_detect,
+               .try_passthru   = true,
        },
 #ifdef CONFIG_MOUSE_PS2_SYNAPTICS
        {
                .name           = "TPPS/2",
                .alias          = "trackpoint",
                .detect         = trackpoint_detect,
+               .try_passthru   = true,
        },
 #endif
 #ifdef CONFIG_MOUSE_PS2_TOUCHKIT
        if (!proto)
                return false;
 
+       if (psmouse->ps2dev.serio->id.type == SERIO_PS_PSTHRU &&
+           !proto->try_passthru) {
+               return false;
+       }
+
        if (set_properties)
                psmouse_apply_defaults(psmouse);