diff options
author | Daniel Drake <dsd@laptop.org> | 2010-01-07 04:52:39 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-01-07 04:53:30 -0500 |
commit | e4e6efd2df4b5754bd519b516207eb723d1f17df (patch) | |
tree | 26bef82f6bafcbd824cac6cd5896241cb2527e66 /drivers | |
parent | 6f2701b79f2ee0c5eb946e8a87993acbe8041da3 (diff) |
Input: psmouse - fix Synaptics detection when protocol is disabled
For configurations where Synaptics hardware is present but the Synaptics
extensions support is not compiled in, the mouse is reprobed and a new
device is allocated on every suspend/resume.
During probe, psmouse_switch_protocol() calls psmouse_extensions() with
set_properties=1. This calls the dummy synaptics_init() which returns an
error code, instructing us not to use the synaptics extensions.
During resume, psmouse_reconnect() calls psmouse_extensions() with
set_properties=0, in which case call to synaptics_init() is bypassed and
PSMOUSE_SYNAPTICS is returned. Since the result is different from previous
attempt psmouse_reconnect() fails and full re-probe happens.
Fix this by tweaking the set_properties=0 codepath in psmouse_extensions()
to be more careful about offering PSMOUSE_SYNAPTICS extensions.
Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 9 | ||||
-rw-r--r-- | drivers/input/mouse/synaptics.c | 10 | ||||
-rw-r--r-- | drivers/input/mouse/synaptics.h | 1 |
3 files changed, 19 insertions, 1 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index d59e18b24ede..cabf4e1caacc 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -627,8 +627,15 @@ static int psmouse_extensions(struct psmouse *psmouse, | |||
627 | synaptics_hardware = true; | 627 | synaptics_hardware = true; |
628 | 628 | ||
629 | if (max_proto > PSMOUSE_IMEX) { | 629 | if (max_proto > PSMOUSE_IMEX) { |
630 | if (!set_properties || synaptics_init(psmouse) == 0) | 630 | /* |
631 | * Try activating protocol, but check if support is enabled first, since | ||
632 | * we try detecting Synaptics even when protocol is disabled. | ||
633 | */ | ||
634 | if (synaptics_supported() && | ||
635 | (!set_properties || synaptics_init(psmouse) == 0)) { | ||
631 | return PSMOUSE_SYNAPTICS; | 636 | return PSMOUSE_SYNAPTICS; |
637 | } | ||
638 | |||
632 | /* | 639 | /* |
633 | * Some Synaptics touchpads can emulate extended protocols (like IMPS/2). | 640 | * Some Synaptics touchpads can emulate extended protocols (like IMPS/2). |
634 | * Unfortunately Logitech/Genius probes confuse some firmware versions so | 641 | * Unfortunately Logitech/Genius probes confuse some firmware versions so |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 05689e732191..d3f5243fa093 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -743,6 +743,11 @@ int synaptics_init(struct psmouse *psmouse) | |||
743 | return -1; | 743 | return -1; |
744 | } | 744 | } |
745 | 745 | ||
746 | bool synaptics_supported(void) | ||
747 | { | ||
748 | return true; | ||
749 | } | ||
750 | |||
746 | #else /* CONFIG_MOUSE_PS2_SYNAPTICS */ | 751 | #else /* CONFIG_MOUSE_PS2_SYNAPTICS */ |
747 | 752 | ||
748 | void __init synaptics_module_init(void) | 753 | void __init synaptics_module_init(void) |
@@ -754,5 +759,10 @@ int synaptics_init(struct psmouse *psmouse) | |||
754 | return -ENOSYS; | 759 | return -ENOSYS; |
755 | } | 760 | } |
756 | 761 | ||
762 | bool synaptics_supported(void) | ||
763 | { | ||
764 | return false; | ||
765 | } | ||
766 | |||
757 | #endif /* CONFIG_MOUSE_PS2_SYNAPTICS */ | 767 | #endif /* CONFIG_MOUSE_PS2_SYNAPTICS */ |
758 | 768 | ||
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h index 838e7f2c9b30..f0f40a331dc8 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h | |||
@@ -109,5 +109,6 @@ void synaptics_module_init(void); | |||
109 | int synaptics_detect(struct psmouse *psmouse, bool set_properties); | 109 | int synaptics_detect(struct psmouse *psmouse, bool set_properties); |
110 | int synaptics_init(struct psmouse *psmouse); | 110 | int synaptics_init(struct psmouse *psmouse); |
111 | void synaptics_reset(struct psmouse *psmouse); | 111 | void synaptics_reset(struct psmouse *psmouse); |
112 | bool synaptics_supported(void); | ||
112 | 113 | ||
113 | #endif /* _SYNAPTICS_H */ | 114 | #endif /* _SYNAPTICS_H */ |