udl_proto.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. #ifndef UDL_PROTO_H
  3. #define UDL_PROTO_H
  4. #include <linux/bits.h>
  5. #define UDL_MSG_BULK 0xaf
  6. /* Register access */
  7. #define UDL_CMD_WRITEREG 0x20 /* See register constants below */
  8. /* Framebuffer access */
  9. #define UDL_CMD_WRITERAW8 0x60 /* 8 bit raw write command. */
  10. #define UDL_CMD_WRITERL8 0x61 /* 8 bit run length command. */
  11. #define UDL_CMD_WRITECOPY8 0x62 /* 8 bit copy command. */
  12. #define UDL_CMD_WRITERLX8 0x63 /* 8 bit extended run length command. */
  13. #define UDL_CMD_WRITERAW16 0x68 /* 16 bit raw write command. */
  14. #define UDL_CMD_WRITERL16 0x69 /* 16 bit run length command. */
  15. #define UDL_CMD_WRITECOPY16 0x6a /* 16 bit copy command. */
  16. #define UDL_CMD_WRITERLX16 0x6b /* 16 bit extended run length command. */
  17. /* Color depth */
  18. #define UDL_REG_COLORDEPTH 0x00
  19. #define UDL_COLORDEPTH_16BPP 0
  20. #define UDL_COLORDEPTH_24BPP 1
  21. /* Display-mode settings */
  22. #define UDL_REG_XDISPLAYSTART 0x01
  23. #define UDL_REG_XDISPLAYEND 0x03
  24. #define UDL_REG_YDISPLAYSTART 0x05
  25. #define UDL_REG_YDISPLAYEND 0x07
  26. #define UDL_REG_XENDCOUNT 0x09
  27. #define UDL_REG_HSYNCSTART 0x0b
  28. #define UDL_REG_HSYNCEND 0x0d
  29. #define UDL_REG_HPIXELS 0x0f
  30. #define UDL_REG_YENDCOUNT 0x11
  31. #define UDL_REG_VSYNCSTART 0x13
  32. #define UDL_REG_VSYNCEND 0x15
  33. #define UDL_REG_VPIXELS 0x17
  34. #define UDL_REG_PIXELCLOCK5KHZ 0x1b
  35. /* On/Off for driving the DisplayLink framebuffer to the display */
  36. #define UDL_REG_BLANKMODE 0x1f
  37. #define UDL_BLANKMODE_ON 0x00 /* hsync and vsync on, visible */
  38. #define UDL_BLANKMODE_BLANKED 0x01 /* hsync and vsync on, blanked */
  39. #define UDL_BLANKMODE_VSYNC_OFF 0x03 /* vsync off, blanked */
  40. #define UDL_BLANKMODE_HSYNC_OFF 0x05 /* hsync off, blanked */
  41. #define UDL_BLANKMODE_POWERDOWN 0x07 /* powered off; requires modeset */
  42. /* Framebuffer address */
  43. #define UDL_REG_BASE16BPP_ADDR2 0x20
  44. #define UDL_REG_BASE16BPP_ADDR1 0x21
  45. #define UDL_REG_BASE16BPP_ADDR0 0x22
  46. #define UDL_REG_BASE8BPP_ADDR2 0x26
  47. #define UDL_REG_BASE8BPP_ADDR1 0x27
  48. #define UDL_REG_BASE8BPP_ADDR0 0x28
  49. #define UDL_BASE_ADDR0_MASK GENMASK(7, 0)
  50. #define UDL_BASE_ADDR1_MASK GENMASK(15, 8)
  51. #define UDL_BASE_ADDR2_MASK GENMASK(23, 16)
  52. /* Lock/unlock video registers */
  53. #define UDL_REG_VIDREG 0xff
  54. #define UDL_VIDREG_LOCK 0x00
  55. #define UDL_VIDREG_UNLOCK 0xff
  56. #endif