diff --git a/sys/arch/macppc/dev/adb.c b/sys/arch/macppc/dev/adb.c index 5973391b949d..ec3bc4adac96 100644 --- a/sys/arch/macppc/dev/adb.c +++ b/sys/arch/macppc/dev/adb.c @@ -1,4 +1,4 @@ -/* $NetBSD: adb.c,v 1.20 2006/09/13 03:37:20 gdamore Exp $ */ +/* $NetBSD: adb.c,v 1.21 2006/12/10 19:28:12 macallan Exp $ */ /*- * Copyright (C) 1994 Bradley A. Grantham @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.20 2006/09/13 03:37:20 gdamore Exp $"); +__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.21 2006/12/10 19:28:12 macallan Exp $"); #include #include @@ -42,6 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.20 2006/09/13 03:37:20 gdamore Exp $"); #include #include +#include #include #include @@ -113,7 +114,7 @@ adbattach(parent, self, aux) ADBDataBlock adbdata; struct adb_attach_args aa_args; int totaladbs; - int adbindex, adbaddr; + int adbindex, adbaddr, adb_node; extern volatile u_char *Via1Base; @@ -134,7 +135,9 @@ adbattach(parent, self, aux) printf(" irq %d: ", irq); adb_polling = 1; - ADBReInit(); + adb_node = getnodebyname(ca->ca_node, "adb"); + if (adb_node) + ADBReInit(); switch (adbHardware) { case ADB_HW_CUDA: @@ -146,6 +149,25 @@ adbattach(parent, self, aux) break; } + adb_todr_init(); + +#if NAPM > 0 + /* Magic for signalling the apm driver to match. */ + aa_args.origaddr = ADBADDR_APM; + aa_args.adbaddr = ADBADDR_APM; + aa_args.handler_id = ADBADDR_APM; + + (void)config_found(self, &aa_args, NULL); +#endif + + /* + * see if we're supposed to have an ADB bus + * since some PowerBooks don't have one and their PMUs barf on ADB + * commands we bail here if there's no adb node + */ + if (!adb_node) + return; + #ifdef ADB_DEBUG if (adb_debug) printf("adb: done with ADBReInit\n"); @@ -174,20 +196,10 @@ adbattach(parent, self, aux) (void)config_found(self, &aa_args, adbprint); } -#if NAPM > 0 - /* Magic for signalling the apm driver to match. */ - aa_args.origaddr = ADBADDR_APM; - aa_args.adbaddr = ADBADDR_APM; - aa_args.handler_id = ADBADDR_APM; - - (void)config_found(self, &aa_args, NULL); -#endif - if (adbHardware == ADB_HW_CUDA) adb_cuda_autopoll(); adb_polling = 0; - adb_todr_init(); } int