summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2014-12-10 12:27:58 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2014-12-10 12:27:58 +0000
commit9ce9e30960b2e6222a244e6166aea039ac6e9239 (patch)
tree212abc4dfaf05d91acce75be7ded7a8eac5e95e7 /sys/arch/i386
parent77392a36ec6c525667e826c787c431b014f99298 (diff)
Convert watchdog(4) devices to use autoconf(9) framework.
ok deraadt, tests on glxpcib and ok mpi
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/esm.c18
-rw-r--r--sys/arch/i386/pci/elan520.c18
-rw-r--r--sys/arch/i386/pci/geodesc.c20
3 files changed, 50 insertions, 6 deletions
diff --git a/sys/arch/i386/i386/esm.c b/sys/arch/i386/i386/esm.c
index 54f9f6dd8e1..0f3e9f1fc43 100644
--- a/sys/arch/i386/i386/esm.c
+++ b/sys/arch/i386/i386/esm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: esm.c,v 1.56 2014/09/14 14:17:23 jsg Exp $ */
+/* $OpenBSD: esm.c,v 1.57 2014/12/10 12:27:56 mikeb Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -45,6 +45,7 @@ int esmdebug = 3;
int esm_match(struct device *, void *, void *);
void esm_attach(struct device *, struct device *, void *);
+int esm_activate(struct device *, int);
enum esm_sensor_type {
ESM_S_UNKNOWN, /* XXX */
@@ -124,7 +125,8 @@ struct esm_softc {
};
struct cfattach esm_ca = {
- sizeof(struct esm_softc), esm_match, esm_attach
+ sizeof(struct esm_softc), esm_match, esm_attach,
+ NULL, esm_activate
};
struct cfdriver esm_cd = {
@@ -274,6 +276,18 @@ esm_attach(struct device *parent, struct device *self, void *aux)
}
int
+esm_activate(struct device *self, int act)
+{
+ switch (act) {
+ case DVACT_POWERDOWN:
+ wdog_shutdown(self);
+ break;
+ }
+
+ return (0);
+}
+
+int
esm_watchdog(void *arg, int period)
{
struct esm_softc *sc = arg;
diff --git a/sys/arch/i386/pci/elan520.c b/sys/arch/i386/pci/elan520.c
index bf077dd7c43..c6fdf943de5 100644
--- a/sys/arch/i386/pci/elan520.c
+++ b/sys/arch/i386/pci/elan520.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: elan520.c,v 1.20 2014/09/14 14:17:23 jsg Exp $ */
+/* $OpenBSD: elan520.c,v 1.21 2014/12/10 12:27:56 mikeb Exp $ */
/* $NetBSD: elan520.c,v 1.4 2002/10/02 05:47:15 thorpej Exp $ */
/*-
@@ -70,6 +70,7 @@ struct elansc_softc {
int elansc_match(struct device *, void *, void *);
void elansc_attach(struct device *, struct device *, void *);
+int elansc_activate(struct device *, int);
void elansc_update_cpuspeed(void);
void elansc_setperf(int);
int elansc_cpuspeed(int *);
@@ -86,7 +87,8 @@ void elansc_gpio_pin_ctl(void *, int, int);
u_int elansc_tc_read(struct timecounter *);
struct cfattach elansc_ca = {
- sizeof(struct elansc_softc), elansc_match, elansc_attach
+ sizeof(struct elansc_softc), elansc_match, elansc_attach,
+ NULL, elansc_activate
};
struct cfdriver elansc_cd = {
@@ -231,6 +233,18 @@ elansc_attach(struct device *parent, struct device *self, void *aux)
tc_init(tc);
}
+int
+elansc_activate(struct device *self, int act)
+{
+ switch (act) {
+ case DVACT_POWERDOWN:
+ wdog_shutdown(self);
+ break;
+ }
+
+ return (0);
+}
+
u_int
elansc_tc_read(struct timecounter *tc)
{
diff --git a/sys/arch/i386/pci/geodesc.c b/sys/arch/i386/pci/geodesc.c
index b903ece0fc5..53415de9816 100644
--- a/sys/arch/i386/pci/geodesc.c
+++ b/sys/arch/i386/pci/geodesc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: geodesc.c,v 1.12 2012/12/05 23:20:12 deraadt Exp $ */
+/* $OpenBSD: geodesc.c,v 1.13 2014/12/10 12:27:56 mikeb Exp $ */
/*
* Copyright (c) 2003 Markus Friedl <markus@openbsd.org>
@@ -41,6 +41,7 @@ struct geodesc_softc {
int geodesc_match(struct device *, void *, void *);
void geodesc_attach(struct device *, struct device *, void *);
+int geodesc_activate(struct device *, int);
void sc1100_sysreset(void);
#ifndef SMALL_KERNEL
@@ -48,7 +49,8 @@ int geodesc_wdogctl_cb(void *, int);
#endif /* SMALL_KERNEL */
struct cfattach geodesc_ca = {
- sizeof(struct geodesc_softc), geodesc_match, geodesc_attach
+ sizeof(struct geodesc_softc), geodesc_match, geodesc_attach,
+ NULL, geodesc_activate
};
struct cfdriver geodesc_cd = {
@@ -131,6 +133,20 @@ geodesc_attach(struct device *parent, struct device *self, void *aux)
cpuresetfn = sc1100_sysreset;
}
+int
+geodesc_activate(struct device *self, int act)
+{
+ switch (act) {
+ case DVACT_POWERDOWN:
+#ifndef SMALL_KERNEL
+ wdog_shutdown(self);
+#endif
+ break;
+ }
+
+ return (0);
+}
+
#ifndef SMALL_KERNEL
int
geodesc_wdogctl_cb(void *self, int period)