mipi_display.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * Defines for Mobile Industry Processor Interface (MIPI(R))
  3. * Display Working Group standards: DSI, DCS, DBI, DPI
  4. *
  5. * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
  6. * Copyright (C) 2006 Nokia Corporation
  7. * Author: Imre Deak <imre.deak@nokia.com>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #ifndef MIPI_DISPLAY_H
  14. #define MIPI_DISPLAY_H
  15. /* MIPI DSI Processor-to-Peripheral transaction types */
  16. enum {
  17. MIPI_DSI_V_SYNC_START = 0x01,
  18. MIPI_DSI_V_SYNC_END = 0x11,
  19. MIPI_DSI_H_SYNC_START = 0x21,
  20. MIPI_DSI_H_SYNC_END = 0x31,
  21. MIPI_DSI_COLOR_MODE_OFF = 0x02,
  22. MIPI_DSI_COLOR_MODE_ON = 0x12,
  23. MIPI_DSI_SHUTDOWN_PERIPHERAL = 0x22,
  24. MIPI_DSI_TURN_ON_PERIPHERAL = 0x32,
  25. MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM = 0x03,
  26. MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM = 0x13,
  27. MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM = 0x23,
  28. MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM = 0x04,
  29. MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM = 0x14,
  30. MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM = 0x24,
  31. MIPI_DSI_DCS_SHORT_WRITE = 0x05,
  32. MIPI_DSI_DCS_SHORT_WRITE_PARAM = 0x15,
  33. MIPI_DSI_DCS_READ = 0x06,
  34. MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE = 0x37,
  35. MIPI_DSI_END_OF_TRANSMISSION = 0x08,
  36. MIPI_DSI_NULL_PACKET = 0x09,
  37. MIPI_DSI_BLANKING_PACKET = 0x19,
  38. MIPI_DSI_GENERIC_LONG_WRITE = 0x29,
  39. MIPI_DSI_DCS_LONG_WRITE = 0x39,
  40. MIPI_DSI_LOOSELY_PACKED_PIXEL_STREAM_YCBCR20 = 0x0c,
  41. MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR24 = 0x1c,
  42. MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16 = 0x2c,
  43. MIPI_DSI_PACKED_PIXEL_STREAM_30 = 0x0d,
  44. MIPI_DSI_PACKED_PIXEL_STREAM_36 = 0x1d,
  45. MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12 = 0x3d,
  46. MIPI_DSI_PACKED_PIXEL_STREAM_16 = 0x0e,
  47. MIPI_DSI_PACKED_PIXEL_STREAM_18 = 0x1e,
  48. MIPI_DSI_PIXEL_STREAM_3BYTE_18 = 0x2e,
  49. MIPI_DSI_PACKED_PIXEL_STREAM_24 = 0x3e,
  50. };
  51. /* MIPI DSI Peripheral-to-Processor transaction types */
  52. enum {
  53. MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT = 0x02,
  54. MIPI_DSI_RX_END_OF_TRANSMISSION = 0x08,
  55. MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_1BYTE = 0x11,
  56. MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_2BYTE = 0x12,
  57. MIPI_DSI_RX_GENERIC_LONG_READ_RESPONSE = 0x1a,
  58. MIPI_DSI_RX_DCS_LONG_READ_RESPONSE = 0x1c,
  59. MIPI_DSI_RX_DCS_SHORT_READ_RESPONSE_1BYTE = 0x21,
  60. MIPI_DSI_RX_DCS_SHORT_READ_RESPONSE_2BYTE = 0x22,
  61. };
  62. /* MIPI DCS commands */
  63. enum {
  64. MIPI_DCS_NOP = 0x00,
  65. MIPI_DCS_SOFT_RESET = 0x01,
  66. MIPI_DCS_GET_DISPLAY_ID = 0x04,
  67. MIPI_DCS_GET_RED_CHANNEL = 0x06,
  68. MIPI_DCS_GET_GREEN_CHANNEL = 0x07,
  69. MIPI_DCS_GET_BLUE_CHANNEL = 0x08,
  70. MIPI_DCS_GET_DISPLAY_STATUS = 0x09,
  71. MIPI_DCS_GET_POWER_MODE = 0x0A,
  72. MIPI_DCS_GET_ADDRESS_MODE = 0x0B,
  73. MIPI_DCS_GET_PIXEL_FORMAT = 0x0C,
  74. MIPI_DCS_GET_DISPLAY_MODE = 0x0D,
  75. MIPI_DCS_GET_SIGNAL_MODE = 0x0E,
  76. MIPI_DCS_GET_DIAGNOSTIC_RESULT = 0x0F,
  77. MIPI_DCS_ENTER_SLEEP_MODE = 0x10,
  78. MIPI_DCS_EXIT_SLEEP_MODE = 0x11,
  79. MIPI_DCS_ENTER_PARTIAL_MODE = 0x12,
  80. MIPI_DCS_ENTER_NORMAL_MODE = 0x13,
  81. MIPI_DCS_EXIT_INVERT_MODE = 0x20,
  82. MIPI_DCS_ENTER_INVERT_MODE = 0x21,
  83. MIPI_DCS_SET_GAMMA_CURVE = 0x26,
  84. MIPI_DCS_SET_DISPLAY_OFF = 0x28,
  85. MIPI_DCS_SET_DISPLAY_ON = 0x29,
  86. MIPI_DCS_SET_COLUMN_ADDRESS = 0x2A,
  87. MIPI_DCS_SET_PAGE_ADDRESS = 0x2B,
  88. MIPI_DCS_WRITE_MEMORY_START = 0x2C,
  89. MIPI_DCS_WRITE_LUT = 0x2D,
  90. MIPI_DCS_READ_MEMORY_START = 0x2E,
  91. MIPI_DCS_SET_PARTIAL_AREA = 0x30,
  92. MIPI_DCS_SET_SCROLL_AREA = 0x33,
  93. MIPI_DCS_SET_TEAR_OFF = 0x34,
  94. MIPI_DCS_SET_TEAR_ON = 0x35,
  95. MIPI_DCS_SET_ADDRESS_MODE = 0x36,
  96. MIPI_DCS_SET_SCROLL_START = 0x37,
  97. MIPI_DCS_EXIT_IDLE_MODE = 0x38,
  98. MIPI_DCS_ENTER_IDLE_MODE = 0x39,
  99. MIPI_DCS_SET_PIXEL_FORMAT = 0x3A,
  100. MIPI_DCS_WRITE_MEMORY_CONTINUE = 0x3C,
  101. MIPI_DCS_READ_MEMORY_CONTINUE = 0x3E,
  102. MIPI_DCS_SET_TEAR_SCANLINE = 0x44,
  103. MIPI_DCS_GET_SCANLINE = 0x45,
  104. MIPI_DCS_READ_DDB_START = 0xA1,
  105. MIPI_DCS_READ_DDB_CONTINUE = 0xA8,
  106. };
  107. /* MIPI DCS pixel formats */
  108. #define MIPI_DCS_PIXEL_FMT_24BIT 7
  109. #define MIPI_DCS_PIXEL_FMT_18BIT 6
  110. #define MIPI_DCS_PIXEL_FMT_16BIT 5
  111. #define MIPI_DCS_PIXEL_FMT_12BIT 3
  112. #define MIPI_DCS_PIXEL_FMT_8BIT 2
  113. #define MIPI_DCS_PIXEL_FMT_3BIT 1
  114. #endif