diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-12-02 19:50:42 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-12-17 18:24:04 -0500 |
commit | 24a06f3e3ab640490f49c8e8812d9550d6f15e92 (patch) | |
tree | 190b929c1373bdfdd7a09b91792609cb037aae07 /drivers/input/mouse/psmouse-base.c | |
parent | 2b6f39e9ee7b6a9fa98f6047b05733053876fdbe (diff) |
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: Hans de Goede <hdegoede@redhat.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>
Diffstat (limited to 'drivers/input/mouse/psmouse-base.c')
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index c2bd8665e9f2..978ba0bb4bd9 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -836,19 +836,15 @@ static int psmouse_extensions(struct psmouse *psmouse, | |||
836 | * Trackpads. | 836 | * Trackpads. |
837 | */ | 837 | */ |
838 | if (max_proto > PSMOUSE_IMEX && | 838 | if (max_proto > PSMOUSE_IMEX && |
839 | cypress_detect(psmouse, set_properties) == 0) { | 839 | psmouse_do_detect(cypress_detect, psmouse, set_properties) == 0) { |
840 | if (IS_ENABLED(CONFIG_MOUSE_PS2_CYPRESS)) { | 840 | if (!set_properties || cypress_init(psmouse) == 0) |
841 | if (cypress_init(psmouse) == 0) | 841 | return PSMOUSE_CYPRESS; |
842 | return PSMOUSE_CYPRESS; | ||
843 | |||
844 | /* | ||
845 | * Finger Sensing Pad probe upsets some modules of | ||
846 | * Cypress Trackpad, must avoid Finger Sensing Pad | ||
847 | * probe if Cypress Trackpad device detected. | ||
848 | */ | ||
849 | return PSMOUSE_PS2; | ||
850 | } | ||
851 | 842 | ||
843 | /* | ||
844 | * Finger Sensing Pad probe upsets some modules of | ||
845 | * Cypress Trackpad, must avoid Finger Sensing Pad | ||
846 | * probe if Cypress Trackpad device detected. | ||
847 | */ | ||
852 | max_proto = PSMOUSE_IMEX; | 848 | max_proto = PSMOUSE_IMEX; |
853 | } | 849 | } |
854 | 850 | ||