sa1100fb.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /*
  2. * linux/drivers/video/sa1100fb.h
  3. * -- StrongARM 1100 LCD Controller Frame Buffer Device
  4. *
  5. * Copyright (C) 1999 Eric A. Thomas
  6. * Based on acornfb.c Copyright (C) Russell King.
  7. *
  8. * This file is subject to the terms and conditions of the GNU General Public
  9. * License. See the file COPYING in the main directory of this archive
  10. * for more details.
  11. */
  12. /*
  13. * These are the bitfields for each
  14. * display depth that we support.
  15. */
  16. struct sa1100fb_rgb {
  17. struct fb_bitfield red;
  18. struct fb_bitfield green;
  19. struct fb_bitfield blue;
  20. struct fb_bitfield transp;
  21. };
  22. /*
  23. * This structure describes the machine which we are running on.
  24. */
  25. struct sa1100fb_mach_info {
  26. u_long pixclock;
  27. u_short xres;
  28. u_short yres;
  29. u_char bpp;
  30. u_char hsync_len;
  31. u_char left_margin;
  32. u_char right_margin;
  33. u_char vsync_len;
  34. u_char upper_margin;
  35. u_char lower_margin;
  36. u_char sync;
  37. u_int cmap_greyscale:1,
  38. cmap_inverse:1,
  39. cmap_static:1,
  40. unused:29;
  41. u_int lccr0;
  42. u_int lccr3;
  43. };
  44. /* Shadows for LCD controller registers */
  45. struct sa1100fb_lcd_reg {
  46. unsigned long lccr0;
  47. unsigned long lccr1;
  48. unsigned long lccr2;
  49. unsigned long lccr3;
  50. };
  51. #define RGB_4 (0)
  52. #define RGB_8 (1)
  53. #define RGB_16 (2)
  54. #define NR_RGB 3
  55. struct sa1100fb_info {
  56. struct fb_info fb;
  57. struct device *dev;
  58. struct sa1100fb_rgb *rgb[NR_RGB];
  59. u_int max_bpp;
  60. u_int max_xres;
  61. u_int max_yres;
  62. /*
  63. * These are the addresses we mapped
  64. * the framebuffer memory region to.
  65. */
  66. dma_addr_t map_dma;
  67. u_char * map_cpu;
  68. u_int map_size;
  69. u_char * screen_cpu;
  70. dma_addr_t screen_dma;
  71. u16 * palette_cpu;
  72. dma_addr_t palette_dma;
  73. u_int palette_size;
  74. dma_addr_t dbar1;
  75. dma_addr_t dbar2;
  76. u_int lccr0;
  77. u_int lccr3;
  78. u_int cmap_inverse:1,
  79. cmap_static:1,
  80. unused:30;
  81. u_int reg_lccr0;
  82. u_int reg_lccr1;
  83. u_int reg_lccr2;
  84. u_int reg_lccr3;
  85. volatile u_char state;
  86. volatile u_char task_state;
  87. struct mutex ctrlr_lock;
  88. wait_queue_head_t ctrlr_wait;
  89. struct work_struct task;
  90. #ifdef CONFIG_CPU_FREQ
  91. struct notifier_block freq_transition;
  92. struct notifier_block freq_policy;
  93. #endif
  94. };
  95. #define TO_INF(ptr,member) container_of(ptr,struct sa1100fb_info,member)
  96. #define SA1100_PALETTE_MODE_VAL(bpp) (((bpp) & 0x018) << 9)
  97. /*
  98. * These are the actions for set_ctrlr_state
  99. */
  100. #define C_DISABLE (0)
  101. #define C_ENABLE (1)
  102. #define C_DISABLE_CLKCHANGE (2)
  103. #define C_ENABLE_CLKCHANGE (3)
  104. #define C_REENABLE (4)
  105. #define C_DISABLE_PM (5)
  106. #define C_ENABLE_PM (6)
  107. #define C_STARTUP (7)
  108. #define SA1100_NAME "SA1100"
  109. /*
  110. * Debug macros
  111. */
  112. #if DEBUG
  113. # define DPRINTK(fmt, args...) printk("%s: " fmt, __func__ , ## args)
  114. #else
  115. # define DPRINTK(fmt, args...)
  116. #endif
  117. /*
  118. * Minimum X and Y resolutions
  119. */
  120. #define MIN_XRES 64
  121. #define MIN_YRES 64