diff options
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/mouse/Makefile | 2 | ||||
-rw-r--r-- | drivers/input/mouse/focaltech.c | 52 | ||||
-rw-r--r-- | drivers/input/mouse/focaltech.h | 22 | ||||
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 16 |
4 files changed, 91 insertions, 1 deletions
diff --git a/drivers/input/mouse/Makefile b/drivers/input/mouse/Makefile index c25efdb3f288..dda507f8b3a2 100644 --- a/drivers/input/mouse/Makefile +++ b/drivers/input/mouse/Makefile | |||
@@ -23,7 +23,7 @@ obj-$(CONFIG_MOUSE_SYNAPTICS_I2C) += synaptics_i2c.o | |||
23 | obj-$(CONFIG_MOUSE_SYNAPTICS_USB) += synaptics_usb.o | 23 | obj-$(CONFIG_MOUSE_SYNAPTICS_USB) += synaptics_usb.o |
24 | obj-$(CONFIG_MOUSE_VSXXXAA) += vsxxxaa.o | 24 | obj-$(CONFIG_MOUSE_VSXXXAA) += vsxxxaa.o |
25 | 25 | ||
26 | psmouse-objs := psmouse-base.o synaptics.o | 26 | psmouse-objs := psmouse-base.o synaptics.o focaltech.o |
27 | 27 | ||
28 | psmouse-$(CONFIG_MOUSE_PS2_ALPS) += alps.o | 28 | psmouse-$(CONFIG_MOUSE_PS2_ALPS) += alps.o |
29 | psmouse-$(CONFIG_MOUSE_PS2_ELANTECH) += elantech.o | 29 | psmouse-$(CONFIG_MOUSE_PS2_ELANTECH) += elantech.o |
diff --git a/drivers/input/mouse/focaltech.c b/drivers/input/mouse/focaltech.c new file mode 100644 index 000000000000..f4d657ee1cc0 --- /dev/null +++ b/drivers/input/mouse/focaltech.c | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * Focaltech TouchPad PS/2 mouse driver | ||
3 | * | ||
4 | * Copyright (c) 2014 Red Hat Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * Red Hat authors: | ||
12 | * | ||
13 | * Hans de Goede <hdegoede@redhat.com> | ||
14 | */ | ||
15 | |||
16 | /* | ||
17 | * The Focaltech PS/2 touchpad protocol is unknown. This drivers deals with | ||
18 | * detection only, to avoid further detection attempts confusing the touchpad | ||
19 | * this way it at least works in PS/2 mouse compatibility mode. | ||
20 | */ | ||
21 | |||
22 | #include <linux/device.h> | ||
23 | #include <linux/libps2.h> | ||
24 | #include "psmouse.h" | ||
25 | |||
26 | static const char * const focaltech_pnp_ids[] = { | ||
27 | "FLT0101", | ||
28 | "FLT0102", | ||
29 | "FLT0103", | ||
30 | NULL | ||
31 | }; | ||
32 | |||
33 | int focaltech_detect(struct psmouse *psmouse, bool set_properties) | ||
34 | { | ||
35 | if (!psmouse_matches_pnp_id(psmouse, focaltech_pnp_ids)) | ||
36 | return -ENODEV; | ||
37 | |||
38 | if (set_properties) { | ||
39 | psmouse->vendor = "FocalTech"; | ||
40 | psmouse->name = "FocalTech Touchpad in mouse emulation mode"; | ||
41 | } | ||
42 | |||
43 | return 0; | ||
44 | } | ||
45 | |||
46 | int focaltech_init(struct psmouse *psmouse) | ||
47 | { | ||
48 | ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_RESET_DIS); | ||
49 | psmouse_reset(psmouse); | ||
50 | |||
51 | return 0; | ||
52 | } | ||
diff --git a/drivers/input/mouse/focaltech.h b/drivers/input/mouse/focaltech.h new file mode 100644 index 000000000000..498650c61e28 --- /dev/null +++ b/drivers/input/mouse/focaltech.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Focaltech TouchPad PS/2 mouse driver | ||
3 | * | ||
4 | * Copyright (c) 2014 Red Hat Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * Red Hat authors: | ||
12 | * | ||
13 | * Hans de Goede <hdegoede@redhat.com> | ||
14 | */ | ||
15 | |||
16 | #ifndef _FOCALTECH_H | ||
17 | #define _FOCALTECH_H | ||
18 | |||
19 | int focaltech_detect(struct psmouse *psmouse, bool set_properties); | ||
20 | int focaltech_init(struct psmouse *psmouse); | ||
21 | |||
22 | #endif | ||
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index bc1bc2653f15..3ab941d425ae 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include "elantech.h" | 35 | #include "elantech.h" |
36 | #include "sentelic.h" | 36 | #include "sentelic.h" |
37 | #include "cypress_ps2.h" | 37 | #include "cypress_ps2.h" |
38 | #include "focaltech.h" | ||
38 | 39 | ||
39 | #define DRIVER_DESC "PS/2 mouse driver" | 40 | #define DRIVER_DESC "PS/2 mouse driver" |
40 | 41 | ||
@@ -720,6 +721,21 @@ static int psmouse_extensions(struct psmouse *psmouse, | |||
720 | { | 721 | { |
721 | bool synaptics_hardware = false; | 722 | bool synaptics_hardware = false; |
722 | 723 | ||
724 | /* Always check for focaltech, this is safe as it uses pnp-id matching */ | ||
725 | if (psmouse_do_detect(focaltech_detect, psmouse, set_properties) == 0) { | ||
726 | if (!set_properties || focaltech_init(psmouse) == 0) { | ||
727 | /* | ||
728 | * Not supported yet, use bare protocol. | ||
729 | * Note that we need to also restrict | ||
730 | * psmouse_max_proto so that psmouse_initialize() | ||
731 | * does not try to reset rate and resolution, | ||
732 | * because even that upsets the device. | ||
733 | */ | ||
734 | psmouse_max_proto = PSMOUSE_PS2; | ||
735 | return PSMOUSE_PS2; | ||
736 | } | ||
737 | } | ||
738 | |||
723 | /* | 739 | /* |
724 | * We always check for lifebook because it does not disturb mouse | 740 | * We always check for lifebook because it does not disturb mouse |
725 | * (it only checks DMI information). | 741 | * (it only checks DMI information). |