pxafb.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. struct pxafb_dma_buff {
  51. unsigned char palette[PAL_MAX * PALETTE_SIZE];
  52. struct pxafb_dma_descriptor pal_desc[PAL_MAX];
  53. struct pxafb_dma_descriptor dma_desc[DMA_MAX];
  54. };
  55. struct pxafb_info {
  56. struct fb_info fb;
  57. struct device *dev;
  58. struct clk *clk;
  59. void __iomem *mmio_base;
  60. struct pxafb_dma_buff *dma_buff;
  61. dma_addr_t dma_buff_phys;
  62. dma_addr_t fdadr[DMA_MAX];
  63. /*
  64. * These are the addresses we mapped
  65. * the framebuffer memory region to.
  66. */
  67. /* raw memory addresses */
  68. dma_addr_t map_dma; /* physical */
  69. u_char * map_cpu; /* virtual */
  70. u_int map_size;
  71. /* addresses of pieces placed in raw buffer */
  72. u_char * screen_cpu; /* virtual address of frame buffer */
  73. dma_addr_t screen_dma; /* physical address of frame buffer */
  74. u16 * palette_cpu; /* virtual address of palette memory */
  75. u_int palette_size;
  76. u_int lccr0;
  77. u_int lccr3;
  78. u_int lccr4;
  79. u_int cmap_inverse:1,
  80. cmap_static:1,
  81. unused:30;
  82. u_int reg_lccr0;
  83. u_int reg_lccr1;
  84. u_int reg_lccr2;
  85. u_int reg_lccr3;
  86. u_int reg_lccr4;
  87. unsigned long hsync_time;
  88. volatile u_char state;
  89. volatile u_char task_state;
  90. struct semaphore ctrlr_sem;
  91. wait_queue_head_t ctrlr_wait;
  92. struct work_struct task;
  93. struct completion disable_done;
  94. #ifdef CONFIG_CPU_FREQ
  95. struct notifier_block freq_transition;
  96. struct notifier_block freq_policy;
  97. #endif
  98. };
  99. #define TO_INF(ptr,member) container_of(ptr,struct pxafb_info,member)
  100. /*
  101. * These are the actions for set_ctrlr_state
  102. */
  103. #define C_DISABLE (0)
  104. #define C_ENABLE (1)
  105. #define C_DISABLE_CLKCHANGE (2)
  106. #define C_ENABLE_CLKCHANGE (3)
  107. #define C_REENABLE (4)
  108. #define C_DISABLE_PM (5)
  109. #define C_ENABLE_PM (6)
  110. #define C_STARTUP (7)
  111. #define PXA_NAME "PXA"
  112. /*
  113. * Minimum X and Y resolutions
  114. */
  115. #define MIN_XRES 64
  116. #define MIN_YRES 64
  117. #endif /* __PXAFB_H__ */