Skip to contentSkip to conversation

Recover from failed recalibration for OLPC touchpad

PATCH Dmitry Torokhov 1 participant 1 message Dec 20, 2008 HID

lore
Share & tools
lore
#0 lore raw
Quoted 36 lines · On Tuesday 16 December 2008 13:00:18 [email protected] wrote:
Quoted 35 lines · andres

On Tue, 16 Dec 2008 11:45:09 -0800

Quoted 5 lines · Deepak Saxena

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

The bug lacks details regarding testing, see below.

Quoted 11 lines
---
 drivers/input/mouse/hgpk.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
drivers/input/mouse/hgpk.c +0 -0
index 39cce65..9548e1c 100644

drivers/input/mouse/hgpk.c static int hgpk_force_recalibrate(struct psmouse · line 240

Quoted 8 lines
drivers/input/mouse/hgpk.c +3 -0
@@ -233,6 +233,9 @@ static int hgpk_force_recalibrate(struct psmouse
 *psmouse) ps2_command(ps2dev, NULL, 0xf5) ||
 	    ps2_command(ps2dev, NULL, 0xe6) ||
 	    ps2_command(ps2dev, NULL, 0xf5)) {
+ 		psmouse_set_state(psmouse, PSMOUSE_ACTIVATED);
+ 		psmouse_queue_work(psmouse, &priv->recalib_wq,
+				   msecs_to_jiffies(500));
 		return -1;
 	}

Do we know why the ps2 commands are failing? Do we really want to keep trying to recalibrate if something's screwy with ps2, rather than (say) completely reinitializing the driver?

Quoted 8 lines
Quoted 1 line

Paul, did you manage to reproduce the problem with this patch applied?

i used to see this problem regularly (the mouse simply stops working), and could reproduce it readily. i was not able to reproduce it after applying the fix.

(that being said, i didn't look into why the ps2 commands were failing.)

I am not comfortable with the idea of endlessly recalibrating if device gets really screwy. I'd rather see a patch that did that 3-5 times and then issued complete reinitialization.

Thanks.

Signature · 1 line
Dmitry