diff options
Diffstat (limited to 'drivers/input/mouse/focaltech.c')
-rw-r--r-- | drivers/input/mouse/focaltech.c | 52 |
1 files changed, 52 insertions, 0 deletions
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 | } | ||