da8xx-fb.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * Porting to u-boot:
  3. *
  4. * (C) Copyright 2011
  5. * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
  6. *
  7. * Copyright (C) 2008-2009 MontaVista Software Inc.
  8. * Copyright (C) 2008-2009 Texas Instruments Inc
  9. *
  10. * Based on the LCD driver for TI Avalanche processors written by
  11. * Ajay Singh and Shalom Hai.
  12. *
  13. * This program is free software; you can redistribute it and/or modify
  14. * it under the terms of the GNU General Public License as published by
  15. * the Free Software Foundation; either version 2 of the License, or
  16. * (at your option)any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU General Public License
  24. * along with this program; if not, write to the Free Software
  25. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  26. */
  27. #ifndef DA8XX_FB_H
  28. #define DA8XX_FB_H
  29. enum panel_type {
  30. QVGA = 0
  31. };
  32. enum panel_shade {
  33. MONOCHROME = 0,
  34. COLOR_ACTIVE,
  35. COLOR_PASSIVE,
  36. };
  37. enum raster_load_mode {
  38. LOAD_DATA = 1,
  39. LOAD_PALETTE,
  40. };
  41. struct display_panel {
  42. enum panel_type panel_type; /* QVGA */
  43. int max_bpp;
  44. int min_bpp;
  45. enum panel_shade panel_shade;
  46. };
  47. struct da8xx_panel {
  48. const char name[25]; /* Full name <vendor>_<model> */
  49. unsigned short width;
  50. unsigned short height;
  51. int hfp; /* Horizontal front porch */
  52. int hbp; /* Horizontal back porch */
  53. int hsw; /* Horizontal Sync Pulse Width */
  54. int vfp; /* Vertical front porch */
  55. int vbp; /* Vertical back porch */
  56. int vsw; /* Vertical Sync Pulse Width */
  57. unsigned int pxl_clk; /* Pixel clock */
  58. unsigned char invert_pxl_clk; /* Invert Pixel clock */
  59. };
  60. struct da8xx_lcdc_platform_data {
  61. const char manu_name[10];
  62. void *controller_data;
  63. const char type[25];
  64. void (*panel_power_ctrl)(int);
  65. };
  66. struct lcd_ctrl_config {
  67. const struct display_panel *p_disp_panel;
  68. /* AC Bias Pin Frequency */
  69. int ac_bias;
  70. /* AC Bias Pin Transitions per Interrupt */
  71. int ac_bias_intrpt;
  72. /* DMA burst size */
  73. int dma_burst_sz;
  74. /* Bits per pixel */
  75. int bpp;
  76. /* FIFO DMA Request Delay */
  77. int fdd;
  78. /* TFT Alternative Signal Mapping (Only for active) */
  79. unsigned char tft_alt_mode;
  80. /* 12 Bit Per Pixel (5-6-5) Mode (Only for passive) */
  81. unsigned char stn_565_mode;
  82. /* Mono 8-bit Mode: 1=D0-D7 or 0=D0-D3 */
  83. unsigned char mono_8bit_mode;
  84. /* Invert line clock */
  85. unsigned char invert_line_clock;
  86. /* Invert frame clock */
  87. unsigned char invert_frm_clock;
  88. /* Horizontal and Vertical Sync Edge: 0=rising 1=falling */
  89. unsigned char sync_edge;
  90. /* Horizontal and Vertical Sync: Control: 0=ignore */
  91. unsigned char sync_ctrl;
  92. /* Raster Data Order Select: 1=Most-to-least 0=Least-to-most */
  93. unsigned char raster_order;
  94. };
  95. struct lcd_sync_arg {
  96. int back_porch;
  97. int front_porch;
  98. int pulse_width;
  99. };
  100. void da8xx_video_init(const struct da8xx_panel *panel, int bits_pixel);
  101. #endif /* ifndef DA8XX_FB_H */