adb.h 1.1 KB

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