pxa168fb.h 2.7 KB

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