pxafb.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. #ifndef __PXAFB_H__
  2. #define __PXAFB_H__
  3. /*
  4. * linux/drivers/video/pxafb.h
  5. * -- Intel PXA250/210 LCD Controller Frame Buffer Device
  6. *
  7. * Copyright (C) 1999 Eric A. Thomas.
  8. * Copyright (C) 2004 Jean-Frederic Clere.
  9. * Copyright (C) 2004 Ian Campbell.
  10. * Copyright (C) 2004 Jeff Lackey.
  11. * Based on sa1100fb.c Copyright (C) 1999 Eric A. Thomas
  12. * which in turn is
  13. * Based on acornfb.c Copyright (C) Russell King.
  14. *
  15. * 2001-08-03: Cliff Brake <cbrake@acclent.com>
  16. * - ported SA1100 code to PXA
  17. *
  18. * This file is subject to the terms and conditions of the GNU General Public
  19. * License. See the file COPYING in the main directory of this archive
  20. * for more details.
  21. */
  22. /* PXA LCD DMA descriptor */
  23. struct pxafb_dma_descriptor {
  24. unsigned int fdadr;
  25. unsigned int fsadr;
  26. unsigned int fidr;
  27. unsigned int ldcmd;
  28. };
  29. enum {
  30. PAL_NONE = -1,
  31. PAL_BASE = 0,
  32. PAL_OV1 = 1,
  33. PAL_OV2 = 2,
  34. PAL_MAX,
  35. };
  36. enum {
  37. DMA_BASE = 0,
  38. DMA_UPPER = 0,
  39. DMA_LOWER = 1,
  40. DMA_OV1 = 1,
  41. DMA_OV2_Y = 2,
  42. DMA_OV2_Cb = 3,
  43. DMA_OV2_Cr = 4,
  44. DMA_CURSOR = 5,
  45. DMA_CMD = 6,
  46. DMA_MAX,
  47. };
  48. /* maximum palette size - 256 entries, each 4 bytes long */
  49. #define PALETTE_SIZE (256 * 4)
  50. #define CMD_BUFF_SIZE (1024 * 50)
  51. struct pxafb_dma_buff {
  52. unsigned char palette[PAL_MAX * PALETTE_SIZE];
  53. uint16_t cmd_buff[CMD_BUFF_SIZE];
  54. struct pxafb_dma_descriptor pal_desc[PAL_MAX];
  55. struct pxafb_dma_descriptor dma_desc[DMA_MAX];
  56. };
  57. struct pxafb_info {
  58. struct fb_info fb;
  59. struct device *dev;
  60. struct clk *clk;
  61. void __iomem *mmio_base;
  62. struct pxafb_dma_buff *dma_buff;
  63. dma_addr_t dma_buff_phys;
  64. dma_addr_t fdadr[DMA_MAX];
  65. /*
  66. * These are the addresses we mapped
  67. * the framebuffer memory region to.
  68. */
  69. /* raw memory addresses */
  70. dma_addr_t map_dma; /* physical */
  71. u_char * map_cpu; /* virtual */
  72. u_int map_size;
  73. /* addresses of pieces placed in raw buffer */
  74. u_char * screen_cpu; /* virtual address of frame buffer */
  75. dma_addr_t screen_dma; /* physical address of frame buffer */
  76. u16 * palette_cpu; /* virtual address of palette memory */
  77. u_int palette_size;
  78. ssize_t video_offset;
  79. u_int lccr0;
  80. u_int lccr3;
  81. u_int lccr4;
  82. u_int cmap_inverse:1,
  83. cmap_static:1,
  84. unused:30;
  85. u_int reg_lccr0;
  86. u_int reg_lccr1;
  87. u_int reg_lccr2;
  88. u_int reg_lccr3;
  89. u_int reg_lccr4;
  90. u_int reg_cmdcr;
  91. unsigned long hsync_time;
  92. volatile u_char state;
  93. volatile u_char task_state;
  94. struct mutex ctrlr_lock;
  95. wait_queue_head_t ctrlr_wait;
  96. struct work_struct task;
  97. struct completion disable_done;
  98. #ifdef CONFIG_FB_PXA_SMARTPANEL
  99. uint16_t *smart_cmds;
  100. size_t n_smart_cmds;
  101. struct completion command_done;
  102. struct completion refresh_done;
  103. struct task_struct *smart_thread;
  104. #endif
  105. #ifdef CONFIG_CPU_FREQ
  106. struct notifier_block freq_transition;
  107. struct notifier_block freq_policy;
  108. #endif
  109. };
  110. #define TO_INF(ptr,member) container_of(ptr,struct pxafb_info,member)
  111. /*
  112. * These are the actions for set_ctrlr_state
  113. */
  114. #define C_DISABLE (0)
  115. #define C_ENABLE (1)
  116. #define C_DISABLE_CLKCHANGE (2)
  117. #define C_ENABLE_CLKCHANGE (3)
  118. #define C_REENABLE (4)
  119. #define C_DISABLE_PM (5)
  120. #define C_ENABLE_PM (6)
  121. #define C_STARTUP (7)
  122. #define PXA_NAME "PXA"
  123. /*
  124. * Minimum X and Y resolutions
  125. */
  126. #define MIN_XRES 64
  127. #define MIN_YRES 64
  128. #endif /* __PXAFB_H__ */