2 * Definitions for ADB (Apple Desktop Bus) support.
9 #define ADB_FLUSH(id) (0x01 | ((id) << 4))
10 #define ADB_WRITEREG(id, reg) (0x08 | (reg) | ((id) << 4))
11 #define ADB_READREG(id, reg) (0x0C | (reg) | ((id) << 4))
13 /* ADB default device IDs (upper 4 bits of ADB command byte) */
14 #define ADB_DONGLE 1 /* "software execution control" devices */
15 #define ADB_KEYBOARD 2
19 #define ADB_MISC 7 /* maybe a monitor */
22 #define ADB_RET_TIMEOUT 3
24 /* The kind of ADB request. The controller may emulate some
25 or all of those CUDA/PMU packet kinds */
28 #define ERROR_PACKET 2
29 #define TIMER_PACKET 3
30 #define POWER_PACKET 4
31 #define MACIIC_PACKET 5
37 unsigned char data
[32];
39 unsigned char reply
[32];
41 unsigned char reply_expected
;
43 unsigned char complete
;
44 void (*done
)(struct adb_request
*);
46 struct adb_request
*next
;
54 /* Structure which encapsulates a low-level ADB driver */
60 int (*send_request
)(struct adb_request
*req
, int sync
);
61 /*int (*write)(struct adb_request *req);*/
62 int (*autopoll
)(int devs
);
64 int (*reset_bus
)(void);
67 /* Values for adb_request flags */
68 #define ADBREQ_REPLY 1 /* expect reply */
69 #define ADBREQ_SYNC 2 /* poll until done */
70 #define ADBREQ_NOSEND 4 /* build the request, but don't send it */
72 /* Messages sent thru the client_list notifier. You should NOT stop
73 the operation, at least not with this version */
75 ADB_MSG_POWERDOWN
, /* Currently called before sleep only */
76 ADB_MSG_PRE_RESET
, /* Called before resetting the bus */
77 ADB_MSG_POST_RESET
/* Called after resetting the bus (re-do init & register) */
79 extern struct adb_driver
*adb_controller
;
80 extern struct notifier_block
*adb_client_list
;
82 int adb_request(struct adb_request
*req
, void (*done
)(struct adb_request
*),
83 int flags
, int nbytes
, ...);
84 int adb_register(int default_id
,int handler_id
,struct adb_ids
*ids
,
85 void (*handler
)(unsigned char *, int, struct pt_regs
*, int));
87 void adb_input(unsigned char *, int, struct pt_regs
*, int);
88 int adb_reset_bus(void);
90 int adb_try_handler_change(int address
, int new_id
);
91 int adb_get_infos(int address
, int *original_address
, int *handler_id
);
93 #endif /* __KERNEL__ */