linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Deepak Saxena <dsaxena@laptop.org>
To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org
Cc: pgf@laptop.org, Andres Salomon <dilinger@queued.net>
Subject: [PATCH 2/2] Recover from failed recalibration for OLPC touchpad
Date: Tue, 16 Dec 2008 11:45:09 -0800	[thread overview]
Message-ID: <20081216194509.GB15380@trantor.hsd1.or.comcast.net> (raw)

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>
---
 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_/_
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

             reply	other threads:[~2008-12-16 19:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-16 19:45 Deepak Saxena [this message]
2008-12-16 19:53 ` [PATCH 2/2] Recover from failed recalibration for OLPC touchpad Andres Salomon
2008-12-16 21:00   ` pgf
  -- strict thread matches above, loose matches on Subject: below --
2008-12-20 10:49 Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081216194509.GB15380@trantor.hsd1.or.comcast.net \
    --to=dsaxena@laptop.org \
    --cc=dilinger@queued.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=pgf@laptop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).