lcd-info.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. #ifndef __LCD_INFO_H__
  2. #define __LCD_INFO_H__
  3. /*
  4. * HBP : Horizontal Back Porch
  5. * HFP : Horizontal Front Porch
  6. * HSPW: Horizontal Sync. Pulse Width
  7. * PPL : Pixels-per-line = 16(PPL+1)
  8. */
  9. #define ENC_PARAM_TIME0(HBP, HFP, HSPW, PPL) \
  10. ((((HBP) - 1) << 24) | \
  11. (((HFP) - 1) << 16) | \
  12. (((HSPW) - 1) << 8 ) | \
  13. ((((PPL) >> 4) - 1) << 2 ))
  14. /*
  15. * HBP : Vertical Back Porch
  16. * HFP : Vertical Front Porch
  17. * HSPW: Vertical Sync. Pulse Width
  18. * LPP : Lines-per-panel = LPP + 1
  19. */
  20. #define ENC_PARAM_TIME1(VBP, VFP, VSPW, LPP) \
  21. ((((VBP) ) << 24) | \
  22. (((VFP) ) << 16) | \
  23. (((VSPW) - 1) << 10) | \
  24. (((LPP) - 1) ))
  25. /*
  26. * PRA : Pixel Rate Adaptive
  27. * IOE : Invert Panel Output Enable
  28. * IPC : Invert Panel Clock (Test Chip Testing)
  29. * IHS : Invert Horisontal Sync.
  30. * IVS : Invert Versical Sync.
  31. * PCD : Panel Clock Divisor
  32. */
  33. #define ENC_PARAM_TIME2(PRA, IOE, IPC, IHS, IVS, PCD) \
  34. (((PRA) << 15) | \
  35. ((IOE) << 14) | \
  36. ((IPC) << 13) | \
  37. ((IHS) << 12) | \
  38. ((IVS) << 11) | \
  39. (((PCD) - 1) ))
  40. /*
  41. * Enable YCbCr
  42. * Enable YCbCr422
  43. * FIFO threadhold
  44. * Panel type, 0-6bit, 1-8bit
  45. * LcdVComp, when to generate interrupt, 1: start of back_porch
  46. * Power Enable
  47. * Big Endian Pixel/Byte Ordering
  48. * BGR
  49. * TFT
  50. * LCD bits per pixel
  51. * Controller Enable
  52. */
  53. #define ENC_PARAM_CTRL(ENYUV, ENYUV422, FIFOTH, PTYPE, VCOMP, LCD_ON, ENDIAN, BGR, TFT, BPP, LCD_EN) \
  54. ((ENYUV << 18) | \
  55. (ENYUV422 << 17) | \
  56. (FIFOTH << 16) | \
  57. (PTYPE << 15) | \
  58. (VCOMP << 12) | \
  59. (LCD_ON << 11) | \
  60. (ENDIAN << 9) | \
  61. (BGR << 8) | \
  62. (TFT << 5) | \
  63. (BPP << 1) | \
  64. (LCD_EN))
  65. #if defined(CONFIG_COLOR_DEPTH16)
  66. #define LCD_COLOR_DEPTH 0x4
  67. #define LCD_PANEL_BPP 16
  68. #elif defined(CONFIG_COLOR_DEPTH24)
  69. #define LCD_COLOR_DEPTH 0x5
  70. #define LCD_PANEL_BPP 24
  71. #else
  72. #define LCD_COLOR_DEPTH 0x5
  73. #define LCD_PANEL_BPP 24
  74. #endif
  75. #ifdef CONFIG_PANEL_AUA036QN01
  76. #define LCD_PANEL_WIDTH 320
  77. #define LCD_PANEL_HEIGHT 240
  78. #define LCD_TIME0 ENC_PARAM_TIME0(7, 6, 1, 320) /* 0x0605004c */
  79. #define LCD_TIME1 ENC_PARAM_TIME1(1, 1, 1, 240) /* 0x010100ef */
  80. #define LCD_TIME2 ENC_PARAM_TIME2(0, 0, 1, 1, 1, 0x7) /* 0x00003806 */
  81. #define LCD_CTRL ENC_PARAM_CTRL(0, 0, 1, 1, 0x3, 1, 0x0, 1, 1, LCD_COLOR_DEPTH, 1) /* 0x0001b928 */
  82. #endif
  83. #ifdef CONFIG_PANEL_AUA070VW04
  84. #define LCD_PANEL_WIDTH 800
  85. #define LCD_PANEL_HEIGHT 480
  86. #define LCD_TIME0 ENC_PARAM_TIME0(88, 40, 128, 800)
  87. #define LCD_TIME1 ENC_PARAM_TIME1(21, 1, 3, 480)
  88. #define LCD_TIME2 ENC_PARAM_TIME2(0, 1, 1, 1, 1, 0x7)
  89. #define LCD_CTRL ENC_PARAM_CTRL(0, 0, 1, 1, 0x3, 1, 0x0, 1, 1, LCD_COLOR_DEPTH, 1)
  90. #endif
  91. #ifdef CONFIG_PANEL_CH7013A
  92. #define LCD_TIME0 ENC_PARAM_TIME0(42, 10, 96, 640)
  93. #define LCD_TIME1 ENC_PARAM_TIME1(28, 5, 2, 480)
  94. #define LCD_TIME2 ENC_PARAM_TIME2(0, 1, 1, 0, 0, 0x3)
  95. #define LCD_CTRL ENC_PARAM_CTRL(0, 0, 1, 0, 0x3, 1, 0x0, 1, 1, LCD_COLOR_DEPTH, 1)
  96. #endif /* CONFIG_CH7013A */
  97. #endif /* __LCD_INFO_H__ */