From 3c0340b774916caa4149892504169d290c8a720a Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 10 Jan 2009 23:44:22 -0800 Subject: Input: psmouse - make MOUSE_PS2_LIFEBOOK depend on X86 All Fujitsu-Siemens Lifebook systems are x86-based, so we might as well make MOUSE_PS2_LIFEBOOK depend on X86. This will avoid surprising things like: arch/arm/configs/s3c2410_defconfig:CONFIG_MOUSE_PS2_LIFEBOOK=y Signed-off-by: Jean Delvare Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig index 093c8c1bca74..9705f3a00a3d 100644 --- a/drivers/input/mouse/Kconfig +++ b/drivers/input/mouse/Kconfig @@ -70,7 +70,7 @@ config MOUSE_PS2_SYNAPTICS config MOUSE_PS2_LIFEBOOK bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EMBEDDED default y - depends on MOUSE_PS2 + depends on MOUSE_PS2 && X86 help Say Y here if you have a Fujitsu B-series Lifebook PS/2 TouchScreen connected to your system. -- cgit v1.2.3 From bc34496d63ec0a669d6825ea42275fd6fcbe9969 Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Sun, 1 Feb 2009 16:54:19 -0800 Subject: Input: pxa930_trkball - fix write timeout handling With a postfix decrement i reaches -1 rather than 0, but after the loop it is tested whether it has become 0. Signed-off-by: Roel Kluin Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/pxa930_trkball.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/pxa930_trkball.c b/drivers/input/mouse/pxa930_trkball.c index a0f45c4fc198..784be69b7112 100644 --- a/drivers/input/mouse/pxa930_trkball.c +++ b/drivers/input/mouse/pxa930_trkball.c @@ -83,7 +83,7 @@ static int write_tbcr(struct pxa930_trkball *trkball, int v) __raw_writel(v, trkball->mmio_base + TBCR); - while (i--) { + while (--i) { if (__raw_readl(trkball->mmio_base + TBCR) == v) break; msleep(1); -- cgit v1.2.3 From 4d368456808c977b8e9782dbe9542cf8ddedbab8 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Sat, 28 Feb 2009 12:51:01 -0800 Subject: Input: synaptics - ensure we reset the device on resume When resuming from suspend newer Synaptics touchpads do not recover correctly. Analysis of the resume sequence as applied in Linux was compared to that of other operating systems. This indicated that the other OSs were resetting the mouse before attempting to detect it (for all Synaptics touchpads, old and new). Applying this same modification fixes these newer Synaptics touchpads and brings the driver into line with common OS reset behaviour. Signed-off-by: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/synaptics.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 865fc69e9bc3..f3e4f7b0240d 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -182,11 +182,6 @@ static int synaptics_identify(struct psmouse *psmouse) static int synaptics_query_hardware(struct psmouse *psmouse) { - int retries = 0; - - while ((retries++ < 3) && psmouse_reset(psmouse)) - /* empty */; - if (synaptics_identify(psmouse)) return -1; if (synaptics_model_id(psmouse)) @@ -582,6 +577,8 @@ static int synaptics_reconnect(struct psmouse *psmouse) struct synaptics_data *priv = psmouse->private; struct synaptics_data old_priv = *priv; + psmouse_reset(psmouse); + if (synaptics_detect(psmouse, 0)) return -1; @@ -640,6 +637,8 @@ int synaptics_init(struct psmouse *psmouse) if (!priv) return -1; + psmouse_reset(psmouse); + if (synaptics_query_hardware(psmouse)) { printk(KERN_ERR "Unable to query Synaptics hardware.\n"); goto init_fail; -- cgit v1.2.3 From 9ab7b25e6a30d2292bd6d4913b71c918ee1e21b4 Mon Sep 17 00:00:00 2001 From: Arjan Opmeer Date: Sat, 28 Feb 2009 13:52:40 -0800 Subject: Input: elantech - touchpad driver miss-recognising logitech mice Some Logitech mice react to the magic knock like Elantech touchpad would. This leads to those mice being misdetected as Elantech touchpads. Add a version query to elantech_detect() to distinguish the two. [dtor@mail.ru: - lower severity of some messages - when we are not sure yet if device is Elantech or not not responding to knock is not an error. ] Signed-off-by: Arjan Opmeer Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/elantech.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'drivers/input/mouse') diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index b9a25d57bc5e..6ab0eb1ada1c 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c @@ -542,7 +542,7 @@ int elantech_detect(struct psmouse *psmouse, int set_properties) ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) { - pr_err("elantech.c: sending Elantech magic knock failed.\n"); + pr_debug("elantech.c: sending Elantech magic knock failed.\n"); return -1; } @@ -551,8 +551,27 @@ int elantech_detect(struct psmouse *psmouse, int set_properties) * set of magic numbers */ if (param[0] != 0x3c || param[1] != 0x03 || param[2] != 0xc8) { - pr_info("elantech.c: unexpected magic knock result 0x%02x, 0x%02x, 0x%02x.\n", - param[0], param[1], param[2]); + pr_debug("elantech.c: " + "unexpected magic knock result 0x%02x, 0x%02x, 0x%02x.\n", + param[0], param[1], param[2]); + return -1; + } + + /* + * Query touchpad's firmware version and see if it reports known + * value to avoid mis-detection. Logitech mice are known to respond + * to Elantech magic knock and there might be more. + */ + if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) { + pr_debug("elantech.c: failed to query firmware version.\n"); + return -1; + } + + pr_debug("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n", + param[0], param[1], param[2]); + + if (param[0] == 0 || param[1] != 0) { + pr_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n"); return -1; } @@ -600,8 +619,7 @@ int elantech_init(struct psmouse *psmouse) int i, error; unsigned char param[3]; - etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL); - psmouse->private = etd; + psmouse->private = etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL); if (!etd) return -1; @@ -610,14 +628,12 @@ int elantech_init(struct psmouse *psmouse) etd->parity[i] = etd->parity[i & (i - 1)] ^ 1; /* - * Find out what version hardware this is + * Do the version query again so we can store the result */ if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) { pr_err("elantech.c: failed to query firmware version.\n"); goto init_fail; } - pr_info("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n", - param[0], param[1], param[2]); etd->fw_version_maj = param[0]; etd->fw_version_min = param[2]; -- cgit v1.2.3