5 #include <linux/types.h>
6 #include <linux/errno.h>
7 #include <linux/kernel.h>
12 #include <linux/adb.h>
14 #include <asm/pgtable.h>
63 static int macio_probe(
void);
64 static int macio_init(
void);
67 static int macio_adb_autopoll(
int devs);
68 static void macio_adb_poll(
void);
69 static int macio_adb_reset_bus(
void);
119 if (
request_irq(irq, macio_adb_interrupt, 0,
"ADB", (
void *)0)) {
125 printk(
"adb: mac-io driver 1.0 for unified ADB\n");
130 static int macio_adb_autopoll(
int devs)
138 spin_unlock_irqrestore(&macio_lock, flags);
142 static int macio_adb_reset_bus(
void)
155 if (--timeout == 0) {
157 spin_unlock_irqrestore(&macio_lock, flags);
161 spin_unlock_irqrestore(&macio_lock, flags);
174 for (i = 0; i < req->
nbytes - 1; ++
i)
184 if (current_req != 0) {
188 current_req = last_req =
req;
191 spin_unlock_irqrestore(&macio_lock, flags);
205 unsigned char ibuf[16];
211 spin_lock(&macio_lock);
214 if ((req = current_req) != 0) {
216 for (i = 0; i < req->
nbytes; ++
i)
224 current_req = req->
next;
236 if (current_req && current_req->
sent) {
244 current_req = req->
next;
248 }
else if (err == 0) {
251 for (i = 0; i <
n; ++
i)
259 spin_unlock(&macio_lock);
260 if (complete && req) {
276 static void macio_adb_poll(
void)
282 macio_adb_interrupt(0,
NULL);