[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: USB Keyboard (Re: G4 (Re: iBook))



こんばんは。

Tsubai Masanari <tsubai@iri.co.jp> wrote:

Tsubai> ext_intr あたりで printf して、ADB の割り込みが上がっ
Tsubai> てきているか確認できるでしょうか。なんか benh が 
Tsubai> gpio だとか言ってたような気もするので。

uvmexp.intrsとintrcnt[hwirq[irq]]を表示させてみましたが、確
認したいのはこれでしょうか。

adbの認識はタイミングの問題のようで、下のようにdelayを入れる
と見えるようにはなりました。

・delayが大きいので、遅いです。
・iBookの内蔵タッチパネルのボタンは1つですが、2つ見えてます。

...
timer at obio0 offset 0x15000 not configured
adb0 at obio0 offset 0x16000 irq 25: 3 targets
aed0 at adb0 addr 0: ADB Event device
akbd0 at adb0 addr 2: PowerBook G3 keyboard (Japanese layout)
wskbd0 at akbd0: console keyboard, using wsdisplay0
ams0 at adb0 addr 3: EMP trackpad <tpad> 2-button, 400 dpi
wsmouse0 at ams0 abtn0 at adb0 addr 7: brightness/volume button
battery at obio0 offset 0x0 not configured
...

Index: adb_direct.c
===================================================================
RCS file: /a/rsync/netbsd.org/syssrc/sys/arch/macppc/dev/adb_direct.c,v
retrieving revision 1.12
diff -u -r1.12 adb_direct.c
--- adb_direct.c	2000/01/27 17:39:20	1.12
+++ adb_direct.c	2000/02/06 14:32:08
@@ -79,6 +79,10 @@
 #endif
 #endif
 
+#ifdef ADB_DEBUG
+extern int	adb_debug;		/* adb.c */
+#endif
+
 /* some misc. leftovers */
 #define vPB		0x0000
 #define vPB3		0x08
Index: akbd.c
===================================================================
RCS file: /a/rsync/netbsd.org/syssrc/sys/arch/macppc/dev/akbd.c,v
retrieving revision 1.9
diff -u -r1.9 akbd.c
--- akbd.c	1999/09/05 05:30:30	1.9
+++ akbd.c	2000/02/06 14:32:19
@@ -69,6 +69,10 @@
 static void	blinkleds __P((struct akbd_softc *));
 #endif
 
+#ifdef ADB_DEBUG
+extern int adb_debug;			/* adb.c */
+#endif /* ADB_DEBUG */
+
 /*
  * Local variables.
  */
Index: ams.c
===================================================================
RCS file: /a/rsync/netbsd.org/syssrc/sys/arch/macppc/dev/ams.c,v
retrieving revision 1.8
diff -u -r1.8 ams.c
--- ams.c	2000/01/08 02:57:25	1.8
+++ ams.c	2000/02/06 14:33:32
@@ -63,6 +63,9 @@
  * Global variables.
  */
 extern int	kbd_polling; /* Are we polling (Debugger mode)? from kbd.c */
+#ifdef ADB_DEBUG
+extern int	adb_debug;		/* adb.c */
+#endif /* ADB_DEBUG */
 
 /*
  * Local variables.
Index: pm_direct.c
===================================================================
RCS file: /a/rsync/netbsd.org/syssrc/sys/arch/macppc/dev/pm_direct.c,v
retrieving revision 1.8
diff -u -r1.8 pm_direct.c
--- pm_direct.c	1999/09/05 05:30:30	1.8
+++ pm_direct.c	2000/02/06 14:31:30
@@ -52,6 +52,9 @@
 #include <macppc/dev/viareg.h>
 
 extern int adb_polling;		/* Are we polling?  (Debugger mode) */
+#ifdef ADB_DEBUG
+extern int adb_debug;		/* adb.c */
+#endif
 
 /* hardware dependent values */
 #define ADBDelay 100		/* XXX */
@@ -589,7 +592,7 @@
 	} else {
 #ifdef ADB_DEBUG
 		if (adb_debug)
-			pm_printerr("driver does not supported this event.",
+			pm_printerr("driver does not support this event.",
 			    rval, pmdata.num_data, pmdata.data);
 #endif
 	}
@@ -848,6 +851,12 @@
 	switch ((u_int)(pmdata.data[2] & 0xff)) {
 		case 0x00:			/* 1 sec interrupt? */
 			break;
+		case 0x40:			/* wakeup interrupt? */
+#ifdef ADB_DEBUG
+			if (adb_debug)
+				printf("pm_intr_pm2: wakeint\n");
+#endif
+			break;
 		case 0x80:			/* 1 sec interrupt? */
 			pm_counter++;
 			break;
@@ -890,7 +899,7 @@
 		default:
 #ifdef ADB_DEBUG
 			if (adb_debug)
-				pm_printerr("driver does not supported this event.",
+				pm_printerr("driver does not support this event.",
 				    pmdata.data[2], pmdata.num_data,
 				    pmdata.data);
 #endif
@@ -931,6 +940,8 @@
 pmgrop(pmdata)
 	PMData *pmdata;
 {
+
+delay(40000);
 	switch (pmHardware) {
 		case PM_HW_PB1XX:
 			return (pm_pmgrop_pm1(pmdata));
@@ -951,6 +962,8 @@
 void
 pm_intr()
 {
+
+delay(70000);
 	switch (pmHardware) {
 		case PM_HW_PB1XX:
 			pm_intr_pm1();