From 99c90ab31fad855b9da9dee3a5aa6c27f263e9d6 Mon Sep 17 00:00:00 2001 From: Akio Idehara Date: Fri, 24 Feb 2012 00:33:22 -0800 Subject: Input: ALPS - fix touchpad detection when buttons are pressed ALPS touchpad detection fails if some buttons of ALPS are pressed. The reason is that the "E6" query response byte is different from what is expected. This was tested on a Toshiba Portege R500. Cc: stable Signed-off-by: Akio Idehara Tested-by: Seth Forshee Signed-off-by: Dmitry Torokhov diff --git a/Documentation/input/alps.txt b/Documentation/input/alps.txt index f274c28..2f95308 100644 --- a/Documentation/input/alps.txt +++ b/Documentation/input/alps.txt @@ -13,7 +13,8 @@ Detection All ALPS touchpads should respond to the "E6 report" command sequence: E8-E6-E6-E6-E9. An ALPS touchpad should respond with either 00-00-0A or -00-00-64. +00-00-64 if no buttons are pressed. The bits 0-2 of the first byte will be 1s +if some buttons are pressed. If the E6 report is successful, the touchpad model is identified using the "E7 report" sequence: E8-E7-E7-E7-E9. The response is the model signature and is diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index bd87380..4c6a72d 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -952,7 +952,9 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int /* * First try "E6 report". - * ALPS should return 0,0,10 or 0,0,100 + * ALPS should return 0,0,10 or 0,0,100 if no buttons are pressed. + * The bits 0-2 of the first byte will be 1s if some buttons are + * pressed. */ param[0] = 0; if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) || @@ -968,7 +970,8 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int psmouse_dbg(psmouse, "E6 report: %2.2x %2.2x %2.2x", param[0], param[1], param[2]); - if (param[0] != 0 || param[1] != 0 || (param[2] != 10 && param[2] != 100)) + if ((param[0] & 0xf8) != 0 || param[1] != 0 || + (param[2] != 10 && param[2] != 100)) return NULL; /* -- cgit v0.10.2 From 68513a4c5fe68938350cf2c56d97946e49f014e1 Mon Sep 17 00:00:00 2001 From: Chris Bagwell Date: Wed, 8 Feb 2012 23:08:48 -0800 Subject: Input: wacom - add missing LEDS_CLASS to Kconfig Signed-off-by: Chris Bagwell Signed-off-by: Dmitry Torokhov diff --git a/drivers/input/tablet/Kconfig b/drivers/input/tablet/Kconfig index 58a8775..e53f408 100644 --- a/drivers/input/tablet/Kconfig +++ b/drivers/input/tablet/Kconfig @@ -77,6 +77,8 @@ config TABLET_USB_WACOM tristate "Wacom Intuos/Graphire tablet support (USB)" depends on USB_ARCH_HAS_HCD select USB + select NEW_LEDS + select LEDS_CLASS help Say Y here if you want to use the USB version of the Wacom Intuos or Graphire tablet. Make sure to say Y to "Mouse support" -- cgit v0.10.2 From 02dfc496800dfaf17b650256642f3df86653fe97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heiko=20St=C3=BCbner?= Date: Wed, 8 Feb 2012 23:08:48 -0800 Subject: Input: evdev - fix variable initialisation Commit 509f87c5f564 (evdev - do not block waiting for an event if fd is nonblock) created a code path were it was possible to use retval uninitialized. This could lead to the xorg evdev input driver getting corrupt data and refusing to work with log messages like AUO-Pixcir touchscreen: Read error: Success sg060_keys: Read error: Success AUO-Pixcir touchscreen: Read error: Success sg060_keys: Read error: Success (for drivers auo-pixcir-ts and gpio-keys). Signed-off-by: Heiko Stuebner Acked-by: Dima Zavin Signed-off-by: Dmitry Torokhov diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index afc166f..7df5bfe 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -332,7 +332,7 @@ static ssize_t evdev_write(struct file *file, const char __user *buffer, struct evdev_client *client = file->private_data; struct evdev *evdev = client->evdev; struct input_event event; - int retval; + int retval = 0; if (count < input_event_size()) return -EINVAL; -- cgit v0.10.2 From f3761c0779b62276b5bf84532a81d5dc49bd721f Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 24 Feb 2012 00:51:40 -0800 Subject: Input: twl4030-vibra - use proper guard for PM methods On m68k: drivers/input/misc/twl4030-vibra.c:175:5: warning: "CONFIG_PM" is not defined We should use #ifdef instead of #if and also check CONFIG_PM_SLEEP instead of CONFIG_PM. Reported-by: Geert Uytterhoeven Signed-off-by: Dmitry Torokhov diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c index 3765137..f3bc418 100644 --- a/drivers/input/misc/twl4030-vibra.c +++ b/drivers/input/misc/twl4030-vibra.c @@ -172,7 +172,7 @@ static void twl4030_vibra_close(struct input_dev *input) } /*** Module ***/ -#if CONFIG_PM +#if CONFIG_PM_SLEEP static int twl4030_vibra_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); @@ -189,10 +189,10 @@ static int twl4030_vibra_resume(struct device *dev) vibra_disable_leds(); return 0; } +#endif static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops, twl4030_vibra_suspend, twl4030_vibra_resume); -#endif static int __devinit twl4030_vibra_probe(struct platform_device *pdev) { @@ -273,9 +273,7 @@ static struct platform_driver twl4030_vibra_driver = { .driver = { .name = "twl4030-vibra", .owner = THIS_MODULE, -#ifdef CONFIG_PM .pm = &twl4030_vibra_pm_ops, -#endif }, }; module_platform_driver(twl4030_vibra_driver); -- cgit v0.10.2 From 19d57d3a145e94349abf805eed2316ef720d86c2 Mon Sep 17 00:00:00 2001 From: Jason Gerecke Date: Tue, 6 Mar 2012 10:19:19 -0800 Subject: Input: wacom - fix 3rd-gen Bamboo MT when 4+ fingers are in use The message count field uses three bits of storage, not two. Signed-off-by: Jason Gerecke Acked-by: Chris Bagwell Signed-off-by: Dmitry Torokhov diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 88672ec..cd3ed29 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c @@ -926,7 +926,7 @@ static int wacom_bpt3_touch(struct wacom_wac *wacom) { struct input_dev *input = wacom->input; unsigned char *data = wacom->data; - int count = data[1] & 0x03; + int count = data[1] & 0x07; int i; if (data[0] != 0x02) -- cgit v0.10.2