From: Pavel Machek <pavel@ucw.cz>
To: vojtech@ucw.cz, kernel list <linux-kernel@vger.kernel.org>
Subject: suspend/resume support for i8042
Date: Sun, 16 Nov 2003 14:05:27 +0100 [thread overview]
Message-ID: <20031116130527.GA243@elf.ucw.cz> (raw)
Hi!
How does this one look?
I'm not 100% sure it is the correct way, because if I try to handle
mouse the same way, I loose keyboard :-(. Any ideas how to do this
better?
Pavel
--- tmp/linux/drivers/input/serio/i8042.c 2003-11-16 13:57:24.000000000 +0100
+++ linux/drivers/input/serio/i8042.c 2003-11-15 23:42:43.000000000 +0100
@@ -18,6 +18,7 @@
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/serio.h>
+#include <linux/sysdev.h>
#include <asm/io.h>
@@ -780,6 +781,33 @@
values->mux = index;
}
+static int i8042_resume_port(struct serio *port)
+{
+ struct serio_dev *dev = port->dev;
+ if (dev) {
+ dev->disconnect(port);
+ dev->connect(port, dev);
+ }
+}
+
+static int i8042_resume(struct sys_device *dev)
+{
+ if (i8042_controller_init())
+ printk(KERN_ERR "i8042: resume failed\n");
+ i8042_resume_port(&i8042_kbd_port);
+ return 0;
+}
+
+static struct sysdev_class kbc_sysclass = {
+ set_kset_name("i8042"),
+ .resume = i8042_resume,
+};
+
+static struct sys_device device_i8042 = {
+ .id = 0,
+ .cls = &kbc_sysclass,
+};
+
int __init i8042_init(void)
{
int i;
@@ -816,6 +845,14 @@
register_reboot_notifier(&i8042_notifier);
+ {
+ int error = sysdev_class_register(&kbc_sysclass);
+ if (!error)
+ error = sys_device_register(&device_i8042);
+ if (error)
+ printk(KERN_CRIT "Unable to register i8042 to driver model\n");
+ }
+
return 0;
}
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
reply other threads:[~2003-11-16 13:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20031116130527.GA243@elf.ucw.cz \
--to=pavel@ucw.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
Powered by JetHome