adb.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Definitions for ADB (Apple Desktop Bus) support.
  3. */
  4. #ifndef _UAPI__ADB_H
  5. #define _UAPI__ADB_H
  6. /* ADB commands */
  7. #define ADB_BUSRESET 0
  8. #define ADB_FLUSH(id) (0x01 | ((id) << 4))
  9. #define ADB_WRITEREG(id, reg) (0x08 | (reg) | ((id) << 4))
  10. #define ADB_READREG(id, reg) (0x0C | (reg) | ((id) << 4))
  11. /* ADB default device IDs (upper 4 bits of ADB command byte) */
  12. #define ADB_DONGLE 1 /* "software execution control" devices */
  13. #define ADB_KEYBOARD 2
  14. #define ADB_MOUSE 3
  15. #define ADB_TABLET 4
  16. #define ADB_MODEM 5
  17. #define ADB_MISC 7 /* maybe a monitor */
  18. #define ADB_RET_OK 0
  19. #define ADB_RET_TIMEOUT 3
  20. /* The kind of ADB request. The controller may emulate some
  21. or all of those CUDA/PMU packet kinds */
  22. #define ADB_PACKET 0
  23. #define CUDA_PACKET 1
  24. #define ERROR_PACKET 2
  25. #define TIMER_PACKET 3
  26. #define POWER_PACKET 4
  27. #define MACIIC_PACKET 5
  28. #define PMU_PACKET 6
  29. #define ADB_QUERY 7
  30. /* ADB queries */
  31. /* ADB_QUERY_GETDEVINFO
  32. * Query ADB slot for device presence
  33. * data[2] = id, rep[0] = orig addr, rep[1] = handler_id
  34. */
  35. #define ADB_QUERY_GETDEVINFO 1
  36. #endif /* _UAPI__ADB_H */