All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@suse.cz>
To: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: [PATCH 5/11] input: Fix resume of PS/2 mouse
Date: Fri, 19 Sep 2003 12:26:41 +0200	[thread overview]
Message-ID: <10639672012942@twilight.ucw.cz> (raw)
In-Reply-To: <1063967201965@twilight.ucw.cz>

You can pull this changeset from:
	bk://kernel.bkbits.net/vojtech/input

===================================================================

ChangeSet@1.1343, 2003-09-19 01:18:46-07:00, petero2@telia.com
  psmouse-base.c:
    Fix resume of PS/2 mouse. Uses old PM interface at the moment.


 psmouse-base.c |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+)

===================================================================

diff -Nru a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
--- a/drivers/input/mouse/psmouse-base.c	Fri Sep 19 12:16:24 2003
+++ b/drivers/input/mouse/psmouse-base.c	Fri Sep 19 12:16:24 2003
@@ -17,6 +17,7 @@
 #include <linux/input.h>
 #include <linux/serio.h>
 #include <linux/init.h>
+#include <linux/pm.h>
 #include "psmouse.h"
 #include "synaptics.h"
 #include "logips2pp.h"
@@ -512,6 +513,30 @@
 }
 
 /*
+ * Reinitialize mouse hardware after software suspend.
+ */
+
+static int psmouse_pm_callback(struct pm_dev *dev, pm_request_t request, void *data)
+{
+	struct psmouse *psmouse = dev->data;
+	struct serio_dev *ser_dev = psmouse->serio->dev;
+
+	synaptics_disconnect(psmouse);
+
+	/* We need to reopen the serio port to reinitialize the i8042 controller */
+	serio_close(psmouse->serio);
+	serio_open(psmouse->serio, ser_dev);
+
+	/* Probe and re-initialize the mouse */
+	psmouse_probe(psmouse);
+	psmouse_initialize(psmouse);
+	synaptics_pt_init(psmouse);
+	psmouse_activate(psmouse);
+
+	return 0;
+}
+
+/*
  * psmouse_connect() is a callback from the serio module when
  * an unhandled serio port is found.
  */
@@ -519,6 +544,7 @@
 static void psmouse_connect(struct serio *serio, struct serio_dev *dev)
 {
 	struct psmouse *psmouse;
+	struct pm_dev *pmdev;
 	
 	if ((serio->type & SERIO_TYPE) != SERIO_8042 &&
 	    (serio->type & SERIO_TYPE) != SERIO_PS_PSTHRU)
@@ -551,6 +577,12 @@
 		return;
 	}
 	
+	pmdev = pm_register(PM_SYS_DEV, PM_SYS_UNKNOWN, psmouse_pm_callback);
+	if (pmdev) {
+		psmouse->dev.pm_dev = pmdev;
+		pmdev->data = psmouse;
+	}
+
 	sprintf(psmouse->devname, "%s %s %s",
 		psmouse_protocols[psmouse->type], psmouse->vendor, psmouse->name);
 	sprintf(psmouse->phys, "%s/input0",


  reply	other threads:[~2003-09-19 10:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-19 10:26 [PATCH 1/11] input: Restore synaptics pad mode on module unload Vojtech Pavlik
2003-09-19 10:26 ` [PATCH 2/11] input: Forced release of keys on AT kbds Vojtech Pavlik
2003-09-19 10:26   ` [PATCH 3/11] input: Fix Sega Saturn pad support Vojtech Pavlik
2003-09-19 10:26     ` [PATCH 4/11] input: Big Synaptics pad update Vojtech Pavlik
2003-09-19 10:26       ` Vojtech Pavlik [this message]
2003-09-19 10:26         ` [PATCH 6/11] input: Change name of Synaptics protocol to SynPS/2 Vojtech Pavlik
2003-09-19 10:26           ` [PATCH 7/11] input: Fix psmouse->pktcnt in Synaptics mode Vojtech Pavlik
2003-09-19 10:26             ` [PATCH 8/11] input: Fix the INPUT_KEYCODE macro and its usage Vojtech Pavlik
2003-09-19 10:26               ` [PATCH 9/11] input: Enlarge the timeout for PS/2 mouse full reset Vojtech Pavlik
2003-09-19 10:26                 ` [PATCH 10/11] input: Fix I-Force sleeping issues Vojtech Pavlik
2003-09-19 10:26                   ` [PATCH 11/11] input: Claim serio early in serio_open() Vojtech Pavlik
2003-09-21 13:02             ` [PATCH 7/11] input: Fix psmouse->pktcnt in Synaptics mode Peter Osterlund
2003-09-21 17:19               ` Vojtech Pavlik
2003-09-22 14:20         ` [PATCH 5/11] input: Fix resume of PS/2 mouse Pavel Machek
2003-09-20 20:31 ` [PATCH 1/11] input: Restore synaptics pad mode on module unload jhf

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=10639672012942@twilight.ucw.cz \
    --to=vojtech@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.