aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-09-12 20:24:47 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2014-09-15 17:30:46 -0400
commit3ace3686f198e656624d7ca2984d053e65f6e09d (patch)
tree45ca6b9bf62cf53dafa0325ae26eabdb6de2952a /drivers/input
parent2c75ada6250990ea859b0b5498cb0b7c2823a9d7 (diff)
Input: psmouse - add support for detecting FocalTech PS/2 touchpads
The Asus X450 and X550 laptops use a PS/2 touchpad from a new manufacturer called FocalTech: https://bugzilla.kernel.org/show_bug.cgi?id=77391 https://bugzilla.redhat.com/show_bug.cgi?id=1110011 The protocol for these devices is not known at this time, but even without knowing the protocol they need some special handling. They get upset by some of our other PS/2 device probing, and once upset generate random mouse events making things unusable even with an external mouse. This patch adds detection of these devices based on their pnp ids, and when they are detected, treats them as a bare ps/2 mouse. Doing things this way they at least work in their ps/2 mouse emulation mode. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/mouse/Makefile2
-rw-r--r--drivers/input/mouse/focaltech.c52
-rw-r--r--drivers/input/mouse/focaltech.h22
-rw-r--r--drivers/input/mouse/psmouse-base.c16
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
23obj-$(CONFIG_MOUSE_SYNAPTICS_USB) += synaptics_usb.o 23obj-$(CONFIG_MOUSE_SYNAPTICS_USB) += synaptics_usb.o
24obj-$(CONFIG_MOUSE_VSXXXAA) += vsxxxaa.o 24obj-$(CONFIG_MOUSE_VSXXXAA) += vsxxxaa.o
25 25
26psmouse-objs := psmouse-base.o synaptics.o 26psmouse-objs := psmouse-base.o synaptics.o focaltech.o
27 27
28psmouse-$(CONFIG_MOUSE_PS2_ALPS) += alps.o 28psmouse-$(CONFIG_MOUSE_PS2_ALPS) += alps.o
29psmouse-$(CONFIG_MOUSE_PS2_ELANTECH) += elantech.o 29psmouse-$(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
26static const char * const focaltech_pnp_ids[] = {
27 "FLT0101",
28 "FLT0102",
29 "FLT0103",
30 NULL
31};
32
33int 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
46int 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
19int focaltech_detect(struct psmouse *psmouse, bool set_properties);
20int 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).