[PATCH 2/2] Recover from failed recalibration for OLPC touchpad

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
Signed-off-by: Deepak Saxena <dsaxena@xxxxxxxxxx>
---
 drivers/input/mouse/hgpk.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/input/mouse/hgpk.c b/drivers/input/mouse/hgpk.c
index 39cce65..9548e1c 100644
--- a/drivers/input/mouse/hgpk.c
+++ b/drivers/input/mouse/hgpk.c
@@ -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;
 	}
 
@@ -245,8 +248,12 @@ static int hgpk_force_recalibrate(struct psmouse *psmouse)
 	 * (below) is our best option for now.
 	 */
 
-	if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE))
+	if (ps2_command(ps2dev, NULL, PSMOUSE_CMD_ENABLE)) {
+		psmouse_set_state(psmouse, PSMOUSE_ACTIVATED);
+		psmouse_queue_work(psmouse, &priv->recalib_wq,
+				   msecs_to_jiffies(500));
 		return -1;
+	}
 
 	psmouse_set_state(psmouse, PSMOUSE_ACTIVATED);
 
-- 
 Deepak Saxena - Kernel Developer, One Laptop Per Child
   _____   __o                                   (o>
------    -\<,  Give One Laptop, Get One Laptop  //\
 ----- ( )/ ( )  http://www.amazon.com/xo        V_/_
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux