Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24a06f3e authored by Dmitry Torokhov's avatar Dmitry Torokhov
Browse files

Input: psmouse - clean up Cypress probe



When Cypress protocol support is disabled cypress_init() is a stub that
always returns -ENOSYS, so there is not point in testing for
CONFIG_MOUSE_PS2_CYPRESS after we decided that we are dealing with a
Cypress device. Also, we should only be calling cypress_detect() when
set_properties argument is "true", like with other protocols.

There is a slight change in behavior to make follow-up patches more
uniform: when we detect Cypress but its initialization fails, instead of
immediately returning PSMOUSE_PS2 protocol we now continue trying
IntelliMouse [Explorer]. Given that Cypress devices only have issue with
Sentelic probes probing Imtellimouse should be safe.

Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Tested-by: default avatarMarcin Sochacki <msochacki+kernel@gmail.com>
Tested-by: default avatarTill <till2.schaefer@uni-dortmund.de>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 2b6f39e9
Loading
Loading
Loading
Loading
+8 −12
Original line number Diff line number Diff line
@@ -836,9 +836,8 @@ static int psmouse_extensions(struct psmouse *psmouse,
	 * Trackpads.
	 */
	if (max_proto > PSMOUSE_IMEX &&
			cypress_detect(psmouse, set_properties) == 0) {
		if (IS_ENABLED(CONFIG_MOUSE_PS2_CYPRESS)) {
			if (cypress_init(psmouse) == 0)
	    psmouse_do_detect(cypress_detect, psmouse, set_properties) == 0) {
		if (!set_properties || cypress_init(psmouse) == 0)
			return PSMOUSE_CYPRESS;

		/*
@@ -846,9 +845,6 @@ static int psmouse_extensions(struct psmouse *psmouse,
		 * Cypress Trackpad, must avoid Finger Sensing Pad
		 * probe if Cypress Trackpad device detected.
		 */
			return PSMOUSE_PS2;
		}

		max_proto = PSMOUSE_IMEX;
	}