summaryrefslogtreecommitdiffstats
path: root/sys/isa/atrtc.c
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>2000-06-23 07:44:33 +0000
committermsmith <msmith@FreeBSD.org>2000-06-23 07:44:33 +0000
commitdd93fd16a6696fe0c9c1b69539b2ac899c04978e (patch)
treeced3f143f58f67f9f3e1a80e95d8b0ab2df4a6ae /sys/isa/atrtc.c
parent9d946aa74ddb86df33489ee80770826d8dc37705 (diff)
downloadFreeBSD-src-dd93fd16a6696fe0c9c1b69539b2ac899c04978e.zip
FreeBSD-src-dd93fd16a6696fe0c9c1b69539b2ac899c04978e.tar.gz
Add PnP probe methods to some common AT hardware drivers. In each case,
the PnP probe is merely a stub as we make assumptions about some of this hardware before we have probed it. Since these devices (with the exception of the speaker) are 'standard', suppress output in the !bootverbose case to clean up the probe messages somewhat.
Diffstat (limited to 'sys/isa/atrtc.c')
-rw-r--r--sys/isa/atrtc.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/sys/isa/atrtc.c b/sys/isa/atrtc.c
index 465ea98..b75f775 100644
--- a/sys/isa/atrtc.c
+++ b/sys/isa/atrtc.c
@@ -53,6 +53,7 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/bus.h>
#include <sys/time.h>
#include <sys/timetc.h>
#include <sys/kernel.h>
@@ -82,6 +83,7 @@
#include <i386/isa/icu.h>
#include <i386/isa/isa.h>
#include <isa/rtc.h>
+#include <isa/isavar.h>
#include <i386/isa/timerreg.h>
#include <i386/isa/intr_machdep.h>
@@ -1229,3 +1231,49 @@ tsc_get_timecount(struct timecounter *tc)
{
return (rdtsc());
}
+
+/*
+ * Attach to the ISA PnP descriptors for the timer and realtime clock.
+ */
+static struct isa_pnp_id attimer_ids[] = {
+ { 0x0001d041 /* PNP0100 */, "AT timer" },
+ { 0x000bd041 /* PNP0B00 */, "AT realtime clock" },
+ { 0 }
+};
+
+static int
+attimer_probe(device_t dev)
+{
+ int result;
+
+ if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, attimer_ids)) <= 0)
+ device_quiet(dev);
+ return(result);
+}
+
+static int
+attimer_attach(device_t dev)
+{
+ return(0);
+}
+
+static device_method_t attimer_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, attimer_probe),
+ DEVMETHOD(device_attach, attimer_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend), /* XXX stop statclock? */
+ DEVMETHOD(device_resume, bus_generic_resume), /* XXX restart statclock? */
+ { 0, 0 }
+};
+
+static driver_t attimer_driver = {
+ "attimer",
+ attimer_methods,
+ 1, /* no softc */
+};
+
+static devclass_t attimer_devclass;
+
+DRIVER_MODULE(attimer, isa, attimer_driver, attimer_devclass, 0, 0);
OpenPOWER on IntegriCloud