dp_info.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. /*
  2. * Copyright (C) 2012 Samsung Electronics
  3. *
  4. * Author: Donghwa Lee <dh09.lee@samsung.com>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation; either version 2 of
  9. * the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  19. * MA 02111-1307 USA
  20. */
  21. #ifndef _DP_INFO_H
  22. #define _DP_INFO_H
  23. #define msleep(a) udelay(a * 1000)
  24. #define DP_TIMEOUT_LOOP_COUNT 100
  25. #define MAX_CR_LOOP 5
  26. #define MAX_EQ_LOOP 4
  27. #define EXYNOS_DP_SUCCESS 0
  28. enum {
  29. DP_DISABLE,
  30. DP_ENABLE,
  31. };
  32. struct edp_disp_info {
  33. char *name;
  34. unsigned int h_total;
  35. unsigned int h_res;
  36. unsigned int h_sync_width;
  37. unsigned int h_back_porch;
  38. unsigned int h_front_porch;
  39. unsigned int v_total;
  40. unsigned int v_res;
  41. unsigned int v_sync_width;
  42. unsigned int v_back_porch;
  43. unsigned int v_front_porch;
  44. unsigned int v_sync_rate;
  45. };
  46. struct edp_link_train_info {
  47. unsigned int lt_status;
  48. unsigned int ep_loop;
  49. unsigned int cr_loop[4];
  50. };
  51. struct edp_video_info {
  52. unsigned int master_mode;
  53. unsigned int bist_mode;
  54. unsigned int bist_pattern;
  55. unsigned int h_sync_polarity;
  56. unsigned int v_sync_polarity;
  57. unsigned int interlaced;
  58. unsigned int color_space;
  59. unsigned int dynamic_range;
  60. unsigned int ycbcr_coeff;
  61. unsigned int color_depth;
  62. };
  63. struct edp_device_info {
  64. struct edp_disp_info disp_info;
  65. struct edp_link_train_info lt_info;
  66. struct edp_video_info video_info;
  67. /*below info get from panel during training*/
  68. unsigned char lane_bw;
  69. unsigned char lane_cnt;
  70. unsigned char dpcd_rev;
  71. /*support enhanced frame cap */
  72. unsigned char dpcd_efc;
  73. };
  74. enum analog_power_block {
  75. AUX_BLOCK,
  76. CH0_BLOCK,
  77. CH1_BLOCK,
  78. CH2_BLOCK,
  79. CH3_BLOCK,
  80. ANALOG_TOTAL,
  81. POWER_ALL
  82. };
  83. enum pll_status {
  84. PLL_UNLOCKED = 0,
  85. PLL_LOCKED
  86. };
  87. enum {
  88. COLOR_RGB,
  89. COLOR_YCBCR422,
  90. COLOR_YCBCR444
  91. };
  92. enum {
  93. VESA,
  94. CEA
  95. };
  96. enum {
  97. COLOR_YCBCR601,
  98. COLOR_YCBCR709
  99. };
  100. enum {
  101. COLOR_6,
  102. COLOR_8,
  103. COLOR_10,
  104. COLOR_12
  105. };
  106. enum {
  107. DP_LANE_BW_1_62 = 0x06,
  108. DP_LANE_BW_2_70 = 0x0a,
  109. };
  110. enum {
  111. DP_LANE_CNT_1 = 1,
  112. DP_LANE_CNT_2 = 2,
  113. DP_LANE_CNT_4 = 4,
  114. };
  115. enum {
  116. DP_DPCD_REV_10 = 0x10,
  117. DP_DPCD_REV_11 = 0x11,
  118. };
  119. enum {
  120. DP_LT_NONE,
  121. DP_LT_START,
  122. DP_LT_CR,
  123. DP_LT_ET,
  124. DP_LT_FINISHED,
  125. DP_LT_FAIL,
  126. };
  127. enum {
  128. PRE_EMPHASIS_LEVEL_0,
  129. PRE_EMPHASIS_LEVEL_1,
  130. PRE_EMPHASIS_LEVEL_2,
  131. PRE_EMPHASIS_LEVEL_3,
  132. };
  133. enum {
  134. PRBS7,
  135. D10_2,
  136. TRAINING_PTN1,
  137. TRAINING_PTN2,
  138. DP_NONE
  139. };
  140. enum {
  141. VOLTAGE_LEVEL_0,
  142. VOLTAGE_LEVEL_1,
  143. VOLTAGE_LEVEL_2,
  144. VOLTAGE_LEVEL_3,
  145. };
  146. enum pattern_type {
  147. NO_PATTERN,
  148. COLOR_RAMP,
  149. BALCK_WHITE_V_LINES,
  150. COLOR_SQUARE,
  151. INVALID_PATTERN,
  152. COLORBAR_32,
  153. COLORBAR_64,
  154. WHITE_GRAY_BALCKBAR_32,
  155. WHITE_GRAY_BALCKBAR_64,
  156. MOBILE_WHITEBAR_32,
  157. MOBILE_WHITEBAR_64
  158. };
  159. enum {
  160. CALCULATED_M,
  161. REGISTER_M
  162. };
  163. enum {
  164. VIDEO_TIMING_FROM_CAPTURE,
  165. VIDEO_TIMING_FROM_REGISTER
  166. };
  167. struct exynos_dp_platform_data {
  168. struct edp_device_info *edp_dev_info;
  169. };
  170. #ifdef CONFIG_EXYNOS_DP
  171. unsigned int exynos_init_dp(void);
  172. #else
  173. unsigned int exynos_init_dp(void)
  174. {
  175. return 0;
  176. }
  177. #endif
  178. void exynos_set_dp_platform_data(struct exynos_dp_platform_data *pd);
  179. #endif /* _DP_INFO_H */