mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Add resume support to serio bus.
@ 2005-02-06  7:46 Dmitry Torokhov
  2005-02-06  9:17 ` Vojtech Pavlik
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Torokhov @ 2005-02-06  7:46 UTC (permalink / raw)
  To: linux-input; +Cc: linux-kernel, Vojtech Pavlik

Hi,

This patch adds resume support to serio_bus based on serio reconnect
framework so now not only i8042 ports will be re-initialized at resume.
It also removes serio_reconnect calls from i8042 as they no longer
needed.

Tested on S4 (swsusp) with Synaptics touchpad.

-- 
Dmitry


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


ChangeSet@1.2007, 2005-02-06 02:39:30-05:00, dtor_core@ameritech.net
  Input: add resume method to serio bus so ports are properly
         set up at resume time. Remove calls to serio_reconnect
         from i8042 as they should now be reconnected in course
         of regular resume process.
  
  Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


 i8042.c |    8 ++++----
 serio.c |   17 +++++++++++++++++
 2 files changed, 21 insertions(+), 4 deletions(-)


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



diff -Nru a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
--- a/drivers/input/serio/i8042.c	2005-02-06 02:40:01 -05:00
+++ b/drivers/input/serio/i8042.c	2005-02-06 02:40:01 -05:00
@@ -899,7 +899,7 @@
  * Here we try to restore the original BIOS settings
  */
 
-static int i8042_suspend(struct device *dev, u32 state, u32 level)
+static int i8042_suspend(struct device *dev, pm_message_t state, u32 level)
 {
 	if (level == SUSPEND_DISABLE) {
 		del_timer_sync(&i8042_timer);
@@ -932,12 +932,12 @@
 		}
 
 /*
- * Reconnect anything that was connected to the ports.
+ * Activate all ports.
  */
 
 	for (i = 0; i < I8042_NUM_PORTS; i++)
-		if (i8042_activate_port(&i8042_ports[i]) == 0)
-			serio_reconnect(i8042_ports[i].serio);
+		i8042_activate_port(&i8042_ports[i]);
+
 /*
  * Restart timer (for polling "stuck" data)
  */
diff -Nru a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
--- a/drivers/input/serio/serio.c	2005-02-06 02:40:01 -05:00
+++ b/drivers/input/serio/serio.c	2005-02-06 02:40:01 -05:00
@@ -774,6 +774,22 @@
 
 #endif /* CONFIG_HOTPLUG */
 
+static int serio_resume(struct device *dev)
+{
+	struct serio *serio = to_serio_port(dev);
+
+	if (!serio->drv || !serio->drv->reconnect || serio->drv->reconnect(serio)) {
+		serio_disconnect_port(serio);
+		/*
+		 * Driver re-probing can take a while, so better let kseriod
+		 * deal with it.
+		 */
+		serio_rescan(serio);
+	}
+
+	return 0;
+}
+
 /* called from serio_driver->connect/disconnect methods under serio_sem */
 int serio_open(struct serio *serio, struct serio_driver *drv)
 {
@@ -826,6 +842,7 @@
 	serio_bus.drv_attrs = serio_driver_attrs;
 	serio_bus.match = serio_bus_match;
 	serio_bus.hotplug = serio_hotplug;
+	serio_bus.resume = serio_resume;
 	bus_register(&serio_bus);
 
 	return 0;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-06  9:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-06  7:46 [PATCH] Add resume support to serio bus Dmitry Torokhov
2005-02-06  9:17 ` Vojtech Pavlik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®