pxa168fb.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2009 Marvell International Ltd.
  4. */
  5. #ifndef __ASM_MACH_PXA168FB_H
  6. #define __ASM_MACH_PXA168FB_H
  7. #include <linux/fb.h>
  8. #include <linux/interrupt.h>
  9. /* Dumb interface */
  10. #define PIN_MODE_DUMB_24 0
  11. #define PIN_MODE_DUMB_18_SPI 1
  12. #define PIN_MODE_DUMB_18_GPIO 2
  13. #define PIN_MODE_DUMB_16_SPI 3
  14. #define PIN_MODE_DUMB_16_GPIO 4
  15. #define PIN_MODE_DUMB_12_SPI_GPIO 5
  16. #define PIN_MODE_SMART_18_SPI 6
  17. #define PIN_MODE_SMART_16_SPI 7
  18. #define PIN_MODE_SMART_8_SPI_GPIO 8
  19. /* Dumb interface pin allocation */
  20. #define DUMB_MODE_RGB565 0
  21. #define DUMB_MODE_RGB565_UPPER 1
  22. #define DUMB_MODE_RGB666 2
  23. #define DUMB_MODE_RGB666_UPPER 3
  24. #define DUMB_MODE_RGB444 4
  25. #define DUMB_MODE_RGB444_UPPER 5
  26. #define DUMB_MODE_RGB888 6
  27. /* default fb buffer size WVGA-32bits */
  28. #define DEFAULT_FB_SIZE (800 * 480 * 4)
  29. /*
  30. * Buffer pixel format
  31. * bit0 is for rb swap.
  32. * bit12 is for Y UorV swap
  33. */
  34. #define PIX_FMT_RGB565 0
  35. #define PIX_FMT_BGR565 1
  36. #define PIX_FMT_RGB1555 2
  37. #define PIX_FMT_BGR1555 3
  38. #define PIX_FMT_RGB888PACK 4
  39. #define PIX_FMT_BGR888PACK 5
  40. #define PIX_FMT_RGB888UNPACK 6
  41. #define PIX_FMT_BGR888UNPACK 7
  42. #define PIX_FMT_RGBA888 8
  43. #define PIX_FMT_BGRA888 9
  44. #define PIX_FMT_YUV422PACK 10
  45. #define PIX_FMT_YVU422PACK 11
  46. #define PIX_FMT_YUV422PLANAR 12
  47. #define PIX_FMT_YVU422PLANAR 13
  48. #define PIX_FMT_YUV420PLANAR 14
  49. #define PIX_FMT_YVU420PLANAR 15
  50. #define PIX_FMT_PSEUDOCOLOR 20
  51. #define PIX_FMT_UYVY422PACK (0x1000|PIX_FMT_YUV422PACK)
  52. /*
  53. * PXA LCD controller private state.
  54. */
  55. struct pxa168fb_info {
  56. struct device *dev;
  57. struct clk *clk;
  58. struct fb_info *info;
  59. void __iomem *reg_base;
  60. dma_addr_t fb_start_dma;
  61. u32 pseudo_palette[16];
  62. int pix_fmt;
  63. unsigned is_blanked:1;
  64. unsigned panel_rbswap:1;
  65. unsigned active:1;
  66. };
  67. /*
  68. * PXA fb machine information
  69. */
  70. struct pxa168fb_mach_info {
  71. char id[16];
  72. int num_modes;
  73. struct fb_videomode *modes;
  74. /*
  75. * Pix_fmt
  76. */
  77. unsigned pix_fmt;
  78. /*
  79. * I/O pin allocation.
  80. */
  81. unsigned io_pin_allocation_mode:4;
  82. /*
  83. * Dumb panel -- assignment of R/G/B component info to the 24
  84. * available external data lanes.
  85. */
  86. unsigned dumb_mode:4;
  87. unsigned panel_rgb_reverse_lanes:1;
  88. /*
  89. * Dumb panel -- GPIO output data.
  90. */
  91. unsigned gpio_output_mask:8;
  92. unsigned gpio_output_data:8;
  93. /*
  94. * Dumb panel -- configurable output signal polarity.
  95. */
  96. unsigned invert_composite_blank:1;
  97. unsigned invert_pix_val_ena:1;
  98. unsigned invert_pixclock:1;
  99. unsigned panel_rbswap:1;
  100. unsigned active:1;
  101. unsigned enable_lcd:1;
  102. };
  103. #endif /* __ASM_MACH_PXA168FB_H */