sa1100fb.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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_8 (0)
  52. #define RGB_16 (1)
  53. #define NR_RGB 2
  54. struct sa1100fb_info {
  55. struct fb_info fb;
  56. struct device *dev;
  57. struct sa1100fb_rgb *rgb[NR_RGB];
  58. u_int max_bpp;
  59. u_int max_xres;
  60. u_int max_yres;
  61. /*
  62. * These are the addresses we mapped
  63. * the framebuffer memory region to.
  64. */
  65. dma_addr_t map_dma;
  66. u_char * map_cpu;
  67. u_int map_size;
  68. u_char * screen_cpu;
  69. dma_addr_t screen_dma;
  70. u16 * palette_cpu;
  71. dma_addr_t palette_dma;
  72. u_int palette_size;
  73. dma_addr_t dbar1;
  74. dma_addr_t dbar2;
  75. u_int lccr0;
  76. u_int lccr3;
  77. u_int cmap_inverse:1,
  78. cmap_static:1,
  79. unused:30;
  80. u_int reg_lccr0;
  81. u_int reg_lccr1;
  82. u_int reg_lccr2;
  83. u_int reg_lccr3;
  84. volatile u_char state;
  85. volatile u_char task_state;
  86. struct semaphore ctrlr_sem;
  87. wait_queue_head_t ctrlr_wait;
  88. struct work_struct task;
  89. #ifdef CONFIG_CPU_FREQ
  90. struct notifier_block freq_transition;
  91. struct notifier_block freq_policy;
  92. #endif
  93. };
  94. #define TO_INF(ptr,member) container_of(ptr,struct sa1100fb_info,member)
  95. #define SA1100_PALETTE_MODE_VAL(bpp) (((bpp) & 0x018) << 9)
  96. /*
  97. * These are the actions for set_ctrlr_state
  98. */
  99. #define C_DISABLE (0)
  100. #define C_ENABLE (1)
  101. #define C_DISABLE_CLKCHANGE (2)
  102. #define C_ENABLE_CLKCHANGE (3)
  103. #define C_REENABLE (4)
  104. #define C_DISABLE_PM (5)
  105. #define C_ENABLE_PM (6)
  106. #define C_STARTUP (7)
  107. #define SA1100_NAME "SA1100"
  108. /*
  109. * Debug macros
  110. */
  111. #if DEBUG
  112. # define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args)
  113. #else
  114. # define DPRINTK(fmt, args...)
  115. #endif
  116. /*
  117. * Minimum X and Y resolutions
  118. */
  119. #define MIN_XRES 64
  120. #define MIN_YRES 64