int gpio_intr(void *arg) { int rv = 0; #if NADB > 0 if (adb_cd.cd_devs[0] != NULL) rv = adb_intr(adb_cd.cd_devs[0]); #endif return rv; }
int gpio_intr(void *arg) { int rv = 0; #if NADB > 0 struct gpio_softc *sc; sc = device_lookup_private(&adb_cd, 0); if (sc != NULL) rv = adb_intr(sc); #endif return rv; }
void akbd_cngetc(void *v, u_int *type, int *data) { int intbits, key, press, val; int s; extern int adb_intr(void *); extern void pm_intr(void *); s = splhigh(); adb_polledkey = -1; adb_polling = 1; while (adb_polledkey == -1) { intbits = via_reg(VIA1, vIFR); if (intbits & V1IF_ADBRDY) { adb_intr(NULL); via_reg(VIA1, vIFR) = V1IF_ADBRDY; } if (intbits & V1IF_ADBCLK) { pm_intr(NULL); via_reg(VIA1, vIFR) = 0x10; } } adb_polling = 0; splx(s); key = adb_polledkey; press = ADBK_PRESS(key); val = ADBK_KEYVAL(key); *data = val; *type = press ? WSCONS_EVENT_KEY_DOWN : WSCONS_EVENT_KEY_UP; }