da8xx-fb.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. * SPDX-License-Identifier: GPL-2.0+
  14. */
  15. #ifndef DA8XX_FB_H
  16. #define DA8XX_FB_H
  17. enum panel_type {
  18. QVGA = 0,
  19. WVGA
  20. };
  21. enum panel_shade {
  22. MONOCHROME = 0,
  23. COLOR_ACTIVE,
  24. COLOR_PASSIVE,
  25. };
  26. enum raster_load_mode {
  27. LOAD_DATA = 1,
  28. LOAD_PALETTE,
  29. };
  30. struct display_panel {
  31. enum panel_type panel_type; /* QVGA */
  32. int max_bpp;
  33. int min_bpp;
  34. enum panel_shade panel_shade;
  35. };
  36. struct da8xx_panel {
  37. const char name[25]; /* Full name <vendor>_<model> */
  38. unsigned short width;
  39. unsigned short height;
  40. int hfp; /* Horizontal front porch */
  41. int hbp; /* Horizontal back porch */
  42. int hsw; /* Horizontal Sync Pulse Width */
  43. int vfp; /* Vertical front porch */
  44. int vbp; /* Vertical back porch */
  45. int vsw; /* Vertical Sync Pulse Width */
  46. unsigned int pxl_clk; /* Pixel clock */
  47. unsigned char invert_pxl_clk; /* Invert Pixel clock */
  48. };
  49. struct da8xx_lcdc_platform_data {
  50. const char manu_name[10];
  51. void *controller_data;
  52. const char type[25];
  53. void (*panel_power_ctrl)(int);
  54. };
  55. struct lcd_ctrl_config {
  56. const struct display_panel *p_disp_panel;
  57. /* AC Bias Pin Frequency */
  58. int ac_bias;
  59. /* AC Bias Pin Transitions per Interrupt */
  60. int ac_bias_intrpt;
  61. /* DMA burst size */
  62. int dma_burst_sz;
  63. /* Bits per pixel */
  64. int bpp;
  65. /* FIFO DMA Request Delay */
  66. int fdd;
  67. /* TFT Alternative Signal Mapping (Only for active) */
  68. unsigned char tft_alt_mode;
  69. /* 12 Bit Per Pixel (5-6-5) Mode (Only for passive) */
  70. unsigned char stn_565_mode;
  71. /* Mono 8-bit Mode: 1=D0-D7 or 0=D0-D3 */
  72. unsigned char mono_8bit_mode;
  73. /* Invert line clock */
  74. unsigned char invert_line_clock;
  75. /* Invert frame clock */
  76. unsigned char invert_frm_clock;
  77. /* Horizontal and Vertical Sync Edge: 0=rising 1=falling */
  78. unsigned char sync_edge;
  79. /* Horizontal and Vertical Sync: Control: 0=ignore */
  80. unsigned char sync_ctrl;
  81. /* Raster Data Order Select: 1=Most-to-least 0=Least-to-most */
  82. unsigned char raster_order;
  83. };
  84. struct lcd_sync_arg {
  85. int back_porch;
  86. int front_porch;
  87. int pulse_width;
  88. };
  89. void da8xx_video_init(const struct da8xx_panel *panel,
  90. const struct lcd_ctrl_config *lcd_cfg,
  91. int bits_pixel);
  92. #endif /* ifndef DA8XX_FB_H */