pxafb.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. /* Shadows for LCD controller registers */
  23. struct pxafb_lcd_reg {
  24. unsigned int lccr0;
  25. unsigned int lccr1;
  26. unsigned int lccr2;
  27. unsigned int lccr3;
  28. };
  29. /* PXA LCD DMA descriptor */
  30. struct pxafb_dma_descriptor {
  31. unsigned int fdadr;
  32. unsigned int fsadr;
  33. unsigned int fidr;
  34. unsigned int ldcmd;
  35. };
  36. struct pxafb_info {
  37. struct fb_info fb;
  38. struct device *dev;
  39. u_int max_bpp;
  40. u_int max_xres;
  41. u_int max_yres;
  42. /*
  43. * These are the addresses we mapped
  44. * the framebuffer memory region to.
  45. */
  46. /* raw memory addresses */
  47. dma_addr_t map_dma; /* physical */
  48. u_char * map_cpu; /* virtual */
  49. u_int map_size;
  50. /* addresses of pieces placed in raw buffer */
  51. u_char * screen_cpu; /* virtual address of frame buffer */
  52. dma_addr_t screen_dma; /* physical address of frame buffer */
  53. u16 * palette_cpu; /* virtual address of palette memory */
  54. dma_addr_t palette_dma; /* physical address of palette memory */
  55. u_int palette_size;
  56. /* DMA descriptors */
  57. struct pxafb_dma_descriptor * dmadesc_fblow_cpu;
  58. dma_addr_t dmadesc_fblow_dma;
  59. struct pxafb_dma_descriptor * dmadesc_fbhigh_cpu;
  60. dma_addr_t dmadesc_fbhigh_dma;
  61. struct pxafb_dma_descriptor * dmadesc_palette_cpu;
  62. dma_addr_t dmadesc_palette_dma;
  63. dma_addr_t fdadr0;
  64. dma_addr_t fdadr1;
  65. u_int lccr0;
  66. u_int lccr3;
  67. u_int cmap_inverse:1,
  68. cmap_static:1,
  69. unused:30;
  70. u_int reg_lccr0;
  71. u_int reg_lccr1;
  72. u_int reg_lccr2;
  73. u_int reg_lccr3;
  74. unsigned long hsync_time;
  75. volatile u_char state;
  76. volatile u_char task_state;
  77. struct semaphore ctrlr_sem;
  78. wait_queue_head_t ctrlr_wait;
  79. struct work_struct task;
  80. #ifdef CONFIG_CPU_FREQ
  81. struct notifier_block freq_transition;
  82. struct notifier_block freq_policy;
  83. #endif
  84. };
  85. #define TO_INF(ptr,member) container_of(ptr,struct pxafb_info,member)
  86. /*
  87. * These are the actions for set_ctrlr_state
  88. */
  89. #define C_DISABLE (0)
  90. #define C_ENABLE (1)
  91. #define C_DISABLE_CLKCHANGE (2)
  92. #define C_ENABLE_CLKCHANGE (3)
  93. #define C_REENABLE (4)
  94. #define C_DISABLE_PM (5)
  95. #define C_ENABLE_PM (6)
  96. #define C_STARTUP (7)
  97. #define PXA_NAME "PXA"
  98. /*
  99. * Minimum X and Y resolutions
  100. */
  101. #define MIN_XRES 64
  102. #define MIN_YRES 64
  103. #endif /* __PXAFB_H__ */