From: Dmitry Torokhov <dtor_core@ameritech.net>
To: linux-input@atrey.karlin.mff.cuni.cz
Cc: linux-kernel@vger.kernel.org, Vojtech Pavlik <vojtech@ucw.cz>
Subject: [PATCH] Add resume support to serio bus.
Date: Sun, 6 Feb 2005 02:46:20 -0500 [thread overview]
Message-ID: <200502060246.20878.dtor_core@ameritech.net> (raw)
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;
next reply other threads:[~2005-02-06 7:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-06 7:46 Dmitry Torokhov [this message]
2005-02-06 9:17 ` Vojtech Pavlik
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=200502060246.20878.dtor_core@ameritech.net \
--to=dtor_core@ameritech.net \
--cc=linux-input@atrey.karlin.mff.cuni.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=vojtech@ucw.cz \
/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
all inboxes | Powered by JetHome®