summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPaul Irofti <pirofti@cvs.openbsd.org>2009-08-13 21:15:04 +0000
committerPaul Irofti <pirofti@cvs.openbsd.org>2009-08-13 21:15:04 +0000
commitfe6f88cb9b76466c202050fac0fe412f7c883bd5 (patch)
tree7f4a5766dc4c4b288a5b0a07a31711aeb6e57d8b /sys
parentce1f2b4fdc3b042dec1a9751ad20b746a2ba2bcc (diff)
Add wake/suspend support for pckbd(4).
Patch initially from mlarkin@. KNF and refactoring by me. Suggestions and okay deraadt@.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pckbc/pckbd.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/sys/dev/pckbc/pckbd.c b/sys/dev/pckbc/pckbd.c
index 277e1cfb4e0..cb0d797939c 100644
--- a/sys/dev/pckbc/pckbd.c
+++ b/sys/dev/pckbc/pckbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pckbd.c,v 1.17 2009/05/03 13:02:35 miod Exp $ */
+/* $OpenBSD: pckbd.c,v 1.18 2009/08/13 21:15:03 pirofti Exp $ */
/* $NetBSD: pckbd.c,v 1.24 2000/06/05 22:20:57 sommerfeld Exp $ */
/*-
@@ -123,9 +123,14 @@ static int pckbd_is_console(pckbc_tag_t, pckbc_slot_t);
int pckbdprobe(struct device *, void *, void *);
void pckbdattach(struct device *, struct device *, void *);
+int pckbd_activate(struct device *, enum devact);
struct cfattach pckbd_ca = {
- sizeof(struct pckbd_softc), pckbdprobe, pckbdattach,
+ sizeof(struct pckbd_softc),
+ pckbdprobe,
+ pckbdattach,
+ NULL,
+ pckbd_activate
};
int pckbd_enable(void *, int);
@@ -402,6 +407,20 @@ pckbdattach(parent, self, aux)
}
int
+pckbd_activate(struct device *self, enum devact act)
+{
+ switch (act) {
+ case DVACT_ACTIVATE:
+ if (!cold)
+ pckbd_enable(self, 1);
+ case DVACT_DEACTIVATE:
+ if (!cold)
+ pckbd_enable(self, 0);
+ }
+ return (0);
+}
+
+int
pckbd_enable(v, on)
void *v;
int on;