diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-m68k/adb.h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'include/asm-m68k/adb.h')
-rw-r--r-- | include/asm-m68k/adb.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/include/asm-m68k/adb.h b/include/asm-m68k/adb.h new file mode 100644 index 000000000000..9176b55185bb --- /dev/null +++ b/include/asm-m68k/adb.h | |||
@@ -0,0 +1,75 @@ | |||
1 | /* | ||
2 | * Definitions for talking to ADB and CUDA. The CUDA is a microcontroller | ||
3 | * which controls the ADB, system power, RTC, and various other things on | ||
4 | * later Macintoshes | ||
5 | * | ||
6 | * Copyright (C) 1996 Paul Mackerras. | ||
7 | */ | ||
8 | |||
9 | /* First byte sent to or received from CUDA */ | ||
10 | #define ADB_PACKET 0 | ||
11 | #define CUDA_PACKET 1 | ||
12 | #define ERROR_PACKET 2 | ||
13 | #define TIMER_PACKET 3 | ||
14 | #define POWER_PACKET 4 | ||
15 | #define MACIIC_PACKET 5 | ||
16 | |||
17 | /* ADB commands (2nd byte) */ | ||
18 | #define ADB_BUSRESET 0 | ||
19 | #define ADB_FLUSH(id) (1 + ((id) << 4)) | ||
20 | #define ADB_WRITEREG(id, reg) (8 + (reg) + ((id) << 4)) | ||
21 | #define ADB_READREG(id, reg) (0xc + (reg) + ((id) << 4)) | ||
22 | |||
23 | /* ADB default device IDs (upper 4 bits of 2nd byte) */ | ||
24 | #define ADB_DONGLE 1 /* "software execution control" devices */ | ||
25 | #define ADB_KEYBOARD 2 | ||
26 | #define ADB_MOUSE 3 | ||
27 | #define ADB_TABLET 4 | ||
28 | #define ADB_MODEM 5 | ||
29 | #define ADB_MISC 7 /* maybe a monitor */ | ||
30 | |||
31 | /* CUDA commands (2nd byte) */ | ||
32 | #define CUDA_WARM_START 0 | ||
33 | #define CUDA_AUTOPOLL 1 | ||
34 | #define CUDA_GET_6805_ADDR 2 | ||
35 | #define CUDA_GET_TIME 3 | ||
36 | #define CUDA_GET_PRAM 7 | ||
37 | #define CUDA_SET_6805_ADDR 8 | ||
38 | #define CUDA_SET_TIME 9 | ||
39 | #define CUDA_POWERDOWN 0xa | ||
40 | #define CUDA_POWERUP_TIME 0xb | ||
41 | #define CUDA_SET_PRAM 0xc | ||
42 | #define CUDA_MS_RESET 0xd | ||
43 | #define CUDA_SEND_DFAC 0xe | ||
44 | #define CUDA_RESET_SYSTEM 0x11 | ||
45 | #define CUDA_SET_IPL 0x12 | ||
46 | #define CUDA_SET_AUTO_RATE 0x14 | ||
47 | #define CUDA_GET_AUTO_RATE 0x16 | ||
48 | #define CUDA_SET_DEVICE_LIST 0x19 | ||
49 | #define CUDA_GET_DEVICE_LIST 0x1a | ||
50 | #define CUDA_GET_SET_IIC 0x22 | ||
51 | |||
52 | #ifdef __KERNEL__ | ||
53 | |||
54 | struct adb_request { | ||
55 | unsigned char data[16]; | ||
56 | int nbytes; | ||
57 | unsigned char reply[16]; | ||
58 | int reply_len; | ||
59 | unsigned char reply_expected; | ||
60 | unsigned char sent; | ||
61 | unsigned char got_reply; | ||
62 | void (*done)(struct adb_request *); | ||
63 | void *arg; | ||
64 | struct adb_request *next; | ||
65 | }; | ||
66 | |||
67 | void via_adb_init(void); | ||
68 | int adb_request(struct adb_request *req, | ||
69 | void (*done)(struct adb_request *), int nbytes, ...); | ||
70 | int adb_send_request(struct adb_request *req); | ||
71 | void adb_poll(void); | ||
72 | int adb_register(int default_id, | ||
73 | void (*handler)(unsigned char *, int, struct pt_regs *)); | ||
74 | |||
75 | #endif /* __KERNEL */ | ||