diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2014-12-10 12:27:58 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2014-12-10 12:27:58 +0000 |
commit | 9ce9e30960b2e6222a244e6166aea039ac6e9239 (patch) | |
tree | 212abc4dfaf05d91acce75be7ded7a8eac5e95e7 /sys/arch/armv7/omap | |
parent | 77392a36ec6c525667e826c787c431b014f99298 (diff) |
Convert watchdog(4) devices to use autoconf(9) framework.
ok deraadt, tests on glxpcib and ok mpi
Diffstat (limited to 'sys/arch/armv7/omap')
-rw-r--r-- | sys/arch/armv7/omap/omdog.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/sys/arch/armv7/omap/omdog.c b/sys/arch/armv7/omap/omdog.c index a8fb5d4855d..d3d54a5e073 100644 --- a/sys/arch/armv7/omap/omdog.c +++ b/sys/arch/armv7/omap/omdog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: omdog.c,v 1.4 2014/11/01 07:08:43 jsg Exp $ */ +/* $OpenBSD: omdog.c,v 1.5 2014/12/10 12:27:56 mikeb Exp $ */ /* * Copyright (c) 2013 Federico G. Schwindt <fgsch@openbsd.org> * Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org> @@ -57,6 +57,7 @@ struct omdog_softc { struct omdog_softc *omdog_sc; void omdog_attach(struct device *, struct device *, void *); +int omdog_activate(struct device *, int); void omdog_start(struct omdog_softc *); void omdog_stop(struct omdog_softc *); void omdog_sync(struct omdog_softc *); @@ -64,7 +65,7 @@ int omdog_cb(void *, int); void omdog_reset(void); struct cfattach omdog_ca = { - sizeof (struct omdog_softc), NULL, omdog_attach + sizeof (struct omdog_softc), NULL, omdog_attach, NULL, omdog_activate }; struct cfdriver omdog_cd = { @@ -95,6 +96,20 @@ omdog_attach(struct device *parent, struct device *self, void *args) #endif } +int +omdog_activate(struct device *self, int act) +{ + switch (act) { + case DVACT_POWERDOWN: +#ifndef SMALL_KERNEL + wdog_shutdown(self); +#endif + break; + } + + return (0); +} + void omdog_start(struct omdog_softc *sc) { |