summaryrefslogtreecommitdiff
path: root/drivers/input/mouse/psmouse-base.c
diff options
context:
space:
mode:
authorArjan Opmeer <arjan@opmeer.net>2008-10-16 22:10:19 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2008-10-16 22:54:35 -0400
commit2a0bd75e5e687a9c34921e942c18477ea7ec2d63 (patch)
treeca2f113e5bb231aca30b139cee03c20332e5c55b /drivers/input/mouse/psmouse-base.c
parent2c6f2cb83b239b7d45da9246cafd27ee615ee35b (diff)
Input: psmouse - add support for Elantech touchpads
This is version 5 of the driver. Relative mode support has been dropped (users wishing to use touchpad in relative mode can use standard PS/2 protocol emulation done in hardware). The driver supports both original version of Elantech protocol and the newer one used by touchpads installed in EeePC. Signed-off-by: Arjan Opmeer <arjan@opmeer.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse/psmouse-base.c')
-rw-r--r--drivers/input/mouse/psmouse-base.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
index 126e977e199e..f8f86de694bb 100644
--- a/drivers/input/mouse/psmouse-base.c
+++ b/drivers/input/mouse/psmouse-base.c
@@ -29,6 +29,7 @@
#include "lifebook.h"
#include "trackpoint.h"
#include "touchkit_ps2.h"
+#include "elantech.h"
#define DRIVER_DESC "PS/2 mouse driver"
@@ -650,6 +651,19 @@ static int psmouse_extensions(struct psmouse *psmouse,
max_proto = PSMOUSE_IMEX;
}
+/*
+ * Try Elantech touchpad.
+ */
+ if (max_proto > PSMOUSE_IMEX &&
+ elantech_detect(psmouse, set_properties) == 0) {
+ if (!set_properties || elantech_init(psmouse) == 0)
+ return PSMOUSE_ELANTECH;
+/*
+ * Init failed, try basic relative protocols
+ */
+ max_proto = PSMOUSE_IMEX;
+ }
+
if (max_proto > PSMOUSE_IMEX) {
if (genius_detect(psmouse, set_properties) == 0)
return PSMOUSE_GENPS;
@@ -789,6 +803,15 @@ static const struct psmouse_protocol psmouse_protocols[] = {
.detect = hgpk_detect,
},
#endif
+#ifdef CONFIG_MOUSE_PS2_ELANTECH
+ {
+ .type = PSMOUSE_ELANTECH,
+ .name = "ETPS/2",
+ .alias = "elantech",
+ .detect = elantech_detect,
+ .init = elantech_init,
+ },
+ #endif
{
.type = PSMOUSE_CORTRON,
.name = "CortronPS/2",