da8xx-fb.h 2.4 KB

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