pxa168fb.h 2.7 KB

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