summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2001-03-29 19:16:17 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2001-03-29 19:16:17 +0000
commit7b9d368458598136a3aa46bf5f6c65db15a98234 (patch)
tree7d93c77588cf97d8e732183bb9ee6247979edd67
parente5d236c6e27e4163df821fc8e1b87b9c4eaa2bc2 (diff)
changes from NetBSD and ftp://nandra.iri.co.jp/pub/NetBSD/macppc/ADB-patch
-rw-r--r--sys/arch/powerpc/mac/pm_direct.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/sys/arch/powerpc/mac/pm_direct.c b/sys/arch/powerpc/mac/pm_direct.c
index 2bf0dfc7373..e4cca717faa 100644
--- a/sys/arch/powerpc/mac/pm_direct.c
+++ b/sys/arch/powerpc/mac/pm_direct.c
@@ -574,6 +574,7 @@ pm_intr_pm1()
printf("pm: PM is not ready. error code=%08x\n", rval);
#endif
splx(s);
+ return;
}
if ((pmdata.data[2] & 0x10) == 0x10) {
@@ -831,26 +832,6 @@ pm_intr_pm2()
s = splhigh();
- for (;;) {
- u_int ifr;
- ifr = read_via_reg(VIA1, vIFR);
-
- if (ifr == 0)
- break;
-
- if (ifr & V1IF_ADBRDY) {
- write_via_reg(VIA1, vIFR, V1IF_ADBRDY);
- ifr &= ~V1IF_ADBRDY;
- delay(120000); /* XXX */
- } else if (ifr & V1IF_ADBCLK) {
- write_via_reg(VIA1, vIFR, V1IF_ADBCLK);
- ifr &= ~V1IF_ADBCLK;
- }
-
- if (ifr)
- write_via_reg(VIA1, vIFR, ifr);
- }
-
PM_VIA_CLR_INTR(); /* clear VIA1 interrupt */
/* ask PM what happend */
pmdata.command = 0x78;
@@ -864,6 +845,7 @@ pm_intr_pm2()
printf("pm: PM is not ready. error code: %08x\n", rval);
#endif
splx(s);
+ return;
}
switch ((u_int)(pmdata.data[2] & 0xff)) {
@@ -906,6 +888,7 @@ pm_intr_pm2()
case 0x16: /* ADB device event */
case 0x18:
case 0x1e:
+ case PMU_INT_WAKEUP:
pm_adb_get_ADB_data(&pmdata);
break;
default:
@@ -999,7 +982,7 @@ pm_adb_op(buffer, compRout, data, command)
int i;
int s;
int rval;
- int delay;
+ int ndelay;
PMData pmdata;
struct adbCommand packet;
@@ -1063,10 +1046,14 @@ pm_adb_op(buffer, compRout, data, command)
adbWaiting = 1;
adbWaitingCmd = command;
+ {
+ delay (150000);
+ }
+
PM_VIA_INTR_ENABLE();
/* wait until the PM interrupt is occured */
- delay = 0x80000;
+ ndelay = 0x80000;
while (adbWaiting == 1) {
if (read_via_reg(VIA1, vIFR) & 0x14)
pm_intr();
@@ -1077,7 +1064,7 @@ pm_adb_op(buffer, compRout, data, command)
(void)intr_dispatch(0x70);
#endif
#endif
- if ((--delay) < 0) {
+ if ((--ndelay) < 0) {
splx(s);
return 1;
}