summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJoshua Stein <jcs@cvs.openbsd.org>2017-02-14 15:47:13 +0000
committerJoshua Stein <jcs@cvs.openbsd.org>2017-02-14 15:47:13 +0000
commit949dbcb60754f82bc33fe38bbbad17f1875f9d1e (patch)
tree14be04e49e17a1fa93b6d5195d082928ad2e16b2 /sys
parenta1780750f93111501158e2aeabbdda3a89fea1aa (diff)
asmc: on system resume, restore the keyboard backlight value
ok various
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/isa/asmc.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/isa/asmc.c b/sys/dev/isa/asmc.c
index dc076d332de..4da10d44763 100644
--- a/sys/dev/isa/asmc.c
+++ b/sys/dev/isa/asmc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asmc.c,v 1.30 2016/04/22 20:45:53 jung Exp $ */
+/* $OpenBSD: asmc.c,v 1.31 2017/02/14 15:47:12 jcs Exp $ */
/*
* Copyright (c) 2015 Joerg Jung <jung@openbsd.org>
*
@@ -92,6 +92,7 @@ void asmc_update(void *);
int asmc_match(struct device *, void *, void *);
void asmc_attach(struct device *, struct device *, void *);
int asmc_detach(struct device *, int);
+int asmc_activate(struct device *, int);
/* wskbd hook functions */
void asmc_backlight(void *);
@@ -101,7 +102,7 @@ extern int (*wskbd_get_backlight)(struct wskbd_backlight *);
extern int (*wskbd_set_backlight)(struct wskbd_backlight *);
const struct cfattach asmc_ca = {
- sizeof(struct asmc_softc), asmc_match, asmc_attach
+ sizeof(struct asmc_softc), asmc_match, asmc_attach, NULL, asmc_activate
};
struct cfdriver asmc_cd = {
@@ -358,6 +359,20 @@ asmc_detach(struct device *self, int flags)
return 0;
}
+int
+asmc_activate(struct device *self, int act)
+{
+ struct asmc_softc *sc = (struct asmc_softc *)self;
+
+ switch (act) {
+ case DVACT_WAKEUP:
+ asmc_backlight(sc);
+ break;
+ }
+
+ return 0;
+}
+
void
asmc_backlight(void *arg)
{