summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Fox <pgf@laptop.org>2008-12-11 15:18:47 -0800
committerDeepak Saxena <dsaxena@laptop.org>2008-12-11 15:45:20 -0800
commit7ff0726bf83303d0260e2ab850407b03632bfa23 (patch)
tree361ad4652c937d969dcf4d262b888503efb97eb7
parent07ef81ffc7658ba7ed41580270870380e5ecc40c (diff)
downloadlwn-7ff0726bf83303d0260e2ab850407b03632bfa23.tar.gz
lwn-7ff0726bf83303d0260e2ab850407b03632bfa23.zip
Recover from failed recalibration for OLPC touchpad
Sometimes the the HPGK touchpad will fail to properly respond to a ps2_command() during recalibration. This patch works around that issue be scheduling another recalibration if this happens. This solves http://dev.laptop.org/ticket/9008 Signed-off-by: Paul Fox <pgf@laptop.org> Signed-off-by: Deepak Saxena <dsaxena@laptop.org>
-rw-r--r--drivers/input/mouse/olpc.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/input/mouse/olpc.c b/drivers/input/mouse/olpc.c
index f127dc081d39..dc24e351b463 100644
--- a/drivers/input/mouse/olpc.c
+++ b/drivers/input/mouse/olpc.c
@@ -245,8 +245,12 @@ static int hgpk_force_recalibrate(struct psmouse *psmouse)
if (ps2_command(ps2dev, NULL, 0xf5) ||
ps2_command(ps2dev, NULL, 0xf5) ||
ps2_command(ps2dev, NULL, 0xe6) ||
- ps2_command(ps2dev, NULL, 0xf5))
+ ps2_command(ps2dev, NULL, 0xf5)) {
+ psmouse_set_state(psmouse, PSMOUSE_ACTIVATED);
+ queue_delayed_work(kpsmoused_wq, &priv->recalib_wq,
+ msecs_to_jiffies(500));
return -1;
+ }
/* according to ALPS, 150mS is required for recalibration */
@@ -258,8 +262,12 @@ static int hgpk_force_recalibrate(struct psmouse *psmouse)
* we may need to work around that here.
*/
- if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE))
+ if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE)) {
+ psmouse_set_state(psmouse, PSMOUSE_ACTIVATED);
+ queue_delayed_work(kpsmoused_wq, &priv->recalib_wq,
+ msecs_to_jiffies(500));
return -1;
+ }
psmouse_set_state(psmouse, PSMOUSE_ACTIVATED);