pxafb.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. size_t dma_buff_size;
  64. dma_addr_t dma_buff_phys;
  65. dma_addr_t fdadr[DMA_MAX];
  66. void __iomem *video_mem; /* virtual address of frame buffer */
  67. unsigned long video_mem_phys; /* physical address of frame buffer */
  68. size_t video_mem_size; /* size of the frame buffer */
  69. u16 * palette_cpu; /* virtual address of palette memory */
  70. u_int palette_size;
  71. u_int lccr0;
  72. u_int lccr3;
  73. u_int lccr4;
  74. u_int cmap_inverse:1,
  75. cmap_static:1,
  76. unused:30;
  77. u_int reg_lccr0;
  78. u_int reg_lccr1;
  79. u_int reg_lccr2;
  80. u_int reg_lccr3;
  81. u_int reg_lccr4;
  82. u_int reg_cmdcr;
  83. unsigned long hsync_time;
  84. volatile u_char state;
  85. volatile u_char task_state;
  86. struct mutex ctrlr_lock;
  87. wait_queue_head_t ctrlr_wait;
  88. struct work_struct task;
  89. struct completion disable_done;
  90. #ifdef CONFIG_FB_PXA_SMARTPANEL
  91. uint16_t *smart_cmds;
  92. size_t n_smart_cmds;
  93. struct completion command_done;
  94. struct completion refresh_done;
  95. struct task_struct *smart_thread;
  96. #endif
  97. #ifdef CONFIG_CPU_FREQ
  98. struct notifier_block freq_transition;
  99. struct notifier_block freq_policy;
  100. #endif
  101. void (*lcd_power)(int, struct fb_var_screeninfo *);
  102. void (*backlight_power)(int);
  103. };
  104. #define TO_INF(ptr,member) container_of(ptr,struct pxafb_info,member)
  105. /*
  106. * These are the actions for set_ctrlr_state
  107. */
  108. #define C_DISABLE (0)
  109. #define C_ENABLE (1)
  110. #define C_DISABLE_CLKCHANGE (2)
  111. #define C_ENABLE_CLKCHANGE (3)
  112. #define C_REENABLE (4)
  113. #define C_DISABLE_PM (5)
  114. #define C_ENABLE_PM (6)
  115. #define C_STARTUP (7)
  116. #define PXA_NAME "PXA"
  117. /*
  118. * Minimum X and Y resolutions
  119. */
  120. #define MIN_XRES 64
  121. #define MIN_YRES 64
  122. #endif /* __PXAFB_H__ */